| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app.job; |
| 18 |
|
| 19 |
import android.annotation.SystemApi; |
| 20 |
import android.app.JobSchedulerImpl; |
| 21 |
import android.app.SystemServiceRegistry; |
| 22 |
import android.app.tare.EconomyManager; |
| 23 |
import android.content.Context; |
| 24 |
import android.os.DeviceIdleManager; |
| 25 |
import android.os.IDeviceIdleController; |
| 26 |
import android.os.PowerExemptionManager; |
| 27 |
import android.os.PowerWhitelistManager; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
@SystemApi |
| 35 |
public class JobSchedulerFrameworkInitializer { |
| 36 |
private JobSchedulerFrameworkInitializer() { |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
public static void registerServiceWrappers() { |
| 47 |
SystemServiceRegistry.registerStaticService( |
| 48 |
Context.JOB_SCHEDULER_SERVICE, JobScheduler.class, |
| 49 |
(b) -> new JobSchedulerImpl(IJobScheduler.Stub.asInterface(b))); |
| 50 |
SystemServiceRegistry.registerContextAwareService( |
| 51 |
Context.DEVICE_IDLE_CONTROLLER, DeviceIdleManager.class, |
| 52 |
(context, b) -> new DeviceIdleManager( |
| 53 |
context, IDeviceIdleController.Stub.asInterface(b))); |
| 54 |
SystemServiceRegistry.registerContextAwareService( |
| 55 |
Context.POWER_WHITELIST_MANAGER, PowerWhitelistManager.class, |
| 56 |
PowerWhitelistManager::new); |
| 57 |
SystemServiceRegistry.registerContextAwareService( |
| 58 |
Context.POWER_EXEMPTION_SERVICE, PowerExemptionManager.class, |
| 59 |
PowerExemptionManager::new); |
| 60 |
SystemServiceRegistry.registerStaticService( |
| 61 |
Context.RESOURCE_ECONOMY_SERVICE, EconomyManager.class, EconomyManager::new); |
| 62 |
} |
| 63 |
} |