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

Commit 39ab15d7 authored by bsears's avatar bsears Committed by Felipe Leme
Browse files

Revert "Added profile-owner and device-owner on cmd user and dump user."

This reverts commit 757491fd.

Reason for revert: Bug 175860401 - CL being reverted was identified as causing deadlocks, see b/175860401#comment10

Change-Id: Icf51a40a979f32c7cc1a1b2677ecf43e2656bf47
parent 25d41144
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -231,13 +231,7 @@ public abstract class DevicePolicyManagerInternal {
     * Returns the profile owner component for the given user, or {@code null} if there is not one.
     */
    @Nullable
    public abstract ComponentName getProfileOwnerAsUser(@UserIdInt int userId);

    /**
     * Returns the user id of the device owner, or {@link UserHandle#USER_NULL} if there is not one.
     */
    @UserIdInt
    public abstract int getDeviceOwnerUserId();
    public abstract ComponentName getProfileOwnerAsUser(int userHandle);

    /**
     * Returns whether the given package is a device owner or a profile owner in the calling user.
+1 −34
Original line number Diff line number Diff line
@@ -4760,31 +4760,13 @@ public class UserManagerService extends IUserManager.Stub {
                final boolean hasParent = user.profileGroupId != user.id
                        && user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID;
                if (verbose) {
                    final DevicePolicyManagerInternal dpm = getDevicePolicyManagerInternal();
                    String deviceOwner = "";
                    String profileOwner = "";
                    if (dpm != null) {
                        final long ident = Binder.clearCallingIdentity();
                        try {
                            if (dpm.getDeviceOwnerUserId() == user.id) {
                                deviceOwner = " (device-owner)";
                            }
                            if (dpm.getProfileOwnerAsUser(user.id) != null) {
                                profileOwner = " (profile-owner)";
                            }
                        } finally {
                            Binder.restoreCallingIdentity(ident);
                        }
                    }
                    pw.printf("%d: id=%d, name=%s, flags=%s%s%s%s%s%s%s%s%s\n", i, user.id,
                            user.name,
                    pw.printf("%d: id=%d, name=%s, flags=%s%s%s%s%s%s%s\n", i, user.id, user.name,
                            UserInfo.flagsToString(user.flags),
                            hasParent ? " (parentId=" + user.profileGroupId + ")" : "",
                            running ? " (running)" : "",
                            user.partial ? " (partial)" : "",
                            user.preCreated ? " (pre-created)" : "",
                            user.convertedFromPreCreated ? " (converted)" : "",
                            deviceOwner, profileOwner,
                            current ? " (current)" : "");
                } else {
                    // NOTE: the standard "list users" command is used by integration tests and
@@ -4878,21 +4860,6 @@ public class UserManagerService extends IUserManager.Stub {
                    if (userInfo.convertedFromPreCreated) {
                        pw.print(" <converted>");
                    }
                    final DevicePolicyManagerInternal dpm = getDevicePolicyManagerInternal();
                    if (dpm != null) {
                        final long ident = Binder.clearCallingIdentity();
                        try {
                            if (dpm.getDeviceOwnerUserId() == userId) {
                                pw.print(" <device-owner>");
                            }
                            if (dpm.getProfileOwnerAsUser(userId) != null) {
                                pw.print(" <profile-owner>");
                            }
                        } finally {
                            Binder.restoreCallingIdentity(ident);
                        }
                    }

                    pw.println();
                    pw.print("    Type: "); pw.println(userInfo.userType);
                    pw.print("    Flags: "); pw.print(userInfo.flags); pw.print(" (");
+2 −7
Original line number Diff line number Diff line
@@ -11763,13 +11763,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        }
        @Override
        public ComponentName getProfileOwnerAsUser(@UserIdInt int userId) {
            return DevicePolicyManagerService.this.getProfileOwnerAsUser(userId);
        }
        @Override
        public int getDeviceOwnerUserId() {
            return DevicePolicyManagerService.this.getDeviceOwnerUserId();
        public ComponentName getProfileOwnerAsUser(int userHandle) {
            return DevicePolicyManagerService.this.getProfileOwnerAsUser(userHandle);
        }
        @Override