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

Commit a236934b authored by Wenhui Yang's avatar Wenhui Yang Committed by Android (Google) Code Review
Browse files

Merge "Include VRI state when dumping activities in bugreport" into main

parents 4e2eb1b3 da34a3da
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -4381,7 +4381,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
     */
    protected boolean dumpActivity(FileDescriptor fd, PrintWriter pw, String name, String[] args,
            int opti, boolean dumpAll, boolean dumpVisibleRootTasksOnly,
            boolean dumpFocusedRootTaskOnly, int displayIdFilter, @UserIdInt int userId) {
            boolean dumpFocusedRootTaskOnly, int displayIdFilter, @UserIdInt int userId,
            long timeout) {
        ArrayList<ActivityRecord> activities;

        synchronized (mGlobalLock) {
@@ -4426,7 +4427,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                    }
                }
            }
            dumpActivity("  ", fd, pw, activities.get(i), newArgs, dumpAll);
            dumpActivity("  ", fd, pw, activities.get(i), newArgs, dumpAll, timeout);
        }
        if (!printedAnything) {
            // Typically happpens when no task matches displayIdFilter
@@ -4440,7 +4441,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
     * there is a thread associated with the activity.
     */
    private void dumpActivity(String prefix, FileDescriptor fd, PrintWriter pw,
            ActivityRecord r, String[] args, boolean dumpAll) {
            ActivityRecord r, String[] args, boolean dumpAll, long timeout) {
        String innerPrefix = prefix + "  ";
        IApplicationThread appThread = null;
        synchronized (mGlobalLock) {
@@ -4471,7 +4472,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
            pw.flush();
            try (TransferPipe tp = new TransferPipe()) {
                appThread.dumpActivity(tp.getWriteFd(), r.token, innerPrefix, args);
                tp.go(fd);
                tp.go(fd, timeout);
            } catch (IOException e) {
                pw.println(innerPrefix + "Failure while dumping the activity: " + e);
            } catch (RemoteException e) {
@@ -6970,7 +6971,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                boolean dumpFocusedRootTaskOnly, int displayIdFilter,
                @UserIdInt int userId) {
            return ActivityTaskManagerService.this.dumpActivity(fd, pw, name, args, opti, dumpAll,
                    dumpVisibleRootTasksOnly, dumpFocusedRootTaskOnly, displayIdFilter, userId);
                    dumpVisibleRootTasksOnly, dumpFocusedRootTaskOnly, displayIdFilter, userId,
                    /* timeout= */ 5000);
        }

        @Override
+15 −0
Original line number Diff line number Diff line
@@ -538,6 +538,21 @@ public class WindowManagerService extends IWindowManager.Stub
            doDump(fd, pw, new String[] {"-a"}, asProto);
        }

        @Override
        public void dumpHigh(FileDescriptor fd, PrintWriter pw, String[] args,
                boolean asProto) {
            if (asProto) {
                return;
            }
            mAtmService.dumpActivity(fd, pw, /* name= */ "all", /* args= */ new String[]{},
                    /* opti= */ 0,
                    /* dumpAll= */ true,
                    /* dumpVisibleRootTasksOnly= */ true,
                    /* dumpFocusedRootTaskOnly= */ false, INVALID_DISPLAY, UserHandle.USER_ALL,
                    /* timeout= */ 1000
            );
        }

        @Override
        public void dump(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) {
            doDump(fd, pw, args, asProto);
+2 −1
Original line number Diff line number Diff line
@@ -1618,7 +1618,8 @@ public final class SystemServer implements Dumpable {
            wm = WindowManagerService.main(context, inputManager, !mFirstBoot,
                    new PhoneWindowManager(), mActivityManagerService.mActivityTaskManager);
            ServiceManager.addService(Context.WINDOW_SERVICE, wm, /* allowIsolated= */ false,
                    DUMP_FLAG_PRIORITY_CRITICAL | DUMP_FLAG_PROTO);
                    DUMP_FLAG_PRIORITY_CRITICAL | DUMP_FLAG_PRIORITY_HIGH
                            | DUMP_FLAG_PROTO);
            ServiceManager.addService(Context.INPUT_SERVICE, inputManager,
                    /* allowIsolated= */ false, DUMP_FLAG_PRIORITY_CRITICAL);
            t.traceEnd();