summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apex/jobscheduler/framework/java/android/app/DeviceIdleFrameworkInitializer.java2
-rw-r--r--core/java/android/app/SystemServiceRegistry.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/apex/jobscheduler/framework/java/android/app/DeviceIdleFrameworkInitializer.java b/apex/jobscheduler/framework/java/android/app/DeviceIdleFrameworkInitializer.java
index a807eb1d3311..5b1405628b49 100644
--- a/apex/jobscheduler/framework/java/android/app/DeviceIdleFrameworkInitializer.java
+++ b/apex/jobscheduler/framework/java/android/app/DeviceIdleFrameworkInitializer.java
@@ -36,7 +36,7 @@ public class DeviceIdleFrameworkInitializer {
SystemServiceRegistry.registerCachedService(
Context.DEVICE_IDLE_CONTROLLER, DeviceIdleManager.class,
(context, b) -> new DeviceIdleManager(
- context.getOuterContext(), IDeviceIdleController.Stub.asInterface(b)));
+ context, IDeviceIdleController.Stub.asInterface(b)));
PowerManager.setIsIgnoringBatteryOptimizationsCallback((packageName) -> {
// No need for synchronization on sIDeviceIdleController; worst case
// we just initialize it twice.
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 049933743450..e81dc1c59040 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -1343,13 +1343,13 @@ public final class SystemServiceRegistry {
* @hide
*/
public static <T> void registerCachedService(String serviceName, Class<T> serviceWrapperClass,
- BiFunction<ContextImpl, IBinder, T> serviceFetcher) {
+ BiFunction<Context, IBinder, T> serviceFetcher) {
registerService(serviceName, serviceWrapperClass,
new CachedServiceFetcher<T>() {
@Override
public T createService(ContextImpl ctx) throws ServiceNotFoundException {
IBinder b = ServiceManager.getServiceOrThrow(serviceName);
- return serviceFetcher.apply(ctx, b);
+ return serviceFetcher.apply(ctx.getOuterContext(), b);
}});
}