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

Commit d7b88384 authored by Felipe Leme's avatar Felipe Leme
Browse files

Dump isPrimaryUser() / isSplitSystemUser() on 'user' service.

Also fixed / improved some javadocs...

Bug: 133242016
Test: manual verification

Change-Id: Ia9c50a2cd1de5ad8b0c9d5573b1760601fbcef76
parent 4ed083c2
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -978,11 +978,13 @@ class UserController implements Handler.Callback {
     * <ul>
     *     <li>{@link Intent#ACTION_USER_STARTED} - sent to registered receivers of the new user
     *     <li>{@link Intent#ACTION_USER_BACKGROUND} - sent to registered receivers of the outgoing
     *     user and all profiles of this user. Sent only if {@code foreground} parameter is true
     *     user and all profiles of this user. Sent only if {@code foreground} parameter is
     *     {@code false}
     *     <li>{@link Intent#ACTION_USER_FOREGROUND} - sent to registered receivers of the new
     *     user and all profiles of this user. Sent only if {@code foreground} parameter is true
     *     user and all profiles of this user. Sent only if {@code foreground} parameter is
     *     {@code true}
     *     <li>{@link Intent#ACTION_USER_SWITCHED} - sent to registered receivers of the new user.
     *     Sent only if {@code foreground} parameter is true
     *     Sent only if {@code foreground} parameter is {@code true}
     *     <li>{@link Intent#ACTION_USER_STARTING} - ordered broadcast sent to registered receivers
     *     of the new fg user
     *     <li>{@link Intent#ACTION_LOCKED_BOOT_COMPLETED} - ordered broadcast sent to receivers of
+15 −7
Original line number Diff line number Diff line
@@ -3693,6 +3693,11 @@ public class UserManagerService extends IUserManager.Stub {

        long now = System.currentTimeMillis();
        final long nowRealtime = SystemClock.elapsedRealtime();

        final int currentUser = LocalServices.getService(ActivityManagerInternal.class)
                .getCurrentUserId();
        pw.print("Current user: "); pw.println(currentUser);

        StringBuilder sb = new StringBuilder();
        synchronized (mPackagesLock) {
            synchronized (mUsersLock) {
@@ -3706,6 +3711,7 @@ public class UserManagerService extends IUserManager.Stub {
                    final int userId = userInfo.id;
                    pw.print("  "); pw.print(userInfo);
                    pw.print(" serialNo="); pw.print(userInfo.serialNumber);
                    pw.print(" isPrimary="); pw.print(userInfo.isPrimary());
                    if (mRemovingUserIds.get(userId)) {
                        pw.print(" <removing> ");
                    }
@@ -3788,13 +3794,15 @@ public class UserManagerService extends IUserManager.Stub {
            synchronized (mUserStates) {
                pw.println("  Started users state: " + mUserStates);
            }
        } // synchronized (mPackagesLock)

        // Dump some capabilities
        pw.println();
        pw.println("  Max users: " + UserManager.getMaxSupportedUsers());
        pw.println("  Supports switchable users: " + UserManager.supportsMultipleUsers());
        pw.println("  All guests ephemeral: " + Resources.getSystem().getBoolean(
                com.android.internal.R.bool.config_guestUserEphemeral));
        }
        pw.println("  Is split-system user: " + UserManager.isSplitSystemUser());
    }

    private static void dumpTimeAgo(PrintWriter pw, StringBuilder sb, long nowTime, long time) {