From 9a87d6370d6c5fe5802190d0929496e19fe208d3 Mon Sep 17 00:00:00 2001 From: kwaky Date: Fri, 24 Apr 2020 11:17:56 -0700 Subject: [PATCH] Ignore revealKeyguardIfBouncerPrepared request if Bouncer is null. Conceptually, if the Bouncer is not yet instantiated, it is not prepared so we should ignore the request. Test: Existing unit tests passing Bug: 154928953 Change-Id: Iaa61d65ab8fc056b9ac4566f43599e81a2024e92 --- .../systemui/car/keyguard/CarKeyguardViewController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/CarSystemUI/src/com/android/systemui/car/keyguard/CarKeyguardViewController.java b/packages/CarSystemUI/src/com/android/systemui/car/keyguard/CarKeyguardViewController.java index 4fde30987e509..197c52df71458 100644 --- a/packages/CarSystemUI/src/com/android/systemui/car/keyguard/CarKeyguardViewController.java +++ b/packages/CarSystemUI/src/com/android/systemui/car/keyguard/CarKeyguardViewController.java @@ -346,6 +346,13 @@ public class CarKeyguardViewController extends OverlayViewController implements private void revealKeyguardIfBouncerPrepared() { int reattemptDelayMillis = 50; Runnable revealKeyguard = () -> { + if (mBouncer == null) { + if (DEBUG) { + Log.d(TAG, "revealKeyguardIfBouncerPrepared: revealKeyguard request is ignored " + + "since the Bouncer has not been initialized yet."); + } + return; + } if (!mBouncer.inTransit() || !mBouncer.isSecure()) { getLayout().setVisibility(View.VISIBLE); } else {