Loading apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +4 −2 Original line number Diff line number Diff line Loading @@ -1565,8 +1565,10 @@ public class AppStandbyController @Override @StandbyBuckets public int getAppStandbyBucket(String packageName, int userId, long elapsedRealtime, boolean shouldObfuscateInstantApps) { if (!mAppIdleEnabled || (shouldObfuscateInstantApps && mInjector.isPackageEphemeral(userId, packageName))) { if (!mAppIdleEnabled) { return STANDBY_BUCKET_EXEMPTED; } if (shouldObfuscateInstantApps && mInjector.isPackageEphemeral(userId, packageName)) { return STANDBY_BUCKET_ACTIVE; } Loading core/api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,7 @@ package android.app.usage { public final class UsageStatsManager { method public void forceUsageSourceSettingRead(); method public boolean isAppStandbyEnabled(); } } Loading Loading @@ -1834,6 +1835,7 @@ package android.os { } public final class PowerManager { method public boolean areAutoPowerSaveModesEnabled(); method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_LOW_POWER_STANDBY, android.Manifest.permission.DEVICE_POWER}) public void forceLowPowerStandbyActive(boolean); field public static final String ACTION_ENHANCED_DISCHARGE_PREDICTION_CHANGED = "android.os.action.ENHANCED_DISCHARGE_PREDICTION_CHANGED"; field @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public static final int SYSTEM_WAKELOCK = -2147483648; // 0x80000000 Loading core/java/android/app/usage/IUsageStatsManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ interface IUsageStatsManager { UsageEvents queryEventsForPackageForUser(long beginTime, long endTime, int userId, String pkg, String callingPackage); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) void setAppInactive(String packageName, boolean inactive, int userId); boolean isAppStandbyEnabled(); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) boolean isAppInactive(String packageName, int userId, String callingPackage); void onCarrierPrivilegedAppsChanged(); Loading core/java/android/app/usage/UsageStatsManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -641,6 +641,19 @@ public final class UsageStatsManager { return aggregatedStats; } /** * Returns whether the app standby bucket feature is enabled. * @hide */ @TestApi public boolean isAppStandbyEnabled() { try { return mService.isAppStandbyEnabled(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns whether the specified app is currently considered inactive. This will be true if the * app hasn't been used directly or indirectly for a period of time defined by the system. This Loading core/java/android/os/IPowerManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ interface IPowerManager float getBrightnessConstraint(int constraint); @UnsupportedAppUsage boolean isInteractive(); boolean areAutoPowerSaveModesEnabled(); boolean isPowerSaveMode(); PowerSaveState getPowerSaveState(int serviceType); boolean setPowerSaveModeEnabled(boolean mode); Loading Loading
apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +4 −2 Original line number Diff line number Diff line Loading @@ -1565,8 +1565,10 @@ public class AppStandbyController @Override @StandbyBuckets public int getAppStandbyBucket(String packageName, int userId, long elapsedRealtime, boolean shouldObfuscateInstantApps) { if (!mAppIdleEnabled || (shouldObfuscateInstantApps && mInjector.isPackageEphemeral(userId, packageName))) { if (!mAppIdleEnabled) { return STANDBY_BUCKET_EXEMPTED; } if (shouldObfuscateInstantApps && mInjector.isPackageEphemeral(userId, packageName)) { return STANDBY_BUCKET_ACTIVE; } Loading
core/api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,7 @@ package android.app.usage { public final class UsageStatsManager { method public void forceUsageSourceSettingRead(); method public boolean isAppStandbyEnabled(); } } Loading Loading @@ -1834,6 +1835,7 @@ package android.os { } public final class PowerManager { method public boolean areAutoPowerSaveModesEnabled(); method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_LOW_POWER_STANDBY, android.Manifest.permission.DEVICE_POWER}) public void forceLowPowerStandbyActive(boolean); field public static final String ACTION_ENHANCED_DISCHARGE_PREDICTION_CHANGED = "android.os.action.ENHANCED_DISCHARGE_PREDICTION_CHANGED"; field @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public static final int SYSTEM_WAKELOCK = -2147483648; // 0x80000000 Loading
core/java/android/app/usage/IUsageStatsManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ interface IUsageStatsManager { UsageEvents queryEventsForPackageForUser(long beginTime, long endTime, int userId, String pkg, String callingPackage); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) void setAppInactive(String packageName, boolean inactive, int userId); boolean isAppStandbyEnabled(); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) boolean isAppInactive(String packageName, int userId, String callingPackage); void onCarrierPrivilegedAppsChanged(); Loading
core/java/android/app/usage/UsageStatsManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -641,6 +641,19 @@ public final class UsageStatsManager { return aggregatedStats; } /** * Returns whether the app standby bucket feature is enabled. * @hide */ @TestApi public boolean isAppStandbyEnabled() { try { return mService.isAppStandbyEnabled(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns whether the specified app is currently considered inactive. This will be true if the * app hasn't been used directly or indirectly for a period of time defined by the system. This Loading
core/java/android/os/IPowerManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ interface IPowerManager float getBrightnessConstraint(int constraint); @UnsupportedAppUsage boolean isInteractive(); boolean areAutoPowerSaveModesEnabled(); boolean isPowerSaveMode(); PowerSaveState getPowerSaveState(int serviceType); boolean setPowerSaveModeEnabled(boolean mode); Loading