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

Commit 6655630c authored by Xiaohui Chen's avatar Xiaohui Chen
Browse files

Clean up UserHandle.isOwner() in frameworks

Bug: 24869636
Change-Id: Ibebd7d0762f5375ee93ec101e7ab5578769bd9f6
parent a15f791c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ public class EventConditionProvider extends SystemConditionProviderService {
        }
        mTrackers.clear();
        for (UserHandle user : UserManager.get(mContext).getUserProfiles()) {
            final Context context = user.isOwner() ? mContext : getContextForUser(mContext, user);
            final Context context = user.isSystem() ? mContext : getContextForUser(mContext, user);
            if (context == null) {
                Slog.w(TAG, "Unable to create context for user " + user.getIdentifier());
                continue;
+1 −1
Original line number Diff line number Diff line
@@ -3494,7 +3494,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        final UserHandle caller = mInjector.binderGetCallingUserHandle();
        // If there is a profile owner, redirect to that; otherwise query the device owner.
        ComponentName aliasChooser = getProfileOwner(caller.getIdentifier());
        if (aliasChooser == null && caller.isOwner()) {
        if (aliasChooser == null && caller.isSystem()) {
            ActiveAdmin deviceOwnerAdmin = getDeviceOwnerAdminLocked();
            if (deviceOwnerAdmin != null) {
                aliasChooser = deviceOwnerAdmin.info.getComponent();