diff options
author | Justin Koh <justinkoh@google.com> | 2014-05-12 16:00:36 -0700 |
---|---|---|
committer | Justin Koh <justinkoh@google.com> | 2014-05-14 17:30:32 +0000 |
commit | 1c46c2d7848cb59a50341f7ff0867311d8b96b15 (patch) | |
tree | 724ce54b40c03e2454211cec8030c2d48f12dcc7 /policy | |
parent | c5df4d0e7d43d39072dfbab5f37d8b170de4617b (diff) | |
download | frameworks_base-1c46c2d7848cb59a50341f7ff0867311d8b96b15.zip frameworks_base-1c46c2d7848cb59a50341f7ff0867311d8b96b15.tar.gz frameworks_base-1c46c2d7848cb59a50341f7ff0867311d8b96b15.tar.bz2 |
If there is only 1 simple global action, autolaunch it
Requested by UX. Also made settings available before provisioning
Bug: 14683740
Bug: 14886954
Change-Id: If62ccc6472a72b7adb4d309ee89e51069f8e0413
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/GlobalActions.java | 19 |
1 files changed, 13 insertions, 6 deletions
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(); } |