Loading services/core/java/com/android/server/am/ActivityManagerService.java +15 −24 Original line number Diff line number Diff line Loading @@ -2535,11 +2535,8 @@ public class ActivityManagerService extends IActivityManager.Stub Slog.d(TAG_SWITCH, "updateActivityUsageStats: comp=" + activity + " hash=" + appToken.hashCode() + " event=" + event); } synchronized (this) { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(activity, userId, event, appToken.hashCode(), taskRoot); } mUsageStatsService.reportEvent(activity, userId, event, appToken.hashCode(), taskRoot); } if (mContentCaptureService != null && (event == Event.ACTIVITY_PAUSED || event == Event.ACTIVITY_RESUMED || event == Event.ACTIVITY_STOPPED Loading @@ -2559,12 +2556,10 @@ public class ActivityManagerService extends IActivityManager.Stub Slog.d(TAG_SWITCH, "updateActivityUsageStats: package=" + packageName + " event=" + event); } synchronized (this) { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(packageName, userId, event); } } } /** * Update Usages on this foreground service's usage. Loading @@ -2577,14 +2572,12 @@ public class ActivityManagerService extends IActivityManager.Stub Slog.d(TAG_SWITCH, "updateForegroundServiceUsageStats: comp=" + service + " started=" + started); } synchronized (this) { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(service, userId, started ? UsageEvents.Event.FOREGROUND_SERVICE_START : UsageEvents.Event.FOREGROUND_SERVICE_STOP, 0, null); } } } CompatibilityInfo compatibilityInfoForPackage(ApplicationInfo ai) { return mAtmInternal.compatibilityInfoForPackage(ai); Loading Loading @@ -6100,7 +6093,7 @@ public class ActivityManagerService extends IActivityManager.Stub return pfd; } void reportGlobalUsageEventLocked(int event) { void reportGlobalUsageEvent(int event) { final int currentUserId = mUserController.getCurrentUserId(); mUsageStatsService.reportEvent(Event.DEVICE_EVENT_PACKAGE_NAME, currentUserId, event); int[] profiles = mUserController.getCurrentProfileIds(); Loading @@ -6114,8 +6107,8 @@ public class ActivityManagerService extends IActivityManager.Stub } } void reportCurWakefulnessUsageEventLocked() { reportGlobalUsageEventLocked(mWakefulness == PowerManagerInternal.WAKEFULNESS_AWAKE void reportCurWakefulnessUsageEvent() { reportGlobalUsageEvent(mWakefulness == PowerManagerInternal.WAKEFULNESS_AWAKE ? UsageEvents.Event.SCREEN_INTERACTIVE : UsageEvents.Event.SCREEN_NON_INTERACTIVE); } Loading @@ -6129,7 +6122,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (wasAwake != isAwake) { // Also update state in a special way for running foreground services UI. mServices.updateScreenStateLocked(isAwake); reportCurWakefulnessUsageEventLocked(); reportCurWakefulnessUsageEvent(); mActivityTaskManager.onScreenAwakeChanged(isAwake); mOomAdjProfiler.onWakefulnessChanged(wakefulness); } Loading Loading @@ -16529,12 +16522,10 @@ public class ActivityManagerService extends IActivityManager.Stub } public void reportCurKeyguardUsageEvent(boolean keyguardShowing) { synchronized(ActivityManagerService.this) { ActivityManagerService.this.reportGlobalUsageEventLocked(keyguardShowing ActivityManagerService.this.reportGlobalUsageEvent(keyguardShowing ? UsageEvents.Event.KEYGUARD_SHOWN : UsageEvents.Event.KEYGUARD_HIDDEN); } } @Override public void monitor() { services/core/java/com/android/server/am/UserController.java +2 −6 Original line number Diff line number Diff line Loading @@ -3046,15 +3046,11 @@ class UserController implements Handler.Callback { } void reportGlobalUsageEventLocked(int event) { synchronized (mService) { mService.reportGlobalUsageEventLocked(event); } mService.reportGlobalUsageEvent(event); } void reportCurWakefulnessUsageEvent() { synchronized (mService) { mService.reportCurWakefulnessUsageEventLocked(); } mService.reportCurWakefulnessUsageEvent(); } void taskSupervisorRemoveUser(@UserIdInt int userId) { Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +15 −24 Original line number Diff line number Diff line Loading @@ -2535,11 +2535,8 @@ public class ActivityManagerService extends IActivityManager.Stub Slog.d(TAG_SWITCH, "updateActivityUsageStats: comp=" + activity + " hash=" + appToken.hashCode() + " event=" + event); } synchronized (this) { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(activity, userId, event, appToken.hashCode(), taskRoot); } mUsageStatsService.reportEvent(activity, userId, event, appToken.hashCode(), taskRoot); } if (mContentCaptureService != null && (event == Event.ACTIVITY_PAUSED || event == Event.ACTIVITY_RESUMED || event == Event.ACTIVITY_STOPPED Loading @@ -2559,12 +2556,10 @@ public class ActivityManagerService extends IActivityManager.Stub Slog.d(TAG_SWITCH, "updateActivityUsageStats: package=" + packageName + " event=" + event); } synchronized (this) { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(packageName, userId, event); } } } /** * Update Usages on this foreground service's usage. Loading @@ -2577,14 +2572,12 @@ public class ActivityManagerService extends IActivityManager.Stub Slog.d(TAG_SWITCH, "updateForegroundServiceUsageStats: comp=" + service + " started=" + started); } synchronized (this) { if (mUsageStatsService != null) { mUsageStatsService.reportEvent(service, userId, started ? UsageEvents.Event.FOREGROUND_SERVICE_START : UsageEvents.Event.FOREGROUND_SERVICE_STOP, 0, null); } } } CompatibilityInfo compatibilityInfoForPackage(ApplicationInfo ai) { return mAtmInternal.compatibilityInfoForPackage(ai); Loading Loading @@ -6100,7 +6093,7 @@ public class ActivityManagerService extends IActivityManager.Stub return pfd; } void reportGlobalUsageEventLocked(int event) { void reportGlobalUsageEvent(int event) { final int currentUserId = mUserController.getCurrentUserId(); mUsageStatsService.reportEvent(Event.DEVICE_EVENT_PACKAGE_NAME, currentUserId, event); int[] profiles = mUserController.getCurrentProfileIds(); Loading @@ -6114,8 +6107,8 @@ public class ActivityManagerService extends IActivityManager.Stub } } void reportCurWakefulnessUsageEventLocked() { reportGlobalUsageEventLocked(mWakefulness == PowerManagerInternal.WAKEFULNESS_AWAKE void reportCurWakefulnessUsageEvent() { reportGlobalUsageEvent(mWakefulness == PowerManagerInternal.WAKEFULNESS_AWAKE ? UsageEvents.Event.SCREEN_INTERACTIVE : UsageEvents.Event.SCREEN_NON_INTERACTIVE); } Loading @@ -6129,7 +6122,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (wasAwake != isAwake) { // Also update state in a special way for running foreground services UI. mServices.updateScreenStateLocked(isAwake); reportCurWakefulnessUsageEventLocked(); reportCurWakefulnessUsageEvent(); mActivityTaskManager.onScreenAwakeChanged(isAwake); mOomAdjProfiler.onWakefulnessChanged(wakefulness); } Loading Loading @@ -16529,12 +16522,10 @@ public class ActivityManagerService extends IActivityManager.Stub } public void reportCurKeyguardUsageEvent(boolean keyguardShowing) { synchronized(ActivityManagerService.this) { ActivityManagerService.this.reportGlobalUsageEventLocked(keyguardShowing ActivityManagerService.this.reportGlobalUsageEvent(keyguardShowing ? UsageEvents.Event.KEYGUARD_SHOWN : UsageEvents.Event.KEYGUARD_HIDDEN); } } @Override public void monitor() {
services/core/java/com/android/server/am/UserController.java +2 −6 Original line number Diff line number Diff line Loading @@ -3046,15 +3046,11 @@ class UserController implements Handler.Callback { } void reportGlobalUsageEventLocked(int event) { synchronized (mService) { mService.reportGlobalUsageEventLocked(event); } mService.reportGlobalUsageEvent(event); } void reportCurWakefulnessUsageEvent() { synchronized (mService) { mService.reportCurWakefulnessUsageEventLocked(); } mService.reportCurWakefulnessUsageEvent(); } void taskSupervisorRemoveUser(@UserIdInt int userId) { Loading