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

Commit 9cb7fe03 authored by Hongming Jin's avatar Hongming Jin Committed by Android (Google) Code Review
Browse files

Merge "Migrate emergency default app to role manager."

parents 5e67c98a 910cd7b2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -130,6 +130,12 @@ public class LegacyRoleResolutionPolicy implements RoleManagerService.RoleHolder
                String packageName = componentName != null ? componentName.getPackageName() : null;
                return CollectionUtils.singletonOrEmpty(packageName);
            }
            case RoleManager.ROLE_EMERGENCY: {
                String defaultEmergencyApp = Settings.Secure.getStringForUser(
                        mContext.getContentResolver(),
                        Settings.Secure.EMERGENCY_ASSISTANCE_APPLICATION, userId);
                return CollectionUtils.singletonOrEmpty(defaultEmergencyApp);
            }
            default: {
                Slog.e(LOG_TAG, "Don't know how to find legacy role holders for " + roleName);
                return Collections.emptyList();
+1 −0
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ public class RoleManagerService extends SystemService implements RoleUserState.C
            migrateRoleIfNecessary(RoleManager.ROLE_SMS, userId);
            migrateRoleIfNecessary(RoleManager.ROLE_ASSISTANT, userId);
            migrateRoleIfNecessary(RoleManager.ROLE_DIALER, userId);
            migrateRoleIfNecessary(RoleManager.ROLE_EMERGENCY, userId);

            // Some vital packages state has changed since last role grant
            // Run grants again