Merge "Add removal time of starting window in transition trace proto" into udc-qpr-dev am: 2b30017c31
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24342219 Change-Id: I697e1a755afe3ba42b4d8c87bef9a872f4f43b41 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -56,6 +56,7 @@ message Transition {
|
||||
repeated Target targets = 8;
|
||||
optional int32 flags = 9;
|
||||
optional int64 abort_time_ns = 10;
|
||||
optional int64 starting_window_remove_time_ns = 11;
|
||||
}
|
||||
|
||||
message Target {
|
||||
|
||||
@@ -2784,6 +2784,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
} else if (isEmbedded()) {
|
||||
associateStartingWindowWithTaskIfNeeded();
|
||||
}
|
||||
if (mTransitionController.isCollecting()) {
|
||||
mStartingData.mTransitionId = mTransitionController.getCollectingTransitionId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ public abstract class StartingData {
|
||||
/** Whether to prepare the removal animation. */
|
||||
boolean mPrepareRemoveAnimation;
|
||||
|
||||
/** Non-zero if this starting window is added in a collecting transition. */
|
||||
int mTransitionId;
|
||||
|
||||
protected StartingData(WindowManagerService service, int typeParams) {
|
||||
mService = service;
|
||||
mTypeParams = typeParams;
|
||||
|
||||
@@ -145,6 +145,27 @@ public class TransitionTracer {
|
||||
}
|
||||
}
|
||||
|
||||
void logRemovingStartingWindow(@NonNull StartingData startingData) {
|
||||
if (startingData.mTransitionId == 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
final ProtoOutputStream outputStream = new ProtoOutputStream(CHUNK_SIZE);
|
||||
final long protoToken = outputStream
|
||||
.start(com.android.server.wm.shell.TransitionTraceProto.TRANSITIONS);
|
||||
outputStream.write(com.android.server.wm.shell.Transition.ID,
|
||||
startingData.mTransitionId);
|
||||
outputStream.write(
|
||||
com.android.server.wm.shell.Transition.STARTING_WINDOW_REMOVE_TIME_NS,
|
||||
SystemClock.elapsedRealtimeNanos());
|
||||
outputStream.end(protoToken);
|
||||
|
||||
mTraceBuffer.add(outputStream);
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_TAG, "Unexpected exception thrown while logging transitions", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void dumpTransitionTargetsToProto(ProtoOutputStream outputStream,
|
||||
Transition transition, ArrayList<ChangeInfo> targets) {
|
||||
Trace.beginSection("TransitionTracer#dumpTransitionTargetsToProto");
|
||||
|
||||
@@ -2412,7 +2412,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
ProtoLog.v(WM_DEBUG_ADD_REMOVE,
|
||||
"removeIfPossible: %s callers=%s", this, Debug.getCallers(5));
|
||||
|
||||
final boolean startingWindow = mAttrs.type == TYPE_APPLICATION_STARTING;
|
||||
final boolean startingWindow = mStartingData != null;
|
||||
if (startingWindow) {
|
||||
ProtoLog.d(WM_DEBUG_STARTING_WINDOW, "Starting window removed %s", this);
|
||||
// Cancel the remove starting window animation on shell. The main window might changed
|
||||
@@ -2426,6 +2426,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
return false;
|
||||
}, true);
|
||||
}
|
||||
mTransitionController.mTransitionTracer.logRemovingStartingWindow(mStartingData);
|
||||
} else if (mAttrs.type == TYPE_BASE_APPLICATION
|
||||
&& isSelfAnimating(0, ANIMATION_TYPE_STARTING_REVEAL)) {
|
||||
// Cancel the remove starting window animation in case the binder dead before remove
|
||||
|
||||
Reference in New Issue
Block a user