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

Commit 4ef21d03 authored by Hai Zhang's avatar Hai Zhang
Browse files

Add RoleManager into SystemServiceRegistry.

This change adds RoleManager into SystemServiceRegistry so that
Context.getSystemService() can work properly for RoleManager.

Bug: 110557011
Test: build
Change-Id: I81b7ed87e71f0deee090252f5bedf42eb79806aa
parent c595f112
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.app.admin.DevicePolicyManager;
import android.app.admin.IDevicePolicyManager;
import android.app.job.IJobScheduler;
import android.app.job.JobScheduler;
import android.app.role.RoleManager;
import android.app.slice.SliceManager;
import android.app.timedetector.TimeDetector;
import android.app.timezone.RulesManager;
@@ -1114,6 +1115,14 @@ final class SystemServiceRegistry {
                    public PermissionManager createService(ContextImpl ctx) {
                        return new PermissionManager(ctx.getOuterContext());
                    }});

        registerService(Context.ROLE_SERVICE, RoleManager.class,
                new CachedServiceFetcher<RoleManager>() {
                    @Override
                    public RoleManager createService(ContextImpl ctx)
                            throws ServiceNotFoundException {
                        return new RoleManager(ctx.getOuterContext());
                    }});
    }

    /**