diff options
| author | 2021-11-16 18:34:47 +0000 | |
|---|---|---|
| committer | 2021-11-16 18:34:47 +0000 | |
| commit | 876f328142d75ae92ab42cabd3a4b0ceb5492455 (patch) | |
| tree | 1676c5ca6da68ebefba2a81e52ca67f69d05fc35 | |
| parent | 2d3bb1c042a8355865f3b1e43b601d4675cfc672 (diff) | |
| parent | c42b12803824125feda7ccd0d58f0a3878f04487 (diff) | |
Merge "Fix NPE for UDFPS devices without HBM" am: 6893b19adc am: 26fedd6afe am: c42b128038
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893387
Change-Id: I81837e2232563244c855565a226ba6e5da1958ea
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java index 6d31ef0e7701..30e5aed2f8d8 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java @@ -241,18 +241,20 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin if (mGhbmView != null && surface == null) { Log.e(TAG, "doIlluminate | surface must be non-null for GHBM"); } - mHbmProvider.enableHbm(mHbmType, surface, () -> { - if (mGhbmView != null) { - mGhbmView.drawIlluminationDot(mSensorRect); - } - if (onIlluminatedRunnable != null) { - // No framework API can reliably tell when a frame reaches the panel. A timeout - // is the safest solution. - postDelayed(onIlluminatedRunnable, mOnIlluminatedDelayMs); - } else { - Log.w(TAG, "doIlluminate | onIlluminatedRunnable is null"); - } - }); + if (mHbmProvider != null) { + mHbmProvider.enableHbm(mHbmType, surface, () -> { + if (mGhbmView != null) { + mGhbmView.drawIlluminationDot(mSensorRect); + } + if (onIlluminatedRunnable != null) { + // No framework API can reliably tell when a frame reaches the panel. A timeout + // is the safest solution. + postDelayed(onIlluminatedRunnable, mOnIlluminatedDelayMs); + } else { + Log.w(TAG, "doIlluminate | onIlluminatedRunnable is null"); + } + }); + } } @Override @@ -265,6 +267,8 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin mGhbmView.setGhbmIlluminationListener(null); mGhbmView.setVisibility(View.INVISIBLE); } - mHbmProvider.disableHbm(null /* onHbmDisabled */); + if (mHbmProvider != null) { + mHbmProvider.disableHbm(null /* onHbmDisabled */); + } } } |