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

Commit 766c19c2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I352afa7f,I89ef198b

* changes:
  Ensure that all places we bind tasks also update the doze state.
  Allow dumping activity from all visible stacks.
parents 5ba81e88 9377110f
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1552,11 +1552,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
        // Bind the task view to the new task
        bindTaskView(tv, task);

        // If the doze trigger has already fired, then update the state for this task view
        if (mUIDozeTrigger.isAsleep() || Recents.getSystemServices().hasFreeformWorkspaceSupport()) {
            tv.setNoUserInteractionState();
        }

        // Set the new state for this view, including the callbacks and view clipping
        tv.setCallbacks(this);
        tv.setTouchEnabled(true);
@@ -1586,6 +1581,12 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
        // Rebind the task and request that this task's data be filled into the TaskView
        tv.onTaskBound(task, mTouchExplorationEnabled, mDisplayOrientation, mDisplayRect);

        // If the doze trigger has already fired, then update the state for this task view
        if (mUIDozeTrigger.isAsleep() ||
                Recents.getSystemServices().hasFreeformWorkspaceSupport()) {
            tv.setNoUserInteractionState();
        }

        // Load the task data
        Recents.getTaskLoader().loadTaskData(task);
    }
+6 −3
Original line number Diff line number Diff line
@@ -13971,6 +13971,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        boolean dumpClient = false;
        boolean dumpCheckin = false;
        boolean dumpCheckinFormat = false;
        boolean dumpVisibleStacks = false;
        String dumpPackage = null;
        int opti = 0;
@@ -13984,6 +13985,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                dumpAll = true;
            } else if ("-c".equals(opt)) {
                dumpClient = true;
            } else if ("-v".equals(opt)) {
                dumpVisibleStacks = true;
            } else if ("-p".equals(opt)) {
                if (opti < args.length) {
                    dumpPackage = args[opti];
@@ -14170,7 +14173,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                LockGuard.dump(fd, pw, args);
            } else {
                // Dumping a single activity?
                if (!dumpActivity(fd, pw, cmd, args, opti, dumpAll)) {
                if (!dumpActivity(fd, pw, cmd, args, opti, dumpAll, dumpVisibleStacks)) {
                    ActivityManagerShellCommand shell = new ActivityManagerShellCommand(this, true);
                    int res = shell.exec(this, null, fd, null, args, new ResultReceiver(null));
                    if (res < 0) {
@@ -15038,11 +15041,11 @@ public final class ActivityManagerService extends ActivityManagerNative
     *  - A hex number of the ActivityRecord object instance.
     */
    protected boolean dumpActivity(FileDescriptor fd, PrintWriter pw, String name, String[] args,
            int opti, boolean dumpAll) {
            int opti, boolean dumpAll, boolean dumpVisibleStacks) {
        ArrayList<ActivityRecord> activities;
        synchronized (this) {
            activities = mStackSupervisor.getDumpActivitiesLocked(name);
            activities = mStackSupervisor.getDumpActivitiesLocked(name, dumpVisibleStacks);
        }
        if (activities.size() <= 0) {
+21 −2
Original line number Diff line number Diff line
@@ -3152,9 +3152,28 @@ public final class ActivityStackSupervisor implements DisplayListener {
                pw.println(" mLockTaskModeTasks" + mLockTaskModeTasks);
    }

    ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) {
    /**
     * Dumps the activities matching the given {@param name} in the either the focused stack
     * or all visible stacks if {@param dumpVisibleStacks} is true.
     */
    ArrayList<ActivityRecord> getDumpActivitiesLocked(String name, boolean dumpVisibleStacks) {
        if (dumpVisibleStacks) {
            ArrayList<ActivityRecord> activities = new ArrayList<>();
            int numDisplays = mActivityDisplays.size();
            for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
                ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
                for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
                    ActivityStack stack = stacks.get(stackNdx);
                    if (stack.getStackVisibilityLocked(null) == STACK_VISIBLE) {
                        activities.addAll(stack.getDumpActivitiesLocked(name));
                    }
                }
            }
            return activities;
        } else {
            return mFocusedStack.getDumpActivitiesLocked(name);
        }
    }

    static boolean printThisActivity(PrintWriter pw, ActivityRecord activity, String dumpPackage,
            boolean needSep, String prefix) {