diff options
author | Craig Mautner <cmautner@google.com> | 2012-09-30 12:35:45 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2012-10-05 15:29:25 -0700 |
commit | 88400d3a31139c40c4014faf86c243647087ef6c (patch) | |
tree | 757304f49e7cc134d2dd6f832750fd4583e1f79d /packages/SystemUI/src/com/android/systemui/power | |
parent | 7fd1386b8a2b30669e0ffe0bacf17dd1feb5dba5 (diff) | |
download | frameworks_base-88400d3a31139c40c4014faf86c243647087ef6c.zip frameworks_base-88400d3a31139c40c4014faf86c243647087ef6c.tar.gz frameworks_base-88400d3a31139c40c4014faf86c243647087ef6c.tar.bz2 |
Add flag for displaying non-user's Windows to user.
Created a new flag that indicates that a window should be shown
to all users. For the flag to be valid the owner of the window
must have system permissions.
Also separated system window types into those that show to all
users (e.g. StatusBar, Keyguard, ....) and those that appear only
to the owning users (e.g. Drag, ANR, TOAST, ...). Those that appear
only to their owner can override their default behavior using
the new flag (e.g. LowBattery).
Fixes bug 7211965.
Change-Id: I1fdca25d57b7b523f0c7f8bceb819af656c388d4
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/power')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/power/PowerUI.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index 3c30f5d..07fd0ab 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -207,6 +207,7 @@ public class PowerUI extends SystemUI { if (intent.resolveActivity(mContext.getPackageManager()) != null) { b.setNegativeButton(R.string.battery_low_why, new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int which) { mContext.startActivity(intent); dismissLowBatteryWarning(); @@ -216,12 +217,15 @@ public class PowerUI extends SystemUI { AlertDialog d = b.create(); d.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override public void onDismiss(DialogInterface dialog) { mLowBatteryDialog = null; mBatteryLevelTextView = null; } }); d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); + d.getWindow().getAttributes().privateFlags |= + WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS; d.show(); mLowBatteryDialog = d; } |