Loading proto/src/metrics_constants.proto +5 −0 Original line number Diff line number Diff line Loading @@ -3957,6 +3957,11 @@ message MetricsEvent { // OS: O RUNNING_BACKGROUND_APPS_DIALOG = 944; // FIELD - The delay from the start of the transition until we just call bindApplication on the // client. // OS: O APP_TRANSITION_BIND_APPLICATION_DELAY_MS = 945; // ---- End O Constants, all O constants go above this line ---- // Add new aosp constants above this line. Loading services/core/java/com/android/server/am/ActivityManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -6845,6 +6845,7 @@ public class ActivityManagerService extends IActivityManager.Stub } checkTime(startTime, "attachApplicationLocked: immediately before bindApplication"); mStackSupervisor.mActivityMetricsLogger.notifyBindApplication(app); if (app.instr != null) { thread.bindApplication(processName, appInfo, providers, app.instr.mClass, services/core/java/com/android/server/am/ActivityMetricsLogger.java +23 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.ActivityManagerInternal.APP_TRANSITION_TIMEOUT; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_BIND_APPLICATION_DELAY_MS; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_CALLING_PACKAGE_NAME; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DELAY_MS; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DEVICE_UPTIME_SECONDS; Loading Loading @@ -78,7 +79,8 @@ class ActivityMetricsLogger { private int startResult; private boolean currentTransitionProcessRunning; private int windowsDrawnDelayMs; private int startingWindowDelayMs; private int startingWindowDelayMs = -1; private int bindApplicationDelayMs = -1; private int reason = APP_TRANSITION_TIMEOUT; private boolean loggedWindowsDrawn; private boolean loggedStartingWindowDrawn; Loading Loading @@ -296,6 +298,22 @@ class ActivityMetricsLogger { } } /** * Notifies the tracker that we called immediately before we call bindApplication on the client. * * @param app The client into which we'll call bindApplication. */ void notifyBindApplication(ProcessRecord app) { for (int i = mStackTransitionInfo.size() - 1; i >= 0; i--) { final StackTransitionInfo info = mStackTransitionInfo.valueAt(i); // App isn't attached to record yet, so match with info. if (info.launchedActivity.appInfo == app.info) { info.bindApplicationDelayMs = calculateCurrentDelay(); } } } private boolean allStacksWindowsDrawn() { for (int index = mStackTransitionInfo.size() - 1; index >= 0; index--) { if (!mStackTransitionInfo.valueAt(index).loggedWindowsDrawn) { Loading Loading @@ -356,6 +374,10 @@ class ActivityMetricsLogger { builder.addTaggedData(APP_TRANSITION_STARTING_WINDOW_DELAY_MS, info.startingWindowDelayMs); } if (info.bindApplicationDelayMs != -1) { builder.addTaggedData(APP_TRANSITION_BIND_APPLICATION_DELAY_MS, info.bindApplicationDelayMs); } builder.addTaggedData(APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS, info.windowsDrawnDelayMs); mMetricsLogger.write(builder); } Loading Loading
proto/src/metrics_constants.proto +5 −0 Original line number Diff line number Diff line Loading @@ -3957,6 +3957,11 @@ message MetricsEvent { // OS: O RUNNING_BACKGROUND_APPS_DIALOG = 944; // FIELD - The delay from the start of the transition until we just call bindApplication on the // client. // OS: O APP_TRANSITION_BIND_APPLICATION_DELAY_MS = 945; // ---- End O Constants, all O constants go above this line ---- // Add new aosp constants above this line. Loading
services/core/java/com/android/server/am/ActivityManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -6845,6 +6845,7 @@ public class ActivityManagerService extends IActivityManager.Stub } checkTime(startTime, "attachApplicationLocked: immediately before bindApplication"); mStackSupervisor.mActivityMetricsLogger.notifyBindApplication(app); if (app.instr != null) { thread.bindApplication(processName, appInfo, providers, app.instr.mClass,
services/core/java/com/android/server/am/ActivityMetricsLogger.java +23 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.ActivityManagerInternal.APP_TRANSITION_TIMEOUT; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_BIND_APPLICATION_DELAY_MS; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_CALLING_PACKAGE_NAME; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DELAY_MS; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.APP_TRANSITION_DEVICE_UPTIME_SECONDS; Loading Loading @@ -78,7 +79,8 @@ class ActivityMetricsLogger { private int startResult; private boolean currentTransitionProcessRunning; private int windowsDrawnDelayMs; private int startingWindowDelayMs; private int startingWindowDelayMs = -1; private int bindApplicationDelayMs = -1; private int reason = APP_TRANSITION_TIMEOUT; private boolean loggedWindowsDrawn; private boolean loggedStartingWindowDrawn; Loading Loading @@ -296,6 +298,22 @@ class ActivityMetricsLogger { } } /** * Notifies the tracker that we called immediately before we call bindApplication on the client. * * @param app The client into which we'll call bindApplication. */ void notifyBindApplication(ProcessRecord app) { for (int i = mStackTransitionInfo.size() - 1; i >= 0; i--) { final StackTransitionInfo info = mStackTransitionInfo.valueAt(i); // App isn't attached to record yet, so match with info. if (info.launchedActivity.appInfo == app.info) { info.bindApplicationDelayMs = calculateCurrentDelay(); } } } private boolean allStacksWindowsDrawn() { for (int index = mStackTransitionInfo.size() - 1; index >= 0; index--) { if (!mStackTransitionInfo.valueAt(index).loggedWindowsDrawn) { Loading Loading @@ -356,6 +374,10 @@ class ActivityMetricsLogger { builder.addTaggedData(APP_TRANSITION_STARTING_WINDOW_DELAY_MS, info.startingWindowDelayMs); } if (info.bindApplicationDelayMs != -1) { builder.addTaggedData(APP_TRANSITION_BIND_APPLICATION_DELAY_MS, info.bindApplicationDelayMs); } builder.addTaggedData(APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS, info.windowsDrawnDelayMs); mMetricsLogger.write(builder); } Loading