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

Commit 90d7497a authored by Winson Chung's avatar Winson Chung
Browse files

Tweak some logging to make things more readable



- Skip printing the Transition Change's WindowContainerToken on the
  non-server side since it doesn't show any useful info
- Skip printing "ComponentInfo{pkg/class}" and just print
  "pkg/class" directly instead in the grouped task info
- Adding some split logs for when we skip updating the split pair
  mapping, and also when we get the split bounds for the recents
  transition

Bug: 378565144
Flag: EXEMPT logging updates
Test: Check logcat
Change-Id: I8138830f7211c5130b000bcaf31f12ad84deffc7
Signed-off-by: default avatarWinson Chung <winsonc@google.com>
parent 859bdacb
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.content.ComponentName;
import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.HardwareBuffer;
import android.os.BinderProxy;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
@@ -1089,7 +1090,12 @@ public final class TransitionInfo implements Parcelable {
        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder();
            sb.append('{'); sb.append(mContainer);
            sb.append('{');
            if (mContainer != null && !(mContainer.asBinder() instanceof BinderProxy)) {
                // Only log the token if it is not a binder proxy and has additional container info
                sb.append(mContainer);
                sb.append(" ");
            }
            sb.append("m="); sb.append(modeToString(mMode));
            sb.append(" f="); sb.append(flagsToString(mFlags));
            if (mParent != null) {
+4 −3
Original line number Diff line number Diff line
@@ -249,8 +249,9 @@ public class GroupedTaskInfo implements Parcelable {
            return null;
        }
        return "id=" + taskInfo.taskId
                + " baseIntent=" + (taskInfo.baseIntent != null
                        ? taskInfo.baseIntent.getComponent()
                + " baseIntent=" +
                        (taskInfo.baseIntent != null && taskInfo.baseIntent.getComponent() != null
                                ? taskInfo.baseIntent.getComponent().flattenToString()
                                : "null")
                + " winMode=" + WindowConfiguration.windowingModeToString(
                        taskInfo.getWindowingMode());
+13 −3
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ public class RecentTasksController implements TaskStackListenerCallback,
        mTaskSplitBoundsMap.put(taskId1, splitBounds);
        mTaskSplitBoundsMap.put(taskId2, splitBounds);
        notifyRecentTasksChanged();
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENT_TASKS, "Add split pair: %d, %d, %s",
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, "Add split pair: %d, %d, %s",
                taskId1, taskId2, splitBounds);
        return true;
    }
@@ -221,7 +221,7 @@ public class RecentTasksController implements TaskStackListenerCallback,
            mTaskSplitBoundsMap.remove(taskId);
            mTaskSplitBoundsMap.remove(pairedTaskId);
            notifyRecentTasksChanged();
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENT_TASKS, "Remove split pair: %d, %d",
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, "Remove split pair: %d, %d",
                    taskId, pairedTaskId);
        }
    }
@@ -234,7 +234,17 @@ public class RecentTasksController implements TaskStackListenerCallback,

        // We could do extra verification of requiring both taskIds of a pair and verifying that
        // the same split bounds object is returned... but meh. Seems unnecessary.
        return mTaskSplitBoundsMap.get(taskId);
        SplitBounds splitBounds = mTaskSplitBoundsMap.get(taskId);
        if (splitBounds != null) {
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                    "getSplitBoundsForTaskId: taskId=%d splitBoundsTasks=[%d, %d]", taskId,
                    splitBounds.leftTopTaskId, splitBounds.rightBottomTaskId);
        } else {
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                    "getSplitBoundsForTaskId: expected split bounds for taskId=%d but not found",
                    taskId);
        }
        return splitBounds;
    }

    @Override
+7 −1
Original line number Diff line number Diff line
@@ -1357,7 +1357,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
    }

    void clearSplitPairedInRecents(@ExitReason int exitReason) {
        if (!shouldBreakPairedTaskInRecents(exitReason) || !mShouldUpdateRecents) return;
        if (!shouldBreakPairedTaskInRecents(exitReason) || !mShouldUpdateRecents) {
            ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "clearSplitPairedInRecents: skipping reason=%s",
                    !mShouldUpdateRecents ? "shouldn't update" : exitReasonToString(exitReason));
            return;
        }

        ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "clearSplitPairedInRecents: reason=%s",
                exitReasonToString(exitReason));
@@ -1610,6 +1614,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
    private void updateRecentTasksSplitPair() {
        // Preventing from single task update while processing recents.
        if (!mShouldUpdateRecents || !mPausingTasks.isEmpty()) {
            ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "updateRecentTasksSplitPair: skipping reason=%s",
                    !mShouldUpdateRecents ? "shouldn't update" : "no pausing tasks");
            return;
        }
        mRecentTasks.ifPresent(recentTasks -> {
+2 −2

File changed.

Contains only whitespace changes.