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

Commit da34a3da authored by Wenhui Yang's avatar Wenhui Yang
Browse files

Include VRI state when dumping activities in bugreport

Bug: 294538012
Test: adb shell su root dumpsys window --dump-priority HIGH
Test: check bugreport - High window
Change-Id: Ia7f71bdc80a1ef069fcaadf5ef469a4883b82849
parent f19baf87
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -4362,7 +4362,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) {
@@ -4407,7 +4408,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
@@ -4421,7 +4422,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) {
@@ -4452,7 +4453,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) {
@@ -6931,7 +6932,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
@@ -527,6 +527,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
@@ -1662,7 +1662,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();