Loading core/java/android/app/ActivityManagerInternal.java +12 −0 Original line number Diff line number Diff line Loading @@ -1270,4 +1270,16 @@ public abstract class ActivityManagerInternal { * @hide */ public abstract boolean shouldDelayHomeLaunch(int userId); /** * Add a startup timestamp to the most recent start of the specified process. * * @param key The {@link ApplicationStartInfo} start timestamp key of the timestamp to add. * @param timestampNs The clock monotonic timestamp to add in nanoseconds. * @param uid The UID of the process to add this timestamp to. * @param pid The process id of the process to add this timestamp to. * @param userId The userId in the multi-user environment. */ public abstract void addStartInfoTimestamp(int key, long timestampNs, int uid, int pid, int userId); } services/core/java/com/android/server/am/ActivityManagerService.java +14 −0 Original line number Diff line number Diff line Loading @@ -19953,6 +19953,20 @@ public class ActivityManagerService extends IActivityManager.Stub return !ActivityManagerService.this.mThemeOverlayReadyUsers.contains(userId); } } @Override public void addStartInfoTimestamp(int key, long timestampNs, int uid, int pid, int userId) { // For the simplification, we don't support USER_ALL nor USER_CURRENT here. if (userId == UserHandle.USER_ALL || userId == UserHandle.USER_CURRENT) { throw new IllegalArgumentException("Unsupported userId"); } mUserController.handleIncomingUser(pid, uid, userId, true, ALLOW_NON_FULL, "addStartInfoTimestampSystem", null); addStartInfoTimestampInternal(key, timestampNs, userId, uid); } } long inputDispatchingTimedOut(int pid, final boolean aboveSystem, TimeoutRecord timeoutRecord) { services/core/java/com/android/server/wm/ActivityMetricsLogger.java +11 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityOptions; import android.app.ActivityOptions.SourceInfo; import android.app.ApplicationStartInfo; import android.app.CameraCompatTaskInfo.CameraCompatControlState; import android.app.WaitResult; import android.app.WindowConfiguration.WindowingMode; Loading Loading @@ -845,6 +846,16 @@ class ActivityMetricsLogger { && !r.mTransitionController.isCollecting(r))) { done(false /* abort */, info, "notifyWindowsDrawn", timestampNs); } if (android.app.Flags.appStartInfoTimestamps()) { // Log here to match StatsD for time to first frame. mLoggerHandler.post( () -> mSupervisor.mService.mWindowManager.mAmInternal.addStartInfoTimestamp( ApplicationStartInfo.START_TIMESTAMP_FIRST_FRAME, timestampNs, r.getUid(), r.getPid(), info.mLastLaunchedActivity.mUserId)); } return infoSnapshot; } Loading Loading
core/java/android/app/ActivityManagerInternal.java +12 −0 Original line number Diff line number Diff line Loading @@ -1270,4 +1270,16 @@ public abstract class ActivityManagerInternal { * @hide */ public abstract boolean shouldDelayHomeLaunch(int userId); /** * Add a startup timestamp to the most recent start of the specified process. * * @param key The {@link ApplicationStartInfo} start timestamp key of the timestamp to add. * @param timestampNs The clock monotonic timestamp to add in nanoseconds. * @param uid The UID of the process to add this timestamp to. * @param pid The process id of the process to add this timestamp to. * @param userId The userId in the multi-user environment. */ public abstract void addStartInfoTimestamp(int key, long timestampNs, int uid, int pid, int userId); }
services/core/java/com/android/server/am/ActivityManagerService.java +14 −0 Original line number Diff line number Diff line Loading @@ -19953,6 +19953,20 @@ public class ActivityManagerService extends IActivityManager.Stub return !ActivityManagerService.this.mThemeOverlayReadyUsers.contains(userId); } } @Override public void addStartInfoTimestamp(int key, long timestampNs, int uid, int pid, int userId) { // For the simplification, we don't support USER_ALL nor USER_CURRENT here. if (userId == UserHandle.USER_ALL || userId == UserHandle.USER_CURRENT) { throw new IllegalArgumentException("Unsupported userId"); } mUserController.handleIncomingUser(pid, uid, userId, true, ALLOW_NON_FULL, "addStartInfoTimestampSystem", null); addStartInfoTimestampInternal(key, timestampNs, userId, uid); } } long inputDispatchingTimedOut(int pid, final boolean aboveSystem, TimeoutRecord timeoutRecord) {
services/core/java/com/android/server/wm/ActivityMetricsLogger.java +11 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityOptions; import android.app.ActivityOptions.SourceInfo; import android.app.ApplicationStartInfo; import android.app.CameraCompatTaskInfo.CameraCompatControlState; import android.app.WaitResult; import android.app.WindowConfiguration.WindowingMode; Loading Loading @@ -845,6 +846,16 @@ class ActivityMetricsLogger { && !r.mTransitionController.isCollecting(r))) { done(false /* abort */, info, "notifyWindowsDrawn", timestampNs); } if (android.app.Flags.appStartInfoTimestamps()) { // Log here to match StatsD for time to first frame. mLoggerHandler.post( () -> mSupervisor.mService.mWindowManager.mAmInternal.addStartInfoTimestamp( ApplicationStartInfo.START_TIMESTAMP_FIRST_FRAME, timestampNs, r.getUid(), r.getPid(), info.mLastLaunchedActivity.mUserId)); } return infoSnapshot; } Loading