Loading core/java/android/os/PowerManager.java +30 −3 Original line number Diff line number Diff line Loading @@ -513,6 +513,34 @@ public final class PowerManager { */ public static final int SHUTDOWN_REASON_BATTERY_THERMAL = 6; /** * @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef({ServiceType.GPS, ServiceType.VIBRATION, ServiceType.ANIMATION, ServiceType.FULL_BACKUP, ServiceType.KEYVALUE_BACKUP, ServiceType.NETWORK_FIREWALL, ServiceType.SCREEN_BRIGHTNESS, ServiceType.SOUND, ServiceType.BATTERY_STATS, ServiceType.DATA_SAVER}) public @interface ServiceType { int NULL = 0; int GPS = 1; int VIBRATION = 2; int ANIMATION = 3; int FULL_BACKUP = 4; int KEYVALUE_BACKUP = 5; int NETWORK_FIREWALL = 6; int SCREEN_BRIGHTNESS = 7; int SOUND = 8; int BATTERY_STATS = 9; int DATA_SAVER = 10; } final Context mContext; final IPowerManager mService; final Handler mHandler; Loading Loading @@ -1055,15 +1083,14 @@ public final class PowerManager { /** * Get data about the battery saver mode for a specific service * @param serviceType unique key for the service, one of * {@link com.android.server.power.BatterySaverPolicy.ServiceType} * @param serviceType unique key for the service, one of {@link ServiceType} * @return Battery saver state data. * * @hide * @see com.android.server.power.BatterySaverPolicy * @see PowerSaveState */ public PowerSaveState getPowerSaveState(int serviceType) { public PowerSaveState getPowerSaveState(@ServiceType int serviceType) { try { return mService.getPowerSaveState(serviceType); } catch (RemoteException e) { Loading core/java/android/os/PowerSaveState.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ public class PowerSaveState implements Parcelable { /** * Whether we should enable battery saver for this service. * * @see com.android.server.power.BatterySaverPolicy.ServiceType * @see com.android.server.power.BatterySaverPolicy */ public final boolean batterySaverEnabled; /** Loading services/backup/java/com/android/server/backup/BackupManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.Signature; import android.database.ContentObserver; import android.net.Uri; import android.os.PowerManager.ServiceType; import android.os.PowerSaveState; import android.os.Binder; import android.os.Build; Loading Loading @@ -126,7 +127,6 @@ import com.android.server.EventLogTags; import com.android.server.SystemConfig; import com.android.server.SystemService; import com.android.server.backup.PackageManagerBackupAgent.Metadata; import com.android.server.power.BatterySaverPolicy.ServiceType; import libcore.io.IoUtils; Loading services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import android.os.IBinder; import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.PowerManager; import android.os.PowerManager.ServiceType; import android.os.PowerSaveState; import android.os.Process; import android.os.RemoteException; Loading Loading @@ -120,7 +121,6 @@ import com.android.server.backup.utils.AppBackupUtils; import com.android.server.backup.utils.BackupManagerMonitorUtils; import com.android.server.backup.utils.BackupObserverUtils; import com.android.server.backup.utils.SparseArrayUtils; import com.android.server.power.BatterySaverPolicy.ServiceType; import com.google.android.collect.Sets; Loading services/core/java/com/android/server/VibratorService.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.database.ContentObserver; import android.hardware.input.InputManager; import android.hardware.vibrator.V1_0.Constants.EffectStrength; import android.media.AudioManager; import android.os.PowerManager.ServiceType; import android.os.PowerSaveState; import android.os.BatteryStats; import android.os.Handler; Loading Loading @@ -56,7 +57,6 @@ import android.media.AudioAttributes; import com.android.internal.app.IAppOpsService; import com.android.internal.app.IBatteryStats; import com.android.internal.util.DumpUtils; import com.android.server.power.BatterySaverPolicy.ServiceType; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading
core/java/android/os/PowerManager.java +30 −3 Original line number Diff line number Diff line Loading @@ -513,6 +513,34 @@ public final class PowerManager { */ public static final int SHUTDOWN_REASON_BATTERY_THERMAL = 6; /** * @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef({ServiceType.GPS, ServiceType.VIBRATION, ServiceType.ANIMATION, ServiceType.FULL_BACKUP, ServiceType.KEYVALUE_BACKUP, ServiceType.NETWORK_FIREWALL, ServiceType.SCREEN_BRIGHTNESS, ServiceType.SOUND, ServiceType.BATTERY_STATS, ServiceType.DATA_SAVER}) public @interface ServiceType { int NULL = 0; int GPS = 1; int VIBRATION = 2; int ANIMATION = 3; int FULL_BACKUP = 4; int KEYVALUE_BACKUP = 5; int NETWORK_FIREWALL = 6; int SCREEN_BRIGHTNESS = 7; int SOUND = 8; int BATTERY_STATS = 9; int DATA_SAVER = 10; } final Context mContext; final IPowerManager mService; final Handler mHandler; Loading Loading @@ -1055,15 +1083,14 @@ public final class PowerManager { /** * Get data about the battery saver mode for a specific service * @param serviceType unique key for the service, one of * {@link com.android.server.power.BatterySaverPolicy.ServiceType} * @param serviceType unique key for the service, one of {@link ServiceType} * @return Battery saver state data. * * @hide * @see com.android.server.power.BatterySaverPolicy * @see PowerSaveState */ public PowerSaveState getPowerSaveState(int serviceType) { public PowerSaveState getPowerSaveState(@ServiceType int serviceType) { try { return mService.getPowerSaveState(serviceType); } catch (RemoteException e) { Loading
core/java/android/os/PowerSaveState.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ public class PowerSaveState implements Parcelable { /** * Whether we should enable battery saver for this service. * * @see com.android.server.power.BatterySaverPolicy.ServiceType * @see com.android.server.power.BatterySaverPolicy */ public final boolean batterySaverEnabled; /** Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.Signature; import android.database.ContentObserver; import android.net.Uri; import android.os.PowerManager.ServiceType; import android.os.PowerSaveState; import android.os.Binder; import android.os.Build; Loading Loading @@ -126,7 +127,6 @@ import com.android.server.EventLogTags; import com.android.server.SystemConfig; import com.android.server.SystemService; import com.android.server.backup.PackageManagerBackupAgent.Metadata; import com.android.server.power.BatterySaverPolicy.ServiceType; import libcore.io.IoUtils; Loading
services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import android.os.IBinder; import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.PowerManager; import android.os.PowerManager.ServiceType; import android.os.PowerSaveState; import android.os.Process; import android.os.RemoteException; Loading Loading @@ -120,7 +121,6 @@ import com.android.server.backup.utils.AppBackupUtils; import com.android.server.backup.utils.BackupManagerMonitorUtils; import com.android.server.backup.utils.BackupObserverUtils; import com.android.server.backup.utils.SparseArrayUtils; import com.android.server.power.BatterySaverPolicy.ServiceType; import com.google.android.collect.Sets; Loading
services/core/java/com/android/server/VibratorService.java +1 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.database.ContentObserver; import android.hardware.input.InputManager; import android.hardware.vibrator.V1_0.Constants.EffectStrength; import android.media.AudioManager; import android.os.PowerManager.ServiceType; import android.os.PowerSaveState; import android.os.BatteryStats; import android.os.Handler; Loading Loading @@ -56,7 +57,6 @@ import android.media.AudioAttributes; import com.android.internal.app.IAppOpsService; import com.android.internal.app.IBatteryStats; import com.android.internal.util.DumpUtils; import com.android.server.power.BatterySaverPolicy.ServiceType; import java.io.FileDescriptor; import java.io.PrintWriter; Loading