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

Commit 6893b19a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix NPE for UDFPS devices without HBM"

parents b2f81406 7bae0860
Loading
Loading
Loading
Loading
+17 −13
Original line number Diff line number Diff line
@@ -239,6 +239,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);
@@ -252,6 +253,7 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
                }
            });
        }
    }

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