summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Koh <justinkoh@google.com>2014-05-15 17:17:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-15 17:17:14 +0000
commit0ade263c28ea62e619972752ef2e6a6c994eeddf (patch)
treec3192b049dacc2e2a728a64cdbda941bfe79fd3a
parentbd44640c7f532cdfe2b6d8c3e721abd92fbca65e (diff)
parent1c46c2d7848cb59a50341f7ff0867311d8b96b15 (diff)
downloadframeworks_base-0ade263c28ea62e619972752ef2e6a6c994eeddf.zip
frameworks_base-0ade263c28ea62e619972752ef2e6a6c994eeddf.tar.gz
frameworks_base-0ade263c28ea62e619972752ef2e6a6c994eeddf.tar.bz2
Merge "If there is only 1 simple global action, autolaunch it" into klp-modular-dev
-rw-r--r--core/res/res/values-watch/config.xml3
-rw-r--r--policy/src/com/android/internal/policy/impl/GlobalActions.java19
2 files changed, 14 insertions, 8 deletions
diff --git a/core/res/res/values-watch/config.xml b/core/res/res/values-watch/config.xml
index 44e258d..8d82a17 100644
--- a/core/res/res/values-watch/config.xml
+++ b/core/res/res/values-watch/config.xml
@@ -21,9 +21,8 @@
for watch products. Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Only show power and settings items due to smaller real estate. -->
+ <!-- Only show settings item due to smaller real estate. -->
<string-array translatable="false" name="config_globalActionsList">
- <item>power</item>
<item>settings</item>
</string-array>
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java
index 98b5a5a..f9e8c30 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -182,11 +182,17 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
mDialog = createDialog();
prepareDialog();
- WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes();
- attrs.setTitle("GlobalActions");
- mDialog.getWindow().setAttributes(attrs);
- mDialog.show();
- mDialog.getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_DISABLE_EXPAND);
+ // If we only have 1 item and it's a simple press action, just do this action.
+ if (mAdapter.getCount() == 1
+ && mAdapter.getItem(0) instanceof SinglePressAction) {
+ ((SinglePressAction) mAdapter.getItem(0)).onPress();
+ } else {
+ WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes();
+ attrs.setTitle("GlobalActions");
+ mDialog.getWindow().setAttributes(attrs);
+ mDialog.show();
+ mDialog.getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_DISABLE_EXPAND);
+ }
}
/**
@@ -397,7 +403,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
@Override
public boolean showBeforeProvisioning() {
- return false;
+ return true;
}
};
}
@@ -1021,6 +1027,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
mEnableAccessibilityController = null;
super.setCanceledOnTouchOutside(true);
}
+
super.onStart();
}