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

Commit 878ed305 authored by Adam Bookatz's avatar Adam Bookatz Committed by Android (Google) Code Review
Browse files

Merge "Multiuser perfetto metric: adb tracepoints"

parents 2a5851b2 12d2a30a
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ import android.os.ShellCommand;
import android.os.StrictMode;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.TextUtils;
@@ -1889,6 +1890,8 @@ final class ActivityManagerShellCommand extends ShellCommand {

        int userId = Integer.parseInt(getNextArgRequired());
        boolean switched;
        Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "shell_runSwitchUser");
        try {
            if (wait) {
                switched = switchUserAndWaitForComplete(userId);
            } else {
@@ -1900,6 +1903,9 @@ final class ActivityManagerShellCommand extends ShellCommand {
                pw.printf("Error: Failed to switch to user %d\n", userId);
                return 1;
            }
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
        }
    }

    int runGetCurrentUser(PrintWriter pw) throws RemoteException {
+1 −1
Original line number Diff line number Diff line
@@ -1406,7 +1406,7 @@ class UserController implements Handler.Callback {
            @Nullable IProgressListener unlockListener) {
        TimingsTraceAndSlog t = new TimingsTraceAndSlog();

        t.traceBegin("startUser-" + userId + "-" + (foreground ? "fg" : "bg"));
        t.traceBegin("UserController.startUser-" + userId + "-" + (foreground ? "fg" : "bg"));
        try {
            return startUserInternal(userId, foreground, unlockListener, t);
        } finally {
+4 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ import android.os.ServiceSpecificException;
import android.os.ShellCommand;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.incremental.V4Signature;
@@ -2629,6 +2630,7 @@ class PackageManagerShellCommand extends ShellCommand {
        if (userType == null) {
            userType = UserInfo.getDefaultUserType(flags);
        }
        Trace.traceBegin(Trace.TRACE_TAG_PACKAGE_MANAGER, "shell_runCreateUser");
        try {
            if (UserManager.isUserTypeRestricted(userType)) {
                // In non-split user mode, userId can only be SYSTEM
@@ -2645,6 +2647,8 @@ class PackageManagerShellCommand extends ShellCommand {
            }
        } catch (ServiceSpecificException e) {
            getErrPrintWriter().println("Error: " + e);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_PACKAGE_MANAGER);
        }

        if (info != null) {