summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJustin Koh <justinkoh@google.com>2014-05-15 17:23:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-15 17:23:55 +0000
commit6abab04c991c5307f0634322a9b88aa1b181a7a6 (patch)
treeac9918d4662ba916a5b81d0121c5fe710d0389fd /policy
parent25f9a3cd27a3d94b97d3d27c018e77a2e784e13b (diff)
parent8b2e7c4aaa1198a0a2d4fe1effd03f889e5d3130 (diff)
downloadframeworks_base-6abab04c991c5307f0634322a9b88aa1b181a7a6.zip
frameworks_base-6abab04c991c5307f0634322a9b88aa1b181a7a6.tar.gz
frameworks_base-6abab04c991c5307f0634322a9b88aa1b181a7a6.tar.bz2
am 8b2e7c4a: am 0ade263c: Merge "If there is only 1 simple global action, autolaunch it" into klp-modular-dev
* commit '8b2e7c4aaa1198a0a2d4fe1effd03f889e5d3130': If there is only 1 simple global action, autolaunch it
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/GlobalActions.java19
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 fec9dda..673ce0b 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -183,11 +183,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);
+ }
}
/**
@@ -398,7 +404,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
@Override
public boolean showBeforeProvisioning() {
- return false;
+ return true;
}
};
}
@@ -1024,6 +1030,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
mEnableAccessibilityController = null;
super.setCanceledOnTouchOutside(true);
}
+
super.onStart();
}