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

Commit d7924b60 authored by Suprabh Shukla's avatar Suprabh Shukla Committed by Android (Google) Code Review
Browse files

Merge "Calling method in DPMS after resolving userId" into nyc-dev

parents 2c1c7311 8bea73e5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.app.admin;

import android.os.UserHandle;

import java.util.List;

/**
@@ -71,8 +73,8 @@ public abstract class DevicePolicyManagerInternal {
    public abstract boolean isActiveAdminWithPolicy(int uid, int reqPolicy);

    /**
     * Checks if a given package has a device or a profile owner for the given user
     *
     * Checks if a given package has a device or a profile owner for the given user.
     * </br><em>Does <b>not</b> support negative userIds like {@link UserHandle#USER_ALL}</em>
     * @param packageName The package to check
     * @param userId the userId to check for.
     * @return true if package has a device or profile owner, false otherwise.
+4 −4
Original line number Diff line number Diff line
@@ -5272,6 +5272,10 @@ public final class ActivityManagerService extends ActivityManagerNative
    public boolean clearApplicationUserData(final String packageName,
            final IPackageDataObserver observer, int userId) {
        enforceNotIsolatedCaller("clearApplicationUserData");
        int uid = Binder.getCallingUid();
        int pid = Binder.getCallingPid();
        userId = mUserController.handleIncomingUser(pid, uid, userId, false,
                ALLOW_FULL_ONLY, "clearApplicationUserData", null);
        final DevicePolicyManagerInternal dpmi = LocalServices
                .getService(DevicePolicyManagerInternal.class);
@@ -5279,10 +5283,6 @@ public final class ActivityManagerService extends ActivityManagerNative
            throw new SecurityException("Cannot clear data for a device owner or a profile owner");
        }
        int uid = Binder.getCallingUid();
        int pid = Binder.getCallingPid();
        userId = mUserController.handleIncomingUser(pid, uid, userId, false,
                ALLOW_FULL_ONLY, "clearApplicationUserData", null);
        long callingId = Binder.clearCallingIdentity();
        try {
            IPackageManager pm = AppGlobals.getPackageManager();