Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 238f84fc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE for UDFPS devices without HBM"

parents f8a759f2 e30af88c
Loading
Loading
Loading
Loading
+17 −13
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
        if (mGhbmView != null && surface == null) {
            Log.e(TAG, "doIlluminate | surface must be non-null for GHBM");
        }
        if (mHbmProvider != null) {
            mHbmProvider.enableHbm(mHbmType, surface, () -> {
                if (mGhbmView != null) {
                    mGhbmView.drawIlluminationDot(mSensorRect);
@@ -254,6 +255,7 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
                }
            });
        }
    }

    @Override
    public void stopIllumination() {
@@ -265,6 +267,8 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
            mGhbmView.setGhbmIlluminationListener(null);
            mGhbmView.setVisibility(View.INVISIBLE);
        }
        if (mHbmProvider != null) {
            mHbmProvider.disableHbm(null /* onHbmDisabled */);
        }
    }
}