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

Commit 57f119b6 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Surface IBiometricsFace#userActivity to FaceManager

Fixes: 117631611

Test: Builds
Change-Id: Ia2631be24a6920cb0f014d6f9e38c6337db4219b
parent da3b55a1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -310,6 +310,21 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
        return result;
    }

    /**
     * Pokes the the driver to have it start looking for faces again.
     * @hide
     */
    @RequiresPermission(MANAGE_BIOMETRIC)
    public void userActivity() {
        if (mService != null) {
            try {
                mService.userActivity();
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }
    }

    /**
     * Sets the active user. This is meant to be used to select the current profile for enrollment
     * to allow separate enrolled faces for a work profile
+2 −0
Original line number Diff line number Diff line
@@ -98,4 +98,6 @@ interface IFaceService {
    int setRequireAttention(boolean requireAttention, in byte [] token);

    boolean getRequireAttention(in byte [] token);

    void userActivity();
}
+15 −2
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ public class FaceService extends BiometricServiceBase {
                result = mDaemon != null ? mDaemon.setRequireAttention(requireAttention, byteToken)
                        : Status.INTERNAL_ERROR;
            } catch (RemoteException e) {
                Slog.e(getTag(), "Unable to setRequireAttention to " + requireAttention);
                Slog.e(getTag(), "Unable to setRequireAttention to " + requireAttention, e);
                result = Status.INTERNAL_ERROR;
            }

@@ -382,10 +382,23 @@ public class FaceService extends BiometricServiceBase {
            try {
                result = mDaemon != null ? mDaemon.getRequireAttention(byteToken).value : true;
            } catch (RemoteException e) {
                Slog.e(getTag(), "Unable to getRequireAttention");
                Slog.e(getTag(), "Unable to getRequireAttention", e);
            }
            return result;
        }

        @Override
        public void userActivity() {
            checkPermission(MANAGE_BIOMETRIC);

            if (mDaemon != null) {
                try {
                    mDaemon.userActivity();
                } catch (RemoteException e) {
                    Slog.e(getTag(), "Unable to send userActivity", e);
                }
            }
        }
    }

    /**