diff options
4 files changed, 17 insertions, 6 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index 6e74184cef02..39ab61136d68 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -602,8 +602,7 @@ <service android:name=".keyguard.KeyguardService" - android:exported="true" - android:enabled="@bool/config_enableKeyguardService" /> + android:exported="true" /> <activity android:name=".keyguard.WorkLockActivity" android:label="@string/accessibility_desc_work_lock" diff --git a/packages/SystemUI/res/values-television/config.xml b/packages/SystemUI/res/values-television/config.xml index 90ea5e203429..3968a67f083a 100644 --- a/packages/SystemUI/res/values-television/config.xml +++ b/packages/SystemUI/res/values-television/config.xml @@ -42,4 +42,7 @@ <item>com.android.systemui.statusbar.notification.InstantAppNotifier</item> <item>com.android.systemui.toast.ToastUI</item> </string-array> + + <!-- Svelte specific logic, see RecentsConfiguration.SVELTE_* constants. --> + <integer name="recents_svelte_level">3</integer> </resources> diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 009773849c5f..e42bf612c09f 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -168,9 +168,6 @@ <!-- Animation duration when using long press on recents to dock --> <integer name="long_press_dock_anim_duration">250</integer> - <!-- Whether to enable KeyguardService or not --> - <bool name="config_enableKeyguardService">true</bool> - <!-- The maximum count of notifications on Keyguard. The rest will be collapsed in an overflow card. --> <integer name="keyguard_max_notification_count">3</integer> 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 |