+++ b/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -128,6 +128,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
private static final String GLOBAL_ACTION_KEY_RESTART = "restart";
private static final String GLOBAL_ACTION_KEY_LOGOUT = "logout";
private static final String GLOBAL_ACTION_KEY_SCREENSHOT = "screenshot";
+ private static final String GLOBAL_ACTION_KEY_NAViGATIONBAR = "navigationbar";
private final Context mContext;
private final GlobalActionsManager mWindowManagerFuncs;
@@ -337,6 +338,8 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
}
if (GLOBAL_ACTION_KEY_POWER.equals(actionKey)) {
mItems.add(new PowerAction());
+ }else if(GLOBAL_ACTION_KEY_NAViGATIONBAR.equals(actionKey)){
+ mItems.add(new NavigationBarAction());
} else if (GLOBAL_ACTION_KEY_AIRPLANE.equals(actionKey)) {
//bird add by wucheng 20181031 begin
if (SystemProperties.getBoolean("ro.bdfun.add_airplane", false)) {
@@ -619,6 +622,34 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
}
}
+ private class NavigationBarAction extends SinglePressAction {
+ public NavigationBarAction() {
+ super(R.drawable.ic_navigation_bar_icon, R.string.global_action_navigationbar);
+ }
+
+ @Override
+ public void onPress() {
+ mHandler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ ///doSometing
+ }
+ }, 500);
+ }
+
+ @Override
+ public boolean showDuringKeyguard() {
+ return true;
+ }
+
+ @Override
+ public boolean showBeforeProvisioning() {
+ return false;
+ }
+ }
//frameworks/base/core/res/res/values/config.xml
<string-array translatable="false" name="config_globalActionsList">
<item>power</item>
<item>restart</item>
<item>screenshot</item>
+ <item>navigationbar</item>
</string-array>