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

Commit 001eb8f4 authored by Danning Chen's avatar Danning Chen
Browse files

Update the method signature for queryEventsForUser()

Change-Id: I9ed16e6164493915dba48366249c61dc49214e5a
Test: atest com.android.server.people.data.DataManagerTest
Bug: 148627336
parent 25e3a1ad
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -215,9 +215,14 @@ public abstract class UsageStatsManagerInternal {

    /**
     * Returns the events for the user in the given time period.
     *
     * @param obfuscateInstantApps whether instant app package names need to be obfuscated in the
     *     result.
     * @param hideShortcutInvocationEvents whether the {@link UsageEvents.Event#SHORTCUT_INVOCATION}
     *     events need to be excluded from the result.
     */
    public abstract UsageEvents queryEventsForUser(@UserIdInt int userId, long beginTime,
            long endTime, boolean shouldObfuscateInstantApps);
            long endTime, boolean obfuscateInstantApps, boolean hideShortcutInvocationEvents);

    /**
     * Used to persist the last time a job was run for this app, in order to make decisions later
+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ public class DataManager {
    @WorkerThread
    void queryUsageStatsService(@UserIdInt int userId, long currentTime, long lastQueryTime) {
        UsageEvents usageEvents = mUsageStatsManagerInternal.queryEventsForUser(
                userId, lastQueryTime, currentTime, false);
                userId, lastQueryTime, currentTime, false, false);
        if (usageEvents == null) {
            return;
        }
+1 −1
Original line number Diff line number Diff line
@@ -332,7 +332,7 @@ public final class DataManagerTest {
        events.add(e);
        UsageEvents usageEvents = new UsageEvents(events, new String[]{});
        when(mUsageStatsManagerInternal.queryEventsForUser(anyInt(), anyLong(), anyLong(),
                anyBoolean())).thenReturn(usageEvents);
                anyBoolean(), anyBoolean())).thenReturn(usageEvents);

        mDataManager.onUserUnlocked(USER_ID_PRIMARY);

+2 −2
Original line number Diff line number Diff line
@@ -2117,9 +2117,9 @@ public class UsageStatsService extends SystemService implements

        @Override
        public UsageEvents queryEventsForUser(int userId, long beginTime, long endTime,
                boolean shouldObfuscateInstantApps) {
                boolean obfuscateInstantApps, boolean hideShortcutInvocationEvents) {
            return UsageStatsService.this.queryEvents(
                    userId, beginTime, endTime, shouldObfuscateInstantApps, false);
                    userId, beginTime, endTime, obfuscateInstantApps, hideShortcutInvocationEvents);
        }

        @Override