diff options
author | Robin Lee <rgl@google.com> | 2020-11-19 22:34:37 +0100 |
---|---|---|
committer | Robin Lee <rgl@google.com> | 2020-11-24 18:09:49 +0100 |
commit | 03ec0d04929fd532837d585ee97c41fb6ad8cc26 (patch) | |
tree | f8b7b7004574c5856ea4fa61714503a9cc5f3e6c /packages/SystemUI/src | |
parent | dfb7ca61574f46f7ceb7797d14b95aeb319ee370 (diff) |
Move keyguard enabled to Component Override
When using RROs, android:enabled="@bool/form_factor_flag" won't work any
more. So we need to use a component override flag per b/135048762.
Test: Flash an adt3 with RRO enabled. see that systemui is coming up.
Bug: 173138807
Change-Id: If9a99f850ebb34755b4146b786c189f9fb590c3d
Merged-In: If9a99f850ebb34755b4146b786c189f9fb590c3d
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 75f4809d752f..37848d68df58 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -34,10 +34,12 @@ import android.app.PendingIntent; import android.app.StatusBarManager; 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.pm.PackageManager.NameNotFoundException; import android.content.pm.UserInfo; import android.hardware.biometrics.BiometricSourceType; import android.media.AudioAttributes; @@ -89,6 +91,7 @@ import com.android.systemui.SystemUIFactory; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.qualifiers.UiBackground; import com.android.systemui.dump.DumpManager; +import com.android.systemui.keyguard.KeyguardService; import com.android.systemui.keyguard.dagger.KeyguardModule; import com.android.systemui.plugins.FalsingManager; import com.android.systemui.shared.system.QuickStepContract; @@ -784,7 +787,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { // Assume keyguard is showing (unless it's disabled) until we know for sure, unless Keyguard // is disabled. - if (mContext.getResources().getBoolean(R.bool.config_enableKeyguardService)) { + if (isKeyguardServiceEnabled()) { setShowingLocked(!shouldWaitForProvisioning() && !mLockPatternUtils.isLockScreenDisabled( KeyguardUpdateMonitor.getCurrentUser()), true /* forceCallbacks */); @@ -962,6 +965,15 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { mUpdateMonitor.dispatchFinishedGoingToSleep(why); } + private boolean isKeyguardServiceEnabled() { + try { + return mContext.getPackageManager().getServiceInfo( + new ComponentName(mContext, KeyguardService.class), 0).isEnabled(); + } catch (NameNotFoundException e) { + return true; + } + } + private long getLockTimeout(int userId) { // if the screen turned off because of timeout or the user hit the power button // and we don't need to lock immediately, set an alarm |