Loading apex/jobscheduler/framework/java/android/app/DeviceIdleFrameworkInitializer.java +0 −19 Original line number Diff line number Diff line Loading @@ -19,14 +19,8 @@ package android.app; import android.content.Context; import android.os.DeviceIdleManager; import android.os.IDeviceIdleController; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; /** * This class needs to be pre-loaded by zygote. This is where the device idle manager wrapper * is registered. * * @hide */ public class DeviceIdleFrameworkInitializer { Loading @@ -37,18 +31,5 @@ public class DeviceIdleFrameworkInitializer { Context.DEVICE_IDLE_CONTROLLER, DeviceIdleManager.class, (context, b) -> new DeviceIdleManager( context, IDeviceIdleController.Stub.asInterface(b))); PowerManager.setIsIgnoringBatteryOptimizationsCallback((packageName) -> { // No need for synchronization on sIDeviceIdleController; worst case // we just initialize it twice. if (sIDeviceIdleController == null) { sIDeviceIdleController = IDeviceIdleController.Stub.asInterface( ServiceManager.getService(Context.DEVICE_IDLE_CONTROLLER)); } try { return sIDeviceIdleController.isPowerSaveWhitelistApp(packageName); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }); } } apex/jobscheduler/framework/java/android/app/job/JobParameters.java +19 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,11 @@ public class JobParameters implements Parcelable { REASON_DEVICE_THERMAL, }; /** @hide */ /** * @hide * @deprecated use {@link #getReasonCodeDescription(int)} */ @Deprecated public static String getReasonName(int reason) { switch (reason) { case REASON_CANCELED: return "canceled"; Loading @@ -81,6 +85,20 @@ public class JobParameters implements Parcelable { } } /** @hide */ // @SystemApi TODO make it a system api for mainline @NonNull public static int[] getJobStopReasonCodes() { return JOB_STOP_REASON_CODES; } /** @hide */ // @SystemApi TODO make it a system api for mainline @NonNull public static String getReasonCodeDescription(int reasonCode) { return getReasonName(reasonCode); } @UnsupportedAppUsage private final int jobId; private final PersistableBundle extras; Loading apex/jobscheduler/framework/java/android/app/job/JobSchedulerFrameworkInitializer.java +0 −7 Original line number Diff line number Diff line Loading @@ -19,12 +19,8 @@ package android.app.job; import android.app.JobSchedulerImpl; import android.app.SystemServiceRegistry; import android.content.Context; import android.os.BatteryStats; /** * This class needs to be pre-loaded by zygote. This is where the job scheduler service wrapper * is registered. * * @hide */ public class JobSchedulerFrameworkInitializer { Loading @@ -32,8 +28,5 @@ public class JobSchedulerFrameworkInitializer { SystemServiceRegistry.registerStaticService( Context.JOB_SCHEDULER_SERVICE, JobScheduler.class, (b) -> new JobSchedulerImpl(IJobScheduler.Stub.asInterface(b))); BatteryStats.setJobStopReasons(JobParameters.JOB_STOP_REASON_CODES, JobParameters::getReasonName); } } apex/jobscheduler/framework/java/android/os/DeviceIdleManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -84,4 +84,17 @@ public class DeviceIdleManager { return 0; } } /** * Return whether a given package is in the power-save whitelist or not. * @hide */ public boolean isApplicationWhitelisted(@NonNull String packageName) { try { return mService.isPowerSaveWhitelistApp(packageName); } catch (RemoteException e) { e.rethrowFromSystemServer(); return false; } } } config/preloaded-classes +0 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,6 @@ android.app.ContentProviderHolder android.app.ContextImpl$1 android.app.ContextImpl$ApplicationContentResolver android.app.ContextImpl android.app.DeviceIdleFrameworkInitializer android.app.DexLoadReporter android.app.Dialog$ListenersHandler android.app.Dialog Loading Loading
apex/jobscheduler/framework/java/android/app/DeviceIdleFrameworkInitializer.java +0 −19 Original line number Diff line number Diff line Loading @@ -19,14 +19,8 @@ package android.app; import android.content.Context; import android.os.DeviceIdleManager; import android.os.IDeviceIdleController; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; /** * This class needs to be pre-loaded by zygote. This is where the device idle manager wrapper * is registered. * * @hide */ public class DeviceIdleFrameworkInitializer { Loading @@ -37,18 +31,5 @@ public class DeviceIdleFrameworkInitializer { Context.DEVICE_IDLE_CONTROLLER, DeviceIdleManager.class, (context, b) -> new DeviceIdleManager( context, IDeviceIdleController.Stub.asInterface(b))); PowerManager.setIsIgnoringBatteryOptimizationsCallback((packageName) -> { // No need for synchronization on sIDeviceIdleController; worst case // we just initialize it twice. if (sIDeviceIdleController == null) { sIDeviceIdleController = IDeviceIdleController.Stub.asInterface( ServiceManager.getService(Context.DEVICE_IDLE_CONTROLLER)); } try { return sIDeviceIdleController.isPowerSaveWhitelistApp(packageName); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }); } }
apex/jobscheduler/framework/java/android/app/job/JobParameters.java +19 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,11 @@ public class JobParameters implements Parcelable { REASON_DEVICE_THERMAL, }; /** @hide */ /** * @hide * @deprecated use {@link #getReasonCodeDescription(int)} */ @Deprecated public static String getReasonName(int reason) { switch (reason) { case REASON_CANCELED: return "canceled"; Loading @@ -81,6 +85,20 @@ public class JobParameters implements Parcelable { } } /** @hide */ // @SystemApi TODO make it a system api for mainline @NonNull public static int[] getJobStopReasonCodes() { return JOB_STOP_REASON_CODES; } /** @hide */ // @SystemApi TODO make it a system api for mainline @NonNull public static String getReasonCodeDescription(int reasonCode) { return getReasonName(reasonCode); } @UnsupportedAppUsage private final int jobId; private final PersistableBundle extras; Loading
apex/jobscheduler/framework/java/android/app/job/JobSchedulerFrameworkInitializer.java +0 −7 Original line number Diff line number Diff line Loading @@ -19,12 +19,8 @@ package android.app.job; import android.app.JobSchedulerImpl; import android.app.SystemServiceRegistry; import android.content.Context; import android.os.BatteryStats; /** * This class needs to be pre-loaded by zygote. This is where the job scheduler service wrapper * is registered. * * @hide */ public class JobSchedulerFrameworkInitializer { Loading @@ -32,8 +28,5 @@ public class JobSchedulerFrameworkInitializer { SystemServiceRegistry.registerStaticService( Context.JOB_SCHEDULER_SERVICE, JobScheduler.class, (b) -> new JobSchedulerImpl(IJobScheduler.Stub.asInterface(b))); BatteryStats.setJobStopReasons(JobParameters.JOB_STOP_REASON_CODES, JobParameters::getReasonName); } }
apex/jobscheduler/framework/java/android/os/DeviceIdleManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -84,4 +84,17 @@ public class DeviceIdleManager { return 0; } } /** * Return whether a given package is in the power-save whitelist or not. * @hide */ public boolean isApplicationWhitelisted(@NonNull String packageName) { try { return mService.isPowerSaveWhitelistApp(packageName); } catch (RemoteException e) { e.rethrowFromSystemServer(); return false; } } }
config/preloaded-classes +0 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,6 @@ android.app.ContentProviderHolder android.app.ContextImpl$1 android.app.ContextImpl$ApplicationContentResolver android.app.ContextImpl android.app.DeviceIdleFrameworkInitializer android.app.DexLoadReporter android.app.Dialog$ListenersHandler android.app.Dialog Loading