summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2017-08-17 19:00:58 +0200
committer Adrian Roos <roosa@google.com> 2017-08-17 19:00:59 +0200
commitca8a216cf527c9a5a67e768cd31c39e7aefb1c64 (patch)
tree031d4a686cb3d0fd0ff36344e055cfb2e53bc62a
parent1e3b49c104300c0f68ec506e4f457640c434afe3 (diff)
Keyguard: Don't show when booting to cryptkeeper
Fixes an issue where the keyguard would show if we booted to cryptkeeper and a SIM PIN is set. Note that this only happens when the telephony stack gets enabled, which in cryptkeeper mode is usually only after an emergency call. Change-Id: I5e5f104189a9d33c356edc181e92409bb63b59d7 Fixes: 64197124 Test: Enter cryptkeeper, make emergency call, verify SIM lock screen does not show.
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java6
2 files changed, 23 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 669594b86e54..141c7fdbd614 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -38,6 +38,7 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.database.ContentObserver;
@@ -52,6 +53,7 @@ import android.os.Handler;
import android.os.IRemoteCallback;
import android.os.Message;
import android.os.RemoteException;
+import android.os.ServiceManager;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
@@ -157,6 +159,21 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private static final ComponentName FALLBACK_HOME_COMPONENT = new ComponentName(
"com.android.settings", "com.android.settings.FallbackHome");
+
+ /**
+ * If true, the system is in the half-boot-to-decryption-screen state.
+ * Prudently disable lockscreen.
+ */
+ public static final boolean CORE_APPS_ONLY;
+ static {
+ try {
+ CORE_APPS_ONLY = IPackageManager.Stub.asInterface(
+ ServiceManager.getService("package")).isOnlyCoreApps();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
private static KeyguardUpdateMonitor sInstance;
private final Context mContext;
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 4733008c06c3..3eb68f5214c0 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1228,6 +1228,12 @@ public class KeyguardViewMediator extends SystemUI {
* Enable the keyguard if the settings are appropriate.
*/
private void doKeyguardLocked(Bundle options) {
+ if (KeyguardUpdateMonitor.CORE_APPS_ONLY) {
+ // Don't show keyguard during half-booted cryptkeeper stage.
+ if (DEBUG) Log.d(TAG, "doKeyguard: not showing because booting to cryptkeeper");
+ return;
+ }
+
// if another app is disabling us, don't show
if (!mExternallyEnabled) {
if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");