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

Commit 95cd4bf8 authored by Eugene Susla's avatar Eugene Susla
Browse files

Perform permission/appop cleanup on sms kill switch for all users

Test: manual
Change-Id: If53bf7ab95cb0963667bb7914c85589267cb3d8c
parent 04c971ec
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -201,10 +201,15 @@ public class RoleManagerService extends SystemService implements RoleUserState.C
                new ContentObserver(getContext().getMainThreadHandler()) {
                    @Override
                    public void onChange(boolean selfChange, Uri uri, int userId) {
                        getOrCreateControllerService(userId).onSmsKillSwitchToggled(
                                Settings.Global.getInt(
                        boolean killSwitchEnabled = Settings.Global.getInt(
                                getContext().getContentResolver(),
                                        Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, 0) == 1);
                                Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, 0) == 1;
                        for (int user : mUserManagerInternal.getUserIds()) {
                            if (mUserManagerInternal.isUserRunning(user)) {
                                getOrCreateControllerService(user)
                                        .onSmsKillSwitchToggled(killSwitchEnabled);
                            }
                        }
                    }
                }, UserHandle.USER_ALL);
    }