Skip to content

Commit 9766b39

Browse files
committed
bug fix UsageEvent.timeStamp
1 parent 0e8cbae commit 9766b39

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/index.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,30 @@ export function queryAndAggregateUsageStats(
4141
}
4242

4343
export interface UsageEvent {
44-
eventType: number;
45-
timestamp: number;
44+
eventType: EventType;
45+
timeStamp: number;
4646
packageName: string;
4747
}
4848

49+
export enum EventType {
50+
NONE = 0,
51+
ACTIVITY_RESUMED = 1,
52+
ACTIVITY_PAUSED = 2,
53+
CONFIGURATION_CHANGE = 5,
54+
USER_INTERACTION = 7,
55+
SHORTCUT_INVOCATION = 8,
56+
STANDBY_BUCKET_CHANGED = 11,
57+
SCREEN_INTERACTIVE = 15,
58+
SCREEN_NON_INTERACTIVE = 16,
59+
KEYGUARD_SHOWN = 17,
60+
KEYGUARD_HIDDEN = 18,
61+
FOREGROUND_SERVICE_START = 19,
62+
FOREGROUND_SERVICE_STOP = 20,
63+
ACTIVITY_STOPPED = 23,
64+
DEVICE_SHUTDOWN = 26,
65+
DEVICE_STARTUP = 27,
66+
}
67+
4968
export function queryEvents(
5069
startTime: number,
5170
endTime: number

0 commit comments

Comments
 (0)