Loading api/test-current.txt +1 −4 Original line number Diff line number Diff line Loading @@ -183,10 +183,7 @@ package android.content { } public abstract class Context { method public abstract int getUserId(); } public class ContextWrapper extends android.content.Context { method public android.os.UserHandle getUser(); method public int getUserId(); } Loading core/java/android/accounts/AccountManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ public class AccountManager { */ @NonNull public Account[] getAccountsByType(String type) { return getAccountsByTypeAsUser(type, Process.myUserHandle()); return getAccountsByTypeAsUser(type, mContext.getUser()); } /** @hide Same as {@link #getAccountsByType(String)} but for a specific user. */ Loading Loading @@ -2006,7 +2006,7 @@ public class AccountManager { final AccountManagerCallback<Bundle> callback, final Handler handler) { return confirmCredentialsAsUser(account, options, activity, callback, handler, Process.myUserHandle()); mContext.getUser()); } /** Loading Loading @@ -3208,7 +3208,7 @@ public class AccountManager { return finishSessionAsUser( sessionBundle, activity, Process.myUserHandle(), mContext.getUser(), callback, handler); } Loading core/java/android/app/Activity.java +1 −1 Original line number Diff line number Diff line Loading @@ -5832,7 +5832,7 @@ public class Activity extends ContextThemeWrapper ActivityManager.INTENT_SENDER_ACTIVITY_RESULT, packageName, mParent == null ? mToken : mParent.mToken, mEmbeddedID, requestCode, new Intent[] { data }, null, flags, null, UserHandle.myUserId()); getUserId()); return target != null ? new PendingIntent(target) : null; } catch (RemoteException e) { // Empty Loading core/java/android/app/ActivityManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -1691,7 +1691,7 @@ public class ActivityManager { if (maxNum < 0) { throw new IllegalArgumentException("The requested number of tasks should be >= 0"); } return getService().getRecentTasks(maxNum, flags, UserHandle.myUserId()).getList(); return getService().getRecentTasks(maxNum, flags, mContext.getUserId()).getList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2685,7 +2685,7 @@ public class ActivityManager { public boolean clearApplicationUserData(String packageName, IPackageDataObserver observer) { try { return getService().clearApplicationUserData(packageName, false, observer, UserHandle.myUserId()); observer, mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2724,7 +2724,7 @@ public class ActivityManager { try { @SuppressWarnings("unchecked") final ParceledListSlice<GrantedUriPermission> castedList = getService() .getGrantedUriPermissions(packageName, UserHandle.myUserId()); .getGrantedUriPermissions(packageName, mContext.getUserId()); return castedList; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading @@ -2743,7 +2743,7 @@ public class ActivityManager { public void clearGrantedUriPermissions(String packageName) { try { getService().clearGrantedUriPermissions(packageName, UserHandle.myUserId()); mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3528,7 +3528,7 @@ public class ActivityManager { public void killBackgroundProcesses(String packageName) { try { getService().killBackgroundProcesses(packageName, UserHandle.myUserId()); mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3586,7 +3586,7 @@ public class ActivityManager { @SystemApi @RequiresPermission(Manifest.permission.FORCE_STOP_PACKAGES) public void forceStopPackage(String packageName) { forceStopPackageAsUser(packageName, UserHandle.myUserId()); forceStopPackageAsUser(packageName, mContext.getUserId()); } /** Loading core/java/android/app/AlarmManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ public class AlarmManager { public static final int FLAG_IDLE_UNTIL = 1<<4; private final IAlarmManager mService; private final Context mContext; private final String mPackageName; private final boolean mAlwaysExact; private final int mTargetSdkVersion; Loading Loading @@ -265,6 +266,7 @@ public class AlarmManager { AlarmManager(IAlarmManager service, Context ctx) { mService = service; mContext = ctx; mPackageName = ctx.getPackageName(); mTargetSdkVersion = ctx.getApplicationInfo().targetSdkVersion; mAlwaysExact = (mTargetSdkVersion < Build.VERSION_CODES.KITKAT); Loading Loading @@ -1028,7 +1030,7 @@ public class AlarmManager { * @see #ACTION_NEXT_ALARM_CLOCK_CHANGED */ public AlarmClockInfo getNextAlarmClock() { return getNextAlarmClock(UserHandle.myUserId()); return getNextAlarmClock(mContext.getUserId()); } /** Loading Loading
api/test-current.txt +1 −4 Original line number Diff line number Diff line Loading @@ -183,10 +183,7 @@ package android.content { } public abstract class Context { method public abstract int getUserId(); } public class ContextWrapper extends android.content.Context { method public android.os.UserHandle getUser(); method public int getUserId(); } Loading
core/java/android/accounts/AccountManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ public class AccountManager { */ @NonNull public Account[] getAccountsByType(String type) { return getAccountsByTypeAsUser(type, Process.myUserHandle()); return getAccountsByTypeAsUser(type, mContext.getUser()); } /** @hide Same as {@link #getAccountsByType(String)} but for a specific user. */ Loading Loading @@ -2006,7 +2006,7 @@ public class AccountManager { final AccountManagerCallback<Bundle> callback, final Handler handler) { return confirmCredentialsAsUser(account, options, activity, callback, handler, Process.myUserHandle()); mContext.getUser()); } /** Loading Loading @@ -3208,7 +3208,7 @@ public class AccountManager { return finishSessionAsUser( sessionBundle, activity, Process.myUserHandle(), mContext.getUser(), callback, handler); } Loading
core/java/android/app/Activity.java +1 −1 Original line number Diff line number Diff line Loading @@ -5832,7 +5832,7 @@ public class Activity extends ContextThemeWrapper ActivityManager.INTENT_SENDER_ACTIVITY_RESULT, packageName, mParent == null ? mToken : mParent.mToken, mEmbeddedID, requestCode, new Intent[] { data }, null, flags, null, UserHandle.myUserId()); getUserId()); return target != null ? new PendingIntent(target) : null; } catch (RemoteException e) { // Empty Loading
core/java/android/app/ActivityManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -1691,7 +1691,7 @@ public class ActivityManager { if (maxNum < 0) { throw new IllegalArgumentException("The requested number of tasks should be >= 0"); } return getService().getRecentTasks(maxNum, flags, UserHandle.myUserId()).getList(); return getService().getRecentTasks(maxNum, flags, mContext.getUserId()).getList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2685,7 +2685,7 @@ public class ActivityManager { public boolean clearApplicationUserData(String packageName, IPackageDataObserver observer) { try { return getService().clearApplicationUserData(packageName, false, observer, UserHandle.myUserId()); observer, mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2724,7 +2724,7 @@ public class ActivityManager { try { @SuppressWarnings("unchecked") final ParceledListSlice<GrantedUriPermission> castedList = getService() .getGrantedUriPermissions(packageName, UserHandle.myUserId()); .getGrantedUriPermissions(packageName, mContext.getUserId()); return castedList; } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading @@ -2743,7 +2743,7 @@ public class ActivityManager { public void clearGrantedUriPermissions(String packageName) { try { getService().clearGrantedUriPermissions(packageName, UserHandle.myUserId()); mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3528,7 +3528,7 @@ public class ActivityManager { public void killBackgroundProcesses(String packageName) { try { getService().killBackgroundProcesses(packageName, UserHandle.myUserId()); mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3586,7 +3586,7 @@ public class ActivityManager { @SystemApi @RequiresPermission(Manifest.permission.FORCE_STOP_PACKAGES) public void forceStopPackage(String packageName) { forceStopPackageAsUser(packageName, UserHandle.myUserId()); forceStopPackageAsUser(packageName, mContext.getUserId()); } /** Loading
core/java/android/app/AlarmManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ public class AlarmManager { public static final int FLAG_IDLE_UNTIL = 1<<4; private final IAlarmManager mService; private final Context mContext; private final String mPackageName; private final boolean mAlwaysExact; private final int mTargetSdkVersion; Loading Loading @@ -265,6 +266,7 @@ public class AlarmManager { AlarmManager(IAlarmManager service, Context ctx) { mService = service; mContext = ctx; mPackageName = ctx.getPackageName(); mTargetSdkVersion = ctx.getApplicationInfo().targetSdkVersion; mAlwaysExact = (mTargetSdkVersion < Build.VERSION_CODES.KITKAT); Loading Loading @@ -1028,7 +1030,7 @@ public class AlarmManager { * @see #ACTION_NEXT_ALARM_CLOCK_CHANGED */ public AlarmClockInfo getNextAlarmClock() { return getNextAlarmClock(UserHandle.myUserId()); return getNextAlarmClock(mContext.getUserId()); } /** Loading