/** Sets the standby bucket of the specified app. */ @Implementation(minSdk = Build.VERSION_CODES.P) @HiddenApi public void setAppStandbyBucket(String packageName, @StandbyBuckets int bucket) { appStandbyBuckets.put(packageName, bucket); }
/** * Returns the current standby bucket of the specified app that is set by {@code * setAppStandbyBucket}. If the standby bucket value has never been set, return {@link * UsageStatsManager.STANDBY_BUCKET_ACTIVE}. */ @Implementation(minSdk = Build.VERSION_CODES.P) @HiddenApi public @StandbyBuckets int getAppStandbyBucket(String packageName) { Integer bucket = appStandbyBuckets.get(packageName); return (bucket == null) ? UsageStatsManager.STANDBY_BUCKET_ACTIVE : bucket; }
/** Sets the standby bucket of the specified app. */ @Implementation(minSdk = Build.VERSION_CODES.P) @HiddenApi public void setAppStandbyBucket(String packageName, @StandbyBuckets int bucket) { appStandbyBuckets.put(packageName, bucket); }
private static @StandbyBuckets int currentAppStandbyBucket = UsageStatsManager.STANDBY_BUCKET_ACTIVE; private static final TreeMap<Long, Event> eventsByTimeStamp = new TreeMap<>();
/** * Returns the current standby bucket of the specified app that is set by {@code * setAppStandbyBucket}. If the standby bucket value has never been set, return {@link * UsageStatsManager.STANDBY_BUCKET_ACTIVE}. */ @Implementation(minSdk = Build.VERSION_CODES.P) @HiddenApi public @StandbyBuckets int getAppStandbyBucket(String packageName) { Integer bucket = appStandbyBuckets.get(packageName); return (bucket == null) ? UsageStatsManager.STANDBY_BUCKET_ACTIVE : bucket; }
/** Sets the current app's standby bucket */ public void setCurrentAppStandbyBucket(@StandbyBuckets int bucket) { currentAppStandbyBucket = bucket; }
/** * Returns the current app's standby bucket that is set by {@code setCurrentAppStandbyBucket}. If * the standby bucket value has never been set, return {@link * UsageStatsManager.STANDBY_BUCKET_ACTIVE}. */ @Implementation(minSdk = Build.VERSION_CODES.P) @StandbyBuckets protected int getAppStandbyBucket() { return currentAppStandbyBucket; }
private static @StandbyBuckets int currentAppStandbyBucket = UsageStatsManager.STANDBY_BUCKET_ACTIVE; private static final NavigableMap<Long, Event> eventsByTimeStamp =
/** * Returns the current app's standby bucket that is set by {@code setCurrentAppStandbyBucket}. If * the standby bucket value has never been set, return {@link * UsageStatsManager.STANDBY_BUCKET_ACTIVE}. */ @Implementation(minSdk = Build.VERSION_CODES.P) @StandbyBuckets protected int getAppStandbyBucket() { return currentAppStandbyBucket; }
/** Sets the current app's standby bucket */ public void setCurrentAppStandbyBucket(@StandbyBuckets int bucket) { currentAppStandbyBucket = bucket; }