Merge "Cleanup code that should never be null" into tm-qpr-dev am: ed74a53d23

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20195507

Change-Id: I39a3f61601da08747e1e100587354b37853e3ebd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Matt Pietal
2022-10-17 10:57:22 +00:00
committed by Automerger Merge Worker

View File

@@ -91,7 +91,6 @@ import android.util.EventLog;
import android.util.IndentingPrintWriter; import android.util.IndentingPrintWriter;
import android.util.Log; import android.util.Log;
import android.util.MathUtils; import android.util.MathUtils;
import android.util.Slog;
import android.view.Display; import android.view.Display;
import android.view.IRemoteAnimationRunner; import android.view.IRemoteAnimationRunner;
import android.view.IWindowManager; import android.view.IWindowManager;
@@ -3813,8 +3812,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
if (mDevicePolicyManager.getCameraDisabled(null, if (mDevicePolicyManager.getCameraDisabled(null,
mLockscreenUserManager.getCurrentUserId())) { mLockscreenUserManager.getCurrentUserId())) {
return false; return false;
} else if (mStatusBarKeyguardViewManager == null } else if (isKeyguardShowing() && isKeyguardSecure()) {
|| (isKeyguardShowing() && isKeyguardSecure())) {
// Check if the admin has disabled the camera specifically for the keyguard // Check if the admin has disabled the camera specifically for the keyguard
return (mDevicePolicyManager.getKeyguardDisabledFeatures(null, return (mDevicePolicyManager.getKeyguardDisabledFeatures(null,
mLockscreenUserManager.getCurrentUserId()) mLockscreenUserManager.getCurrentUserId())
@@ -4222,14 +4220,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
@Override @Override
public boolean isKeyguardSecure() { public boolean isKeyguardSecure() {
if (mStatusBarKeyguardViewManager == null) {
// startKeyguard() hasn't been called yet, so we don't know.
// Make sure anything that needs to know isKeyguardSecure() checks and re-checks this
// value onVisibilityChanged().
Slog.w(TAG, "isKeyguardSecure() called before startKeyguard(), returning false",
new Throwable());
return false;
}
return mStatusBarKeyguardViewManager.isSecure(); return mStatusBarKeyguardViewManager.isSecure();
} }
@Override @Override
@@ -4289,11 +4279,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
.Callback() { .Callback() {
@Override @Override
public void onFinished() { public void onFinished() {
if (mStatusBarKeyguardViewManager == null) {
Log.w(TAG, "Tried to notify keyguard visibility when "
+ "mStatusBarKeyguardViewManager was null");
return;
}
if (mKeyguardStateController.isKeyguardFadingAway()) { if (mKeyguardStateController.isKeyguardFadingAway()) {
mStatusBarKeyguardViewManager.onKeyguardFadedAway(); mStatusBarKeyguardViewManager.onKeyguardFadedAway();
} }