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

Commit 944aefd0 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Add debug log for TFOController deferTransitionReady" into main

parents 5a3ed74f 398e4c3e
Loading
Loading
Loading
Loading
+24 −4
Original line number Diff line number Diff line
@@ -198,6 +198,9 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
        @Override
        public void binderDied() {
            synchronized (mGlobalLock) {
                // TODO(b/419688177): remove the debug log
                ProtoLog.d(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS_MIN,
                        "TaskFragmentOrganizer=%s died", mOrganizer);
                removeOrganizer(mOrganizer, "client died");
            }
        }
@@ -293,7 +296,15 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
                }
            }

            for (int i = mDeferredTransitions.size() - 1; i >= 0; i--) {
            // TODO(b/419688177): reduce the debug log to WM_DEBUG_WINDOW_TRANSITIONS
            final int size = mDeferredTransitions.size();
            if (size > 0) {
                ProtoLog.d(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS_MIN,
                        "TaskFragmentOrganizer process died before handling all deferred"
                                + " transitions. Continue the rest as cleanup. # of defer=%d",
                        size);
            }
            for (int i = size - 1; i >= 0; i--) {
                // Cleanup any running transaction to unblock the current transition.
                onTransactionFinished(mDeferredTransitions.keyAt(i));
            }
@@ -489,7 +500,8 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
            }
            final int transitionId = mWindowOrganizerController.getTransitionController()
                    .getCollectingTransitionId();
            ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS,
            // TODO(b/419688177): reduce the debug log to WM_DEBUG_WINDOW_TRANSITIONS
            ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS_MIN,
                    "Defer transition id=%d for TaskFragmentTransaction=%s", transitionId,
                    transaction.getTransactionToken());
            mDeferredTransitions.put(transaction.getTransactionToken(), transitionId);
@@ -503,6 +515,8 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
        /** Called when the transaction is finished. */
        void onTransactionFinished(@NonNull IBinder transactionToken) {
            if (!mDeferredTransitions.containsKey(transactionToken)) {
                // This can happen if there was no collecting transition when the transaction was
                // dispatched, which is expected.
                return;
            }
            final int transitionId = mDeferredTransitions.remove(transactionToken);
@@ -510,13 +524,14 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
                    || mWindowOrganizerController.getTransitionController()
                    .getCollectingTransitionId() != transitionId) {
                // This can happen when the transition is timeout or abort.
                ProtoLog.w(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS,
                ProtoLog.w(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS_MIN,
                        "Deferred transition id=%d has been continued before the"
                                + " TaskFragmentTransaction=%s is finished",
                        transitionId, transactionToken);
                return;
            }
            ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS,
            // TODO(b/419688177): reduce the debug log to WM_DEBUG_WINDOW_TRANSITIONS
            ProtoLog.v(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS_MIN,
                    "Continue transition id=%d for TaskFragmentTransaction=%s", transitionId,
                    transactionToken);
            mWindowOrganizerController.getTransitionController().continueTransitionReady();
@@ -719,6 +734,11 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
                if (condition != null) {
                    condition.meet();
                }
            } else {
                // TODO(b/419688177): remove the debug log
                ProtoLog.w(WmProtoLogGroups.WM_DEBUG_WINDOW_TRANSITIONS_MIN,
                        "onTransactionHandled: called from unregistered organizer"
                                + " transactionToken=%s organizer=%s", transactionToken, organizer);
            }
        }
    }