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

Commit bda14dd9 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Cache IMountService for isUserKeyUnlocked() calls." into nyc-dev

am: 36cbf5ca

* commit '36cbf5ca':
  Cache IMountService for isUserKeyUnlocked() calls.

Change-Id: I1ad2d1eba64a89e7a22dc86c7241f6f85a5f2a0b
parents 628c714f 36cbf5ca
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ public class StorageManager {
    /** {@hide} */
    public static final int FLAG_INCLUDE_INVISIBLE = 1 << 10;

    private static volatile IMountService sMountService = null;

    private final Context mContext;
    private final ContentResolver mResolver;

@@ -1064,15 +1066,17 @@ public class StorageManager {

    /** {@hide} */
    public static boolean isUserKeyUnlocked(int userId) {
        final IMountService mount = IMountService.Stub
        if (sMountService == null) {
            sMountService = IMountService.Stub
                    .asInterface(ServiceManager.getService("mount"));
        if (mount == null) {
        }
        if (sMountService == null) {
            Slog.w(TAG, "Early during boot, assuming locked");
            return false;
        }
        final long token = Binder.clearCallingIdentity();
        try {
            return mount.isUserKeyUnlocked(userId);
            return sMountService.isUserKeyUnlocked(userId);
        } catch (RemoteException e) {
            throw e.rethrowAsRuntimeException();
        } finally {