diff options
author | d34d <clark@cyngn.com> | 2015-08-12 14:34:22 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-03-16 15:59:16 -0700 |
commit | 01ba664b696c3f5ad711842a69bf9c8259525c67 (patch) | |
tree | ae3d712fda93c09dc9bba6c0f19bb078368554db | |
parent | 19c3a8cd2ac39bd517556c7c63b868e45fd621ef (diff) | |
download | frameworks_base-01ba664b696c3f5ad711842a69bf9c8259525c67.zip frameworks_base-01ba664b696c3f5ad711842a69bf9c8259525c67.tar.gz frameworks_base-01ba664b696c3f5ad711842a69bf9c8259525c67.tar.bz2 |
Keyguard: Don't show keyguard if CryptKeeper enabled
Some devices are exhibiting an issue where the keyguard will be
shown on top of the decrypt device screen when they have their
sim locked. When this occurs, the user is not able to enter their
pin/password to decrypt the device even after the keyguard is
dismissed.
Change-Id: I7362b77a6ea2ec41c8835ae763ce427c12c02138
REF: NIGHTLIES-1254
-rwxr-xr-x | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 2152ede6..36eac87 100755 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -26,11 +26,13 @@ import android.app.StatusBarManager; import android.app.admin.DevicePolicyManager; import android.app.trust.TrustManager; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; +import android.content.pm.PackageManager; import android.content.pm.UserInfo; import android.database.ContentObserver; import android.media.AudioManager; @@ -151,6 +153,9 @@ public class KeyguardViewMediator extends SystemUI { "com.android.internal.action.KEYGUARD_SERVICE_STATE_CHANGED"; private static final String KEYGUARD_SERVICE_EXTRA_ACTIVE = "active"; + private static final String SETTINGS_PACKAGE = "com.android.settings"; + private static final String CRYPT_KEEPER_ACTIVITY = SETTINGS_PACKAGE + ".CryptKeeper"; + // used for handler messages private static final int SHOW = 2; private static final int HIDE = 3; @@ -343,6 +348,8 @@ public class KeyguardViewMediator extends SystemUI { */ private boolean mPendingLock; + private int mCyrptKeeperEnabledState = -1; + private boolean mWakeAndUnlocking; private IKeyguardDrawnCallback mDrawnCallback; @@ -921,6 +928,16 @@ public class KeyguardViewMediator extends SystemUI { return false; } + private boolean isCryptKeeperEnabled() { + if (mCyrptKeeperEnabledState == -1) { + PackageManager pm = mContext.getPackageManager(); + mCyrptKeeperEnabledState = pm.getComponentEnabledSetting( + new ComponentName(SETTINGS_PACKAGE, CRYPT_KEEPER_ACTIVITY)); + } + + return mCyrptKeeperEnabledState != PackageManager.COMPONENT_ENABLED_STATE_DISABLED; + } + /** * A dream started. We should lock after the usual screen-off lock timeout but only * if there is a secure lock pattern. @@ -1187,6 +1204,14 @@ public class KeyguardViewMediator extends SystemUI { return; } + // Ugly hack to ensure keyguard is not shown on top of the CryptKeeper which prevents + // a user from being able to decrypt their device. + if (isCryptKeeperEnabled()) { + if (DEBUG) Log.d(TAG, "doKeyguard: not showing because CryptKeeper is enabled"); + resetStateLocked(); + return; + } + // if the setup wizard hasn't run yet, don't show final boolean requireSim = !SystemProperties.getBoolean("keyguard.no_require_sim", false); final boolean absent = SubscriptionManager.isValidSubscriptionId( |