From ac2561826714dbd268cefa2f6c04e9633ee22455 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 15 Apr 2022 21:39:24 +0000 Subject: [PATCH] SystemUI: stop using IPackageManager::isOnlyCoreApps() Due to the removal of support for Full Disk Encryption, this method always returns false. In preparation for removing it, stop calling it from SystemUI. Bug: 208476087 Change-Id: I5b9de5667780388d19c1b3addae2124c35400ed2 --- .../keyguard/KeyguardUpdateMonitor.java | 16 -------------- .../keyguard/KeyguardViewMediator.java | 6 ----- .../systemui/statusbar/CommandQueue.java | 5 +---- .../statusbar/phone/CentralSurfaces.java | 22 +------------------ 4 files changed, 2 insertions(+), 47 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index a6feedb50a125..dc1958552a9fa 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -50,7 +50,6 @@ 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.content.pm.UserInfo; @@ -233,21 +232,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab 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(); - } - } - public final boolean mRequestActiveUnlockOnAssistant; public final boolean mRequestActiveUnlockOnWakeup; public final boolean mInitiateActiveUnlockOnWakeup; diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 0f5022df17d8f..95d2f354d010e 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -1744,12 +1744,6 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, * 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"); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java index 5585cde528faa..6fd92024c18c4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java @@ -23,8 +23,6 @@ import static android.inputmethodservice.InputMethodService.IME_INVISIBLE; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; -import static com.android.systemui.statusbar.phone.CentralSurfaces.ONLY_CORE_APPS; - import android.annotation.Nullable; import android.app.ITransientNotificationCallback; import android.app.StatusBarManager; @@ -514,8 +512,7 @@ public class CommandQueue extends IStatusBar.Stub implements final int disabled1 = getDisabled1(DEFAULT_DISPLAY); final int disabled2 = getDisabled2(DEFAULT_DISPLAY); return (disabled1 & StatusBarManager.DISABLE_EXPAND) == 0 - && (disabled2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) == 0 - && !ONLY_CORE_APPS; + && (disabled2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) == 0; } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index a1dbf0c3f5b68..921ed123bb0b8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -64,7 +64,6 @@ 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.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; @@ -329,29 +328,11 @@ public class CentralSurfaces extends CoreStartable implements public static final int[] CAMERA_LAUNCH_GESTURE_VIBRATION_AMPLITUDES = new int[]{39, 82, 139, 213, 0, 127}; - /** - * If true, the system is in the half-boot-to-decryption-screen state. - * Prudently disable QS and notifications. - */ - public static final boolean ONLY_CORE_APPS; - /** If true, the lockscreen will show a distinct wallpaper */ public static final boolean ENABLE_LOCKSCREEN_WALLPAPER = true; private static final UiEventLogger sUiEventLogger = new UiEventLoggerImpl(); - static { - boolean onlyCoreApps; - try { - IPackageManager packageManager = - IPackageManager.Stub.asInterface(ServiceManager.getService("package")); - onlyCoreApps = packageManager != null && packageManager.isOnlyCoreApps(); - } catch (RemoteException e) { - onlyCoreApps = false; - } - ONLY_CORE_APPS = onlyCoreApps; - } - private final LockscreenShadeTransitionController mLockscreenShadeTransitionController; private final DreamOverlayStateController mDreamOverlayStateController; private CentralSurfacesCommandQueueCallbacks mCommandQueueCallbacks; @@ -1653,8 +1634,7 @@ public class CentralSurfaces extends CoreStartable implements || !mUserSwitcherController.isSimpleUserSwitcher()) && !isShadeDisabled() && ((mDisabled2 & StatusBarManager.DISABLE2_QUICK_SETTINGS) == 0) - && !mDozing - && !ONLY_CORE_APPS; + && !mDozing; mNotificationPanelViewController.setQsExpansionEnabledPolicy(expandEnabled); Log.d(TAG, "updateQsExpansionEnabled - QS Expand enabled: " + expandEnabled); }