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

Commit 09736053 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Point "unlocked" logic at lower level."

parents 20e082c7 5b0e5207
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.storage.StorageManager;
import android.provider.Settings;
import android.util.Log;
import android.view.WindowManager.LayoutParams;
@@ -857,12 +858,10 @@ public class UserManager {

    /** {@hide} */
    public boolean isUserUnlocked(int userId) {
        try {
            return ActivityManagerNative.getDefault().isUserRunning(userId,
                    ActivityManager.FLAG_AND_UNLOCKED);
        } catch (RemoteException e) {
            return false;
        }
        // TODO: eventually pivot this back to look at ActivityManager state,
        // but there is race where we can start a non-encryption-aware launcher
        // before that lifecycle has entered the running unlocked state.
        return mContext.getSystemService(StorageManager.class).isUserKeyUnlocked(userId);
    }

    /**
+7 −1
Original line number Diff line number Diff line
@@ -3592,11 +3592,17 @@ class MountService extends IMountService.Stub
        }

        pw.println();
        pw.println("mConnection:");
        pw.println("mConnector:");
        pw.increaseIndent();
        mConnector.dump(fd, pw, args);
        pw.decreaseIndent();

        pw.println();
        pw.println("mCryptConnector:");
        pw.increaseIndent();
        mCryptConnector.dump(fd, pw, args);
        pw.decreaseIndent();

        pw.println();
        pw.print("Last maintenance: ");
        pw.println(TimeUtils.formatForLogging(mLastMaintenance));