diff options
author | DvTonder <david.vantonder@gmail.com> | 2014-11-14 09:44:49 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-25 21:49:31 -0700 |
commit | 8451a456fcfa23889c79c0ffe8406dde07c95c54 (patch) | |
tree | 754a51378c7ca92bd9d8bd531a0a4d7af27d50d9 /packages/SystemUI/src/com/android/systemui/keyguard | |
parent | cdd6996ead6a1803f64df0e06300c507d868fcca (diff) | |
download | frameworks_base-8451a456fcfa23889c79c0ffe8406dde07c95c54.zip frameworks_base-8451a456fcfa23889c79c0ffe8406dde07c95c54.tar.gz frameworks_base-8451a456fcfa23889c79c0ffe8406dde07c95c54.tar.bz2 |
Power menu customizations [1/2]
power
reboot
screenshot
profile switcher
airplane mode
user switcher
bug reports
sound modes
[mikeioannina]: Modify for CyanogenMod
framework: Add advanced reboot options (2 of 2)
This commit is an squash of the commits below and re-adds the reboot
logic to CM.
I took the liberty to rewrite some of the ShutdownThread code because
it had some lingering issues present since I originally wrote this
for CM7 (!!). Namely, the reboot reason was being changed when the items
are pressed instead of when the user presses the positive button. This
made some people add workarounds like handling back button presses and
whatnot, these are gone now.
commit 588464bea40b92b04c4aeee35c47f7becceeed56
Author: Roman Birg <roman@cyngn.com>
Date: Thu Jul 10 14:20:42 2014 -0700
advanced reboot: add soft reboot option
Adds a "Soft reboot" option which restarts zygote, as requested in JIRA
CYAN-3998
Signed-off-by: Roman Birg <roman@cyngn.com>
Conflicts:
core/res/res/values/cm_arrays.xml
core/res/res/values/cm_strings.xml
services/java/com/android/server/power/ShutdownThread.java
commit 3e7b92551bbf818ace41cd9b9532473ed7d18f2f
Author: Veeti Paananen <veeti.paananen@rojekti.fi>
Date: Tue Jul 23 16:34:35 2013 +0300
Show advanced reboot if using an insecure lock screen
Enables the advanced reboot menu when locked if the selected lock method
is insecure (= slide unlock).
Conflicts:
services/java/com/android/server/power/ShutdownThread.java
commit cf42ed3993d5d05c9b2591883fefb6338fbcdd40
Author: DvTonder <david.vantonder@gmail.com>
Date: Thu Feb 21 18:20:01 2013 -0500
Framework: Show the Advanced reboot menu only for the primary user
Conflicts:
services/java/com/android/server/power/ShutdownThread.java
commit 08aa6fd643e0359114b86f50053921dd2d86fc50
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date: Mon Nov 4 03:37:40 2013 +0000
Framework: Add Advanced reboot (2 of 2)
This commit responds to a setting in Development settings for including
options in the power menu for rebooting into recovery or bootloader. It
is defauled to off.
When enabled, the Advanced reboot options will only be available once the
device is unlocked.
Enhance power menu reboot option
* Use our old reboot icon
* Set correct dialog title & message when rebooting
* Move strings to cm_strings
* Add back reboot_download string used by samsung devices
* Remove Chinese translations, will be handled through crowdin
policy: Remove references of Profiles in android.policy.
We can't reference the CMSDK within a jar that is exported in the
BOOTCLASSPATH, otherwise we end up overriding the 3rd party
applications classloaded jar and causing various issues during
runtime.
Change-Id: Ia0b7950d17bb7450347b57d8a423c44df982b195
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/keyguard')
-rwxr-xr-x[-rw-r--r--] | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index a1c8b1a..af24b4a 100644..100755 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -56,6 +56,9 @@ import android.view.WindowManagerPolicy; import android.view.animation.Animation; import android.view.animation.AnimationUtils; +import cyanogenmod.app.Profile; +import cyanogenmod.app.ProfileManager; + import com.android.internal.policy.IKeyguardDrawnCallback; import com.android.internal.policy.IKeyguardExitCallback; import com.android.internal.policy.IKeyguardStateCallback; @@ -188,7 +191,7 @@ public class KeyguardViewMediator extends SystemUI { private AudioManager mAudioManager; private StatusBarManager mStatusBarManager; private boolean mSwitchingUser; - + private ProfileManager mProfileManager; private boolean mSystemReady; private boolean mBootCompleted; private boolean mBootSendUserPresent; @@ -571,7 +574,7 @@ public class KeyguardViewMediator extends SystemUI { mShowKeyguardWakeLock = mPM.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "show keyguard"); mShowKeyguardWakeLock.setReferenceCounted(false); - + mProfileManager = ProfileManager.getInstance(mContext); mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(DELAYED_KEYGUARD_ACTION)); mKeyguardDisplayManager = new KeyguardDisplayManager(mContext); @@ -799,7 +802,7 @@ public class KeyguardViewMediator extends SystemUI { } private void maybeSendUserPresentBroadcast() { - if (mSystemReady && mLockPatternUtils.isLockScreenDisabled( + if (mSystemReady && isKeyguardDisabled( KeyguardUpdateMonitor.getCurrentUser())) { // Lock screen is disabled because the user has set the preference to "None". // In this case, send out ACTION_USER_PRESENT here instead of in @@ -808,6 +811,25 @@ public class KeyguardViewMediator extends SystemUI { } } + private boolean isKeyguardDisabled(int userId) { + if (!mExternallyEnabled) { + if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled externally"); + return true; + } + if (mLockPatternUtils.isLockScreenDisabled(userId)) { + if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled by setting"); + return true; + } + Profile profile = mProfileManager.getActiveProfile(); + if (profile != null) { + if (profile.getScreenLockMode().getValue() == Profile.LockMode.DISABLE) { + if (DEBUG) Log.d(TAG, "isKeyguardDisabled: keyguard is disabled by profile"); + return true; + } + } + return false; + } + /** * A dream started. We should lock after the usual screen-off lock timeout but only * if there is a secure lock pattern. @@ -1054,7 +1076,7 @@ public class KeyguardViewMediator extends SystemUI { return; } - if (mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser()) + if (isKeyguardDisabled(KeyguardUpdateMonitor.getCurrentUser()) && !lockedOrMissing) { if (DEBUG) Log.d(TAG, "doKeyguard: not showing because lockscreen is off"); return; |