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

Commit 02ebf939 authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge "Remove binderClearCallingIdentity()"

parents 34ed6816 d6bd9dc0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -10596,11 +10596,16 @@ public class DevicePolicyManager {
     * behavior of this API is changed such that passing {@code null} as the {@code admin} parameter
     * will return if any admin has blocked the uninstallation. Before L MR1, passing {@code null}
     * will cause a NullPointerException to be raised.
     * <p>
     * <strong>Note:</strong> If your app targets Android 11 (API level 30) or higher,
     * this method returns a filtered result. Learn more about how to
     * <a href="/training/basics/intents/package-visibility">manage package visibility</a>.
     *
     * @param admin The name of the admin component whose blocking policy will be checked, or
     *            {@code null} to check whether any admin has blocked the uninstallation.
     * @param packageName package to check.
     * @return true if uninstallation is blocked.
     * @return true if uninstallation is blocked and the given package is visible to you, false
     *         otherwise if uninstallation isn't blocked or the given package isn't visible to you.
     * @throws SecurityException if {@code admin} is not a device or profile owner.
     */
    public boolean isUninstallBlocked(@Nullable ComponentName admin, String packageName) {
+0 −3
Original line number Diff line number Diff line
@@ -11596,14 +11596,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                Preconditions.checkCallAuthorization(
                        isProfileOwner(caller) || isDeviceOwner(caller));
            }
            long id = mInjector.binderClearCallingIdentity();
            try {
                return mIPackageManager.getBlockUninstallForUser(packageName, userId);
            } catch (RemoteException re) {
                // Shouldn't happen.
                Slogf.e(LOG_TAG, "Failed to getBlockUninstallForUser", re);
            } finally {
                mInjector.binderRestoreCallingIdentity(id);
            }
        }
        return false;