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

Commit 77f0d5fa authored by Diya Bera's avatar Diya Bera
Browse files

Disable ALS probe if device is not awake

Flag: N/A
Test: atest FingerprintAuthenticationClientTest
Fixes: 339493634
Change-Id: I504d923eabafdc255cf05068475734c566d73702
parent af52873b
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -316,6 +316,8 @@ public class FingerprintAuthenticationClient


                if (getBiometricContext().isAwake()) {
                if (getBiometricContext().isAwake()) {
                    mALSProbeCallback.getProbe().enable();
                    mALSProbeCallback.getProbe().enable();
                } else {
                    mALSProbeCallback.getProbe().disable();
                }
                }
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Slog.e(TAG, "Remote exception", e);
                Slog.e(TAG, "Remote exception", e);
+2 −1
Original line number Original line Diff line number Diff line
@@ -320,7 +320,7 @@ public class FingerprintAuthenticationClientTest {
    }
    }


    @Test
    @Test
    public void luxProbeNotEnabledOnStartWhenNotWake() throws RemoteException {
    public void luxProbeDisabledOnStartWhenNotWake() throws RemoteException {
        luxProbeEnabledOnStart(false /* isAwake */);
        luxProbeEnabledOnStart(false /* isAwake */);
    }
    }


@@ -337,6 +337,7 @@ public class FingerprintAuthenticationClientTest {
                .getValue().toAidlContext());
                .getValue().toAidlContext());


        verify(mLuxProbe, isAwake ? times(1) : never()).enable();
        verify(mLuxProbe, isAwake ? times(1) : never()).enable();
        verify(mLuxProbe, isAwake ? never() : times(1)).disable();
    }
    }


    @Test
    @Test