Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ff9876c authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Clean up SystemServiceRegistry.

Now modules don't need to deal with ContextImpl.

Bug: 137763703
Test: boot
Change-Id: I7213eb3cd897679c0dbd20459430e0a2fdd6201e
parent 22562664
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.
+2 −2
Original line number Diff line number Diff line
@@ -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);
                    }});
    }