Cleanup code that should never be null

It is injected via dagger and not optional

Fixes: 248533826
Test: atest CentralSurfacesImplTest
Change-Id: Id95d83055ecc490560d312b395b33fb40df89387
This commit is contained in:
Matt Pietal
2022-10-14 18:02:01 +00:00
parent e71cdf4170
commit 27be95df60

View File

@@ -91,7 +91,6 @@ import android.util.EventLog;
import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.MathUtils;
import android.util.Slog;
import android.view.Display;
import android.view.IRemoteAnimationRunner;
import android.view.IWindowManager;
@@ -3812,8 +3811,7 @@ public class CentralSurfacesImpl extends CoreStartable implements
if (mDevicePolicyManager.getCameraDisabled(null,
mLockscreenUserManager.getCurrentUserId())) {
return false;
} else if (mStatusBarKeyguardViewManager == null
|| (isKeyguardShowing() && isKeyguardSecure())) {
} else if (isKeyguardShowing() && isKeyguardSecure()) {
// Check if the admin has disabled the camera specifically for the keyguard
return (mDevicePolicyManager.getKeyguardDisabledFeatures(null,
mLockscreenUserManager.getCurrentUserId())
@@ -4221,14 +4219,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
@Override
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();
}
@Override
@@ -4288,11 +4278,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
.Callback() {
@Override
public void onFinished() {
if (mStatusBarKeyguardViewManager == null) {
Log.w(TAG, "Tried to notify keyguard visibility when "
+ "mStatusBarKeyguardViewManager was null");
return;
}
if (mKeyguardStateController.isKeyguardFadingAway()) {
mStatusBarKeyguardViewManager.onKeyguardFadedAway();
}