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

Commit fe1d3d4c authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am f02b60aa: Rename UserId to UserHandle.

* commit 'f02b60aa':
  Rename UserId to UserHandle.
parents 2691ab25 f02b60aa
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserId;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.TextUtils;
import android.util.Log;
@@ -354,7 +354,7 @@ public class AccountManagerService
    }

    private UserAccounts getUserAccountsForCaller() {
        return getUserAccounts(UserId.getCallingUserId());
        return getUserAccounts(UserHandle.getCallingUserId());
    }

    protected UserAccounts getUserAccounts(int userId) {
@@ -1004,7 +1004,7 @@ public class AccountManagerService
        if (callingUid != android.os.Process.SYSTEM_UID) {
            throw new SecurityException("can only call from system");
        }
        UserAccounts accounts = getUserAccounts(UserId.getUserId(callingUid));
        UserAccounts accounts = getUserAccounts(UserHandle.getUserId(callingUid));
        long identityToken = clearCallingIdentity();
        try {
            new Session(accounts, response, accountType, false,
@@ -1222,7 +1222,7 @@ public class AccountManagerService
    private Integer getCredentialPermissionNotificationId(Account account, String authTokenType,
            int uid) {
        Integer id;
        UserAccounts accounts = getUserAccounts(UserId.getUserId(uid));
        UserAccounts accounts = getUserAccounts(UserHandle.getUserId(uid));
        synchronized (accounts.credentialsPermissionNotificationIds) {
            final Pair<Pair<Account, String>, Integer> key =
                    new Pair<Pair<Account, String>, Integer>(
@@ -2269,7 +2269,7 @@ public class AccountManagerService
            Log.e(TAG, "grantAppPermission: called with invalid arguments", new Exception());
            return;
        }
        UserAccounts accounts = getUserAccounts(UserId.getUserId(uid));
        UserAccounts accounts = getUserAccounts(UserHandle.getUserId(uid));
        synchronized (accounts.cacheLock) {
            final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
            db.beginTransaction();
@@ -2303,7 +2303,7 @@ public class AccountManagerService
            Log.e(TAG, "revokeAppPermission: called with invalid arguments", new Exception());
            return;
        }
        UserAccounts accounts = getUserAccounts(UserId.getUserId(uid));
        UserAccounts accounts = getUserAccounts(UserHandle.getUserId(uid));
        synchronized (accounts.cacheLock) {
            final SQLiteDatabase db = accounts.openHelper.getWritableDatabase();
            db.beginTransaction();
+4 −4
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserId;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -529,7 +529,7 @@ public class ActivityManager {
            throws SecurityException {
        try {
            return ActivityManagerNative.getDefault().getRecentTasks(maxNum,
                    flags, UserId.myUserId());
                    flags, UserHandle.myUserId());
        } catch (RemoteException e) {
            // System dead, we will be dead too soon!
            return null;
@@ -1843,12 +1843,12 @@ public class ActivityManager {
            return PackageManager.PERMISSION_GRANTED;
        }
        // Isolated processes don't get any permissions.
        if (UserId.isIsolated(uid)) {
        if (UserHandle.isIsolated(uid)) {
            return PackageManager.PERMISSION_DENIED;
        }
        // If there is a uid that owns whatever is being accessed, it has
        // blanket access to it regardless of the permissions it requires.
        if (owningUid >= 0 && UserId.isSameApp(uid, owningUid)) {
        if (owningUid >= 0 && UserHandle.isSameApp(uid, owningUid)) {
            return PackageManager.PERMISSION_GRANTED;
        }
        // If the target is not exported, then nobody else can get to it.
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.StrictMode;
import android.os.UserId;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
import android.util.Singleton;
+3 −3
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ import android.os.ServiceManager;
import android.os.StrictMode;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserId;
import android.os.UserHandle;
import android.util.AndroidRuntimeException;
import android.util.DisplayMetrics;
import android.util.EventLog;
@@ -1696,7 +1696,7 @@ public final class ActivityThread {
        ApplicationInfo ai = null;
        try {
            ai = getPackageManager().getApplicationInfo(packageName,
                    PackageManager.GET_SHARED_LIBRARY_FILES, UserId.myUserId());
                    PackageManager.GET_SHARED_LIBRARY_FILES, UserHandle.myUserId());
        } catch (RemoteException e) {
            // Ignore
        }
@@ -1713,7 +1713,7 @@ public final class ActivityThread {
        boolean includeCode = (flags&Context.CONTEXT_INCLUDE_CODE) != 0;
        boolean securityViolation = includeCode && ai.uid != 0
                && ai.uid != Process.SYSTEM_UID && (mBoundApplication != null
                        ? !UserId.isSameApp(ai.uid, mBoundApplication.appInfo.uid)
                        ? !UserHandle.isSameApp(ai.uid, mBoundApplication.appInfo.uid)
                        : true);
        if ((flags&(Context.CONTEXT_INCLUDE_CODE
                |Context.CONTEXT_IGNORE_SECURITY))
+20 −20
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserId;
import android.os.UserHandle;
import android.util.Log;

import java.lang.ref.WeakReference;
@@ -69,7 +69,7 @@ final class ApplicationPackageManager extends PackageManager {
    public PackageInfo getPackageInfo(String packageName, int flags)
            throws NameNotFoundException {
        try {
            PackageInfo pi = mPM.getPackageInfo(packageName, flags, UserId.myUserId());
            PackageInfo pi = mPM.getPackageInfo(packageName, flags, UserHandle.myUserId());
            if (pi != null) {
                return pi;
            }
@@ -199,7 +199,7 @@ final class ApplicationPackageManager extends PackageManager {
    public ApplicationInfo getApplicationInfo(String packageName, int flags)
            throws NameNotFoundException {
        try {
            ApplicationInfo ai = mPM.getApplicationInfo(packageName, flags, UserId.myUserId());
            ApplicationInfo ai = mPM.getApplicationInfo(packageName, flags, UserHandle.myUserId());
            if (ai != null) {
                return ai;
            }
@@ -214,7 +214,7 @@ final class ApplicationPackageManager extends PackageManager {
    public ActivityInfo getActivityInfo(ComponentName className, int flags)
            throws NameNotFoundException {
        try {
            ActivityInfo ai = mPM.getActivityInfo(className, flags, UserId.myUserId());
            ActivityInfo ai = mPM.getActivityInfo(className, flags, UserHandle.myUserId());
            if (ai != null) {
                return ai;
            }
@@ -229,7 +229,7 @@ final class ApplicationPackageManager extends PackageManager {
    public ActivityInfo getReceiverInfo(ComponentName className, int flags)
            throws NameNotFoundException {
        try {
            ActivityInfo ai = mPM.getReceiverInfo(className, flags, UserId.myUserId());
            ActivityInfo ai = mPM.getReceiverInfo(className, flags, UserHandle.myUserId());
            if (ai != null) {
                return ai;
            }
@@ -244,7 +244,7 @@ final class ApplicationPackageManager extends PackageManager {
    public ServiceInfo getServiceInfo(ComponentName className, int flags)
            throws NameNotFoundException {
        try {
            ServiceInfo si = mPM.getServiceInfo(className, flags, UserId.myUserId());
            ServiceInfo si = mPM.getServiceInfo(className, flags, UserHandle.myUserId());
            if (si != null) {
                return si;
            }
@@ -259,7 +259,7 @@ final class ApplicationPackageManager extends PackageManager {
    public ProviderInfo getProviderInfo(ComponentName className, int flags)
            throws NameNotFoundException {
        try {
            ProviderInfo pi = mPM.getProviderInfo(className, flags, UserId.myUserId());
            ProviderInfo pi = mPM.getProviderInfo(className, flags, UserHandle.myUserId());
            if (pi != null) {
                return pi;
            }
@@ -424,7 +424,7 @@ final class ApplicationPackageManager extends PackageManager {
    @SuppressWarnings("unchecked")
    @Override
    public List<ApplicationInfo> getInstalledApplications(int flags) {
        int userId = UserId.getUserId(Process.myUid());
        int userId = UserHandle.getUserId(Process.myUid());
        try {
            final List<ApplicationInfo> applicationInfos = new ArrayList<ApplicationInfo>();
            ApplicationInfo lastItem = null;
@@ -448,7 +448,7 @@ final class ApplicationPackageManager extends PackageManager {
            return mPM.resolveIntent(
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                    flags, UserId.myUserId());
                    flags, UserHandle.myUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
@@ -462,7 +462,7 @@ final class ApplicationPackageManager extends PackageManager {
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                UserId.myUserId());
                UserHandle.myUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
@@ -494,7 +494,7 @@ final class ApplicationPackageManager extends PackageManager {
        try {
            return mPM.queryIntentActivityOptions(caller, specifics,
                                                  specificTypes, intent, intent.resolveTypeIfNeeded(resolver),
                                                  flags, UserId.myUserId());
                                                  flags, UserHandle.myUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
@@ -507,7 +507,7 @@ final class ApplicationPackageManager extends PackageManager {
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                UserId.myUserId());
                UserHandle.myUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
@@ -520,7 +520,7 @@ final class ApplicationPackageManager extends PackageManager {
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                UserId.myUserId());
                UserHandle.myUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
@@ -533,7 +533,7 @@ final class ApplicationPackageManager extends PackageManager {
                intent,
                intent.resolveTypeIfNeeded(mContext.getContentResolver()),
                flags,
                UserId.myUserId());
                UserHandle.myUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
@@ -543,7 +543,7 @@ final class ApplicationPackageManager extends PackageManager {
    public ProviderInfo resolveContentProvider(String name,
                                               int flags) {
        try {
            return mPM.resolveContentProvider(name, flags, UserId.myUserId());
            return mPM.resolveContentProvider(name, flags, UserHandle.myUserId());
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
@@ -1033,7 +1033,7 @@ final class ApplicationPackageManager extends PackageManager {
    public void clearApplicationUserData(String packageName,
                                         IPackageDataObserver observer) {
        try {
            mPM.clearApplicationUserData(packageName, observer, UserId.myUserId());
            mPM.clearApplicationUserData(packageName, observer, UserHandle.myUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
@@ -1146,7 +1146,7 @@ final class ApplicationPackageManager extends PackageManager {
    public void setComponentEnabledSetting(ComponentName componentName,
                                           int newState, int flags) {
        try {
            mPM.setComponentEnabledSetting(componentName, newState, flags, UserId.myUserId());
            mPM.setComponentEnabledSetting(componentName, newState, flags, UserHandle.myUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
@@ -1155,7 +1155,7 @@ final class ApplicationPackageManager extends PackageManager {
    @Override
    public int getComponentEnabledSetting(ComponentName componentName) {
        try {
            return mPM.getComponentEnabledSetting(componentName, UserId.myUserId());
            return mPM.getComponentEnabledSetting(componentName, UserHandle.myUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
@@ -1166,7 +1166,7 @@ final class ApplicationPackageManager extends PackageManager {
    public void setApplicationEnabledSetting(String packageName,
                                             int newState, int flags) {
        try {
            mPM.setApplicationEnabledSetting(packageName, newState, flags, UserId.myUserId());
            mPM.setApplicationEnabledSetting(packageName, newState, flags, UserHandle.myUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
@@ -1175,7 +1175,7 @@ final class ApplicationPackageManager extends PackageManager {
    @Override
    public int getApplicationEnabledSetting(String packageName) {
        try {
            return mPM.getApplicationEnabledSetting(packageName, UserId.myUserId());
            return mPM.getApplicationEnabledSetting(packageName, UserHandle.myUserId());
        } catch (RemoteException e) {
            // Should never happen!
        }
Loading