Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b12b19ac authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't report global usage events twice for the same user."

parents cf9d622e 904a86f2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -7901,11 +7901,14 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    void reportGlobalUsageEventLocked(int event) {
        mUsageStatsService.reportEvent(Event.DEVICE_EVENT_PACKAGE_NAME,
                mUserController.getCurrentUserId(), event);
        final int currentUserId = mUserController.getCurrentUserId();
        mUsageStatsService.reportEvent(Event.DEVICE_EVENT_PACKAGE_NAME, currentUserId, event);
        int[] profiles = mUserController.getCurrentProfileIds();
        if (profiles != null) {
            for (int i = profiles.length - 1; i >= 0; i--) {
                if (profiles[i] == currentUserId) {
                    continue;
                }
                mUsageStatsService.reportEvent(Event.DEVICE_EVENT_PACKAGE_NAME, profiles[i], event);
            }
        }