Loading services/core/java/com/android/server/am/ActivityManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1085,12 +1085,15 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override public void onActivityLaunched(long id, ComponentName name, int temperature, int userId) { public void onActivityLaunched(long id, ComponentName name, int temperature, int userId, String processName) { mAppProfiler.onActivityLaunched(); synchronized (ActivityManagerService.this) { ProcessRecord record = null; try { record = getProcessRecordLocked(name.getPackageName(), mContext String processRecordName = Flags.appStartInfoProcessNameFix() ? processName : name.getPackageName(); record = getProcessRecordLocked(processRecordName, mContext .getPackageManager().getPackageUidAsUser(name.getPackageName(), 0, userId)); } catch (NameNotFoundException nnfe) { Loading services/core/java/com/android/server/am/flags.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -272,3 +272,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "app_start_info_process_name_fix" namespace: "system_performance" description: "Use process name to lookup ProcessRecord." bug: "443136429" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file services/core/java/com/android/server/wm/ActivityMetricsLaunchObserver.java +2 −1 Original line number Diff line number Diff line Loading @@ -144,9 +144,10 @@ public class ActivityMetricsLaunchObserver { * @param name The launching activity name. * @param temperature The temperature at which a launch sequence had started. * @param userId The id of the user the activity is being launched for. * @param processName The name of the process that the launching activity belongs to. */ public void onActivityLaunched(long id, ComponentName name, @Temperature int temperature, int userId) { int userId, String processName) { } /** Loading services/core/java/com/android/server/wm/ActivityMetricsLogger.java +1 −1 Original line number Diff line number Diff line Loading @@ -1814,7 +1814,7 @@ class ActivityMetricsLogger { // Beginning a launch is timing sensitive and so should be observed as soon as possible. mLaunchObserver.onActivityLaunched(info.mLaunchingState.mStartUptimeNs, info.mLastLaunchedActivity.mActivityComponent, temperature, info.mLastLaunchedActivity.mUserId); info.mLastLaunchedActivity.mUserId, info.mLastLaunchedActivity.processName); Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } Loading services/core/java/com/android/server/wm/LaunchObserverRegistryImpl.java +5 −4 Original line number Diff line number Diff line Loading @@ -84,10 +84,11 @@ class LaunchObserverRegistryImpl extends ActivityMetricsLaunchObserver implement } @Override public void onActivityLaunched(long id, ComponentName name, int temperature, int userId) { public void onActivityLaunched(long id, ComponentName name, int temperature, int userId, String processName) { mHandler.sendMessage(PooledLambda.obtainMessage( LaunchObserverRegistryImpl::handleOnActivityLaunched, this, id, name, temperature, userId)); this, id, name, temperature, userId, processName)); } @Override Loading Loading @@ -138,10 +139,10 @@ class LaunchObserverRegistryImpl extends ActivityMetricsLaunchObserver implement } private void handleOnActivityLaunched(long id, ComponentName name, @Temperature int temperature, int userId) { @Temperature int temperature, int userId, String processName) { // Traverse start-to-end to meet the registerLaunchObserver multi-cast order guarantee. for (int i = 0; i < mList.size(); i++) { mList.get(i).onActivityLaunched(id, name, temperature, userId); mList.get(i).onActivityLaunched(id, name, temperature, userId, processName); } } Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1085,12 +1085,15 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override public void onActivityLaunched(long id, ComponentName name, int temperature, int userId) { public void onActivityLaunched(long id, ComponentName name, int temperature, int userId, String processName) { mAppProfiler.onActivityLaunched(); synchronized (ActivityManagerService.this) { ProcessRecord record = null; try { record = getProcessRecordLocked(name.getPackageName(), mContext String processRecordName = Flags.appStartInfoProcessNameFix() ? processName : name.getPackageName(); record = getProcessRecordLocked(processRecordName, mContext .getPackageManager().getPackageUidAsUser(name.getPackageName(), 0, userId)); } catch (NameNotFoundException nnfe) { Loading
services/core/java/com/android/server/am/flags.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -272,3 +272,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "app_start_info_process_name_fix" namespace: "system_performance" description: "Use process name to lookup ProcessRecord." bug: "443136429" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file
services/core/java/com/android/server/wm/ActivityMetricsLaunchObserver.java +2 −1 Original line number Diff line number Diff line Loading @@ -144,9 +144,10 @@ public class ActivityMetricsLaunchObserver { * @param name The launching activity name. * @param temperature The temperature at which a launch sequence had started. * @param userId The id of the user the activity is being launched for. * @param processName The name of the process that the launching activity belongs to. */ public void onActivityLaunched(long id, ComponentName name, @Temperature int temperature, int userId) { int userId, String processName) { } /** Loading
services/core/java/com/android/server/wm/ActivityMetricsLogger.java +1 −1 Original line number Diff line number Diff line Loading @@ -1814,7 +1814,7 @@ class ActivityMetricsLogger { // Beginning a launch is timing sensitive and so should be observed as soon as possible. mLaunchObserver.onActivityLaunched(info.mLaunchingState.mStartUptimeNs, info.mLastLaunchedActivity.mActivityComponent, temperature, info.mLastLaunchedActivity.mUserId); info.mLastLaunchedActivity.mUserId, info.mLastLaunchedActivity.processName); Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } Loading
services/core/java/com/android/server/wm/LaunchObserverRegistryImpl.java +5 −4 Original line number Diff line number Diff line Loading @@ -84,10 +84,11 @@ class LaunchObserverRegistryImpl extends ActivityMetricsLaunchObserver implement } @Override public void onActivityLaunched(long id, ComponentName name, int temperature, int userId) { public void onActivityLaunched(long id, ComponentName name, int temperature, int userId, String processName) { mHandler.sendMessage(PooledLambda.obtainMessage( LaunchObserverRegistryImpl::handleOnActivityLaunched, this, id, name, temperature, userId)); this, id, name, temperature, userId, processName)); } @Override Loading Loading @@ -138,10 +139,10 @@ class LaunchObserverRegistryImpl extends ActivityMetricsLaunchObserver implement } private void handleOnActivityLaunched(long id, ComponentName name, @Temperature int temperature, int userId) { @Temperature int temperature, int userId, String processName) { // Traverse start-to-end to meet the registerLaunchObserver multi-cast order guarantee. for (int i = 0; i < mList.size(); i++) { mList.get(i).onActivityLaunched(id, name, temperature, userId); mList.get(i).onActivityLaunched(id, name, temperature, userId, processName); } } Loading