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

Commit c59849a4 authored by Andy Mast's avatar Andy Mast
Browse files

Fingerprint: Get current user id via Process.myUserHandle()

This eliminates the need for apps to have the
INTERACT_ACROSS_USERS and MANAGE_USERS permissions

Change-Id: I530eecf434046e2233664fb988665e6083707f6a
parent 371a450d
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.hardware.fingerprint.Fingerprint;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
@@ -243,12 +244,7 @@ public class FingerprintManager {
    }

    private int getCurrentUserId() {
        try {
            return ActivityManagerNative.getDefault().getCurrentUser().id;
        } catch (RemoteException e) {
            Log.w(TAG, "Failed to get current user id\n");
            return UserHandle.USER_NULL;
        }
        return Process.myUserHandle().getIdentifier();
    }

    /**