Loading api/current.txt +3 −3 Original line number Original line Diff line number Diff line Loading @@ -18797,7 +18797,7 @@ package android.provider { method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static synchronized java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putInt(android.content.ContentResolver, java.lang.String, int); method public static boolean putInt(android.content.ContentResolver, java.lang.String, int); Loading Loading @@ -18853,7 +18853,7 @@ package android.provider { method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static synchronized java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static final boolean isLocationProviderEnabled(android.content.ContentResolver, java.lang.String); method public static final boolean isLocationProviderEnabled(android.content.ContentResolver, java.lang.String); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); Loading Loading @@ -18936,7 +18936,7 @@ package android.provider { method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static deprecated boolean getShowGTalkServiceStatus(android.content.ContentResolver); method public static deprecated boolean getShowGTalkServiceStatus(android.content.ContentResolver); method public static synchronized java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static boolean putConfiguration(android.content.ContentResolver, android.content.res.Configuration); method public static boolean putConfiguration(android.content.ContentResolver, android.content.res.Configuration); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); core/java/android/provider/Settings.java +47 −77 Original line number Original line Diff line number Diff line Loading @@ -764,10 +764,6 @@ public final class Settings { return true; return true; } } public boolean putString(ContentResolver cr, String name, String value) { return putStringForUser(cr, name, value, UserHandle.myUserId()); } public String getStringForUser(ContentResolver cr, String name, final int userHandle) { public String getStringForUser(ContentResolver cr, String name, final int userHandle) { final boolean isSelf = (userHandle == UserHandle.myUserId()); final boolean isSelf = (userHandle == UserHandle.myUserId()); if (isSelf) { if (isSelf) { Loading Loading @@ -855,10 +851,6 @@ public final class Settings { if (c != null) c.close(); if (c != null) c.close(); } } } } public String getString(ContentResolver cr, String name) { return getStringForUser(cr, name, UserHandle.myUserId()); } } } /** /** Loading @@ -869,8 +861,17 @@ public final class Settings { public static final class System extends NameValueTable { public static final class System extends NameValueTable { public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version"; public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version"; // Populated lazily, guarded by class object: /** private static NameValueCache sNameValueCache = null; * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/system"); private static final NameValueCache sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION, CONTENT_URI, CALL_METHOD_GET_SYSTEM, CALL_METHOD_PUT_SYSTEM); private static final HashSet<String> MOVED_TO_SECURE; private static final HashSet<String> MOVED_TO_SECURE; static { static { Loading Loading @@ -937,28 +938,18 @@ public final class Settings { MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); } } private static void lazyInitCache() { if (sNameValueCache == null) { sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION + '_' + UserHandle.myUserId(), CONTENT_URI, CALL_METHOD_GET_SYSTEM, CALL_METHOD_PUT_SYSTEM); } } /** /** * Look up a name in the database. * Look up a name in the database. * @param resolver to access the database with * @param resolver to access the database with * @param name to look up in the table * @param name to look up in the table * @return the corresponding value, or null if not present * @return the corresponding value, or null if not present */ */ public synchronized static String getString(ContentResolver resolver, String name) { public static String getString(ContentResolver resolver, String name) { return getStringForUser(resolver, name, UserHandle.myUserId()); return getStringForUser(resolver, name, UserHandle.myUserId()); } } /** @hide */ /** @hide */ public synchronized static String getStringForUser(ContentResolver resolver, String name, public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { int userHandle) { if (MOVED_TO_SECURE.contains(name)) { if (MOVED_TO_SECURE.contains(name)) { Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" Loading @@ -970,7 +961,6 @@ public final class Settings { + " to android.provider.Settings.Global, returning read-only value."); + " to android.provider.Settings.Global, returning read-only value."); return Global.getStringForUser(resolver, name, userHandle); return Global.getStringForUser(resolver, name, userHandle); } } lazyInitCache(); return sNameValueCache.getStringForUser(resolver, name, userHandle); return sNameValueCache.getStringForUser(resolver, name, userHandle); } } Loading Loading @@ -998,7 +988,6 @@ public final class Settings { + " to android.provider.Settings.Global, value is unchanged."); + " to android.provider.Settings.Global, value is unchanged."); return false; return false; } } lazyInitCache(); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); } } Loading Loading @@ -1367,12 +1356,6 @@ public final class Settings { putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); } } /** * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/system"); /** /** * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead */ */ Loading Loading @@ -2549,8 +2532,18 @@ public final class Settings { public static final class Secure extends NameValueTable { public static final class Secure extends NameValueTable { public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; /** * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/secure"); // Populated lazily, guarded by class object: // Populated lazily, guarded by class object: private static NameValueCache sNameValueCache = null; private static final NameValueCache sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION, CONTENT_URI, CALL_METHOD_GET_SECURE, CALL_METHOD_PUT_SECURE); private static ILockSettings sLockSettings = null; private static ILockSettings sLockSettings = null; Loading Loading @@ -2654,28 +2647,18 @@ public final class Settings { MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); } } private static void lazyInitCache() { if (sNameValueCache == null) { sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION + '_' + UserHandle.myUserId(), CONTENT_URI, CALL_METHOD_GET_SECURE, CALL_METHOD_PUT_SECURE); } } /** /** * Look up a name in the database. * Look up a name in the database. * @param resolver to access the database with * @param resolver to access the database with * @param name to look up in the table * @param name to look up in the table * @return the corresponding value, or null if not present * @return the corresponding value, or null if not present */ */ public synchronized static String getString(ContentResolver resolver, String name) { public static String getString(ContentResolver resolver, String name) { return getStringForUser(resolver, name, UserHandle.myUserId()); return getStringForUser(resolver, name, UserHandle.myUserId()); } } /** @hide */ /** @hide */ public synchronized static String getStringForUser(ContentResolver resolver, String name, public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { int userHandle) { if (MOVED_TO_GLOBAL.contains(name)) { if (MOVED_TO_GLOBAL.contains(name)) { Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" Loading @@ -2683,21 +2666,23 @@ public final class Settings { return Global.getStringForUser(resolver, name, userHandle); return Global.getStringForUser(resolver, name, userHandle); } } if (MOVED_TO_LOCK_SETTINGS.contains(name)) { synchronized (Secure.class) { if (sLockSettings == null) { if (sLockSettings == null) { sLockSettings = ILockSettings.Stub.asInterface( sLockSettings = ILockSettings.Stub.asInterface( (IBinder) ServiceManager.getService("lock_settings")); (IBinder) ServiceManager.getService("lock_settings")); sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; } } if (sLockSettings != null && !sIsSystemProcess } && MOVED_TO_LOCK_SETTINGS.contains(name)) { if (sLockSettings != null && !sIsSystemProcess) { try { try { return sLockSettings.getString(name, "0", userHandle); return sLockSettings.getString(name, "0", userHandle); } catch (RemoteException re) { } catch (RemoteException re) { // Fall through // Fall through } } } } } lazyInitCache(); return sNameValueCache.getStringForUser(resolver, name, userHandle); return sNameValueCache.getStringForUser(resolver, name, userHandle); } } Loading @@ -2720,7 +2705,6 @@ public final class Settings { + " to android.provider.Settings.Global"); + " to android.provider.Settings.Global"); return Global.putStringForUser(resolver, name, value, userHandle); return Global.putStringForUser(resolver, name, value, userHandle); } } lazyInitCache(); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); } } Loading Loading @@ -3000,12 +2984,6 @@ public final class Settings { return putStringForUser(cr, name, Float.toString(value), userHandle); return putStringForUser(cr, name, Float.toString(value), userHandle); } } /** * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/secure"); /** /** * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} * instead * instead Loading Loading @@ -5765,17 +5743,11 @@ public final class Settings { // Populated lazily, guarded by class object: // Populated lazily, guarded by class object: private static NameValueCache sNameValueCache = null; private static NameValueCache sNameValueCache = new NameValueCache( private static void lazyInitCache() { if (sNameValueCache == null) { sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION, SYS_PROP_SETTING_VERSION, CONTENT_URI, CONTENT_URI, CALL_METHOD_GET_GLOBAL, CALL_METHOD_GET_GLOBAL, CALL_METHOD_PUT_GLOBAL); CALL_METHOD_PUT_GLOBAL); } } /** /** * Look up a name in the database. * Look up a name in the database. Loading @@ -5783,14 +5755,13 @@ public final class Settings { * @param name to look up in the table * @param name to look up in the table * @return the corresponding value, or null if not present * @return the corresponding value, or null if not present */ */ public synchronized static String getString(ContentResolver resolver, String name) { public static String getString(ContentResolver resolver, String name) { return getStringForUser(resolver, name, UserHandle.myUserId()); return getStringForUser(resolver, name, UserHandle.myUserId()); } } /** @hide */ /** @hide */ public synchronized static String getStringForUser(ContentResolver resolver, String name, public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { int userHandle) { lazyInitCache(); return sNameValueCache.getStringForUser(resolver, name, userHandle); return sNameValueCache.getStringForUser(resolver, name, userHandle); } } Loading @@ -5809,7 +5780,6 @@ public final class Settings { /** @hide */ /** @hide */ public static boolean putStringForUser(ContentResolver resolver, public static boolean putStringForUser(ContentResolver resolver, String name, String value, int userHandle) { String name, String value, int userHandle) { lazyInitCache(); if (LOCAL_LOGV) { if (LOCAL_LOGV) { Log.v(TAG, "Global.putString(name=" + name + ", value=" + value Log.v(TAG, "Global.putString(name=" + name + ", value=" + value + " for " + userHandle); + " for " + userHandle); Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +2 −7 Original line number Original line Diff line number Diff line Loading @@ -315,10 +315,10 @@ public class SettingsProvider extends ContentProvider { String property = null, table = uri.getPathSegments().get(0); String property = null, table = uri.getPathSegments().get(0); final boolean isGlobal = table.equals(TABLE_GLOBAL); final boolean isGlobal = table.equals(TABLE_GLOBAL); if (table.equals(TABLE_SYSTEM)) { if (table.equals(TABLE_SYSTEM)) { property = Settings.System.SYS_PROP_SETTING_VERSION + '_' + userHandle; property = Settings.System.SYS_PROP_SETTING_VERSION; backedUpDataChanged = true; backedUpDataChanged = true; } else if (table.equals(TABLE_SECURE)) { } else if (table.equals(TABLE_SECURE)) { property = Settings.Secure.SYS_PROP_SETTING_VERSION + '_' + userHandle; property = Settings.Secure.SYS_PROP_SETTING_VERSION; backedUpDataChanged = true; backedUpDataChanged = true; } else if (isGlobal) { } else if (isGlobal) { property = Settings.Global.SYS_PROP_SETTING_VERSION; // this one is global property = Settings.Global.SYS_PROP_SETTING_VERSION; // this one is global Loading Loading @@ -447,11 +447,6 @@ public class SettingsProvider extends ContentProvider { sSystemCaches.delete(userHandle); sSystemCaches.delete(userHandle); sSecureCaches.delete(userHandle); sSecureCaches.delete(userHandle); sKnownMutationsInFlight.delete(userHandle); sKnownMutationsInFlight.delete(userHandle); String property = Settings.System.SYS_PROP_SETTING_VERSION + '_' + userHandle; SystemProperties.set(property, ""); property = Settings.Secure.SYS_PROP_SETTING_VERSION + '_' + userHandle; SystemProperties.set(property, ""); } } } } Loading services/java/com/android/server/am/ActiveServices.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -706,7 +706,7 @@ public class ActiveServices { if (DEBUG_SERVICE) Slog.v(TAG, "retrieveServiceLocked: " + service if (DEBUG_SERVICE) Slog.v(TAG, "retrieveServiceLocked: " + service + " type=" + resolvedType + " callingUid=" + callingUid); + " type=" + resolvedType + " callingUid=" + callingUid); userId = mAm.handleIncomingUserLocked(callingPid, callingUid, userId, userId = mAm.handleIncomingUser(callingPid, callingUid, userId, false, true, "service", null); false, true, "service", null); if (service.getComponent() != null) { if (service.getComponent() != null) { Loading services/java/com/android/server/am/ActivityManagerService.java +23 −45 Original line number Original line Diff line number Diff line Loading @@ -2450,7 +2450,7 @@ public final class ActivityManagerService extends ActivityManagerNative String resultWho, int requestCode, int startFlags, String resultWho, int requestCode, int startFlags, String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) { String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) { enforceNotIsolatedCaller("startActivity"); enforceNotIsolatedCaller("startActivity"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivity", null); false, true, "startActivity", null); return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, profileFile, profileFd, resultTo, resultWho, requestCode, startFlags, profileFile, profileFd, Loading @@ -2462,7 +2462,7 @@ public final class ActivityManagerService extends ActivityManagerNative String resultWho, int requestCode, int startFlags, String profileFile, String resultWho, int requestCode, int startFlags, String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) { ParcelFileDescriptor profileFd, Bundle options, int userId) { enforceNotIsolatedCaller("startActivityAndWait"); enforceNotIsolatedCaller("startActivityAndWait"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityAndWait", null); false, true, "startActivityAndWait", null); WaitResult res = new WaitResult(); WaitResult res = new WaitResult(); mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, Loading @@ -2476,7 +2476,7 @@ public final class ActivityManagerService extends ActivityManagerNative String resultWho, int requestCode, int startFlags, Configuration config, String resultWho, int requestCode, int startFlags, Configuration config, Bundle options, int userId) { Bundle options, int userId) { enforceNotIsolatedCaller("startActivityWithConfig"); enforceNotIsolatedCaller("startActivityWithConfig"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityWithConfig", null); false, true, "startActivityWithConfig", null); int ret = mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, int ret = mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, resultTo, resultWho, requestCode, startFlags, Loading Loading @@ -2615,7 +2615,7 @@ public final class ActivityManagerService extends ActivityManagerNative Intent intent, String resolvedType, IBinder resultTo, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, Bundle options, int userId) { String resultWho, int requestCode, int startFlags, Bundle options, int userId) { userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityInPackage", null); false, true, "startActivityInPackage", null); int ret = mMainStack.startActivityMayWait(null, uid, intent, resolvedType, int ret = mMainStack.startActivityMayWait(null, uid, intent, resolvedType, Loading @@ -2636,7 +2636,7 @@ public final class ActivityManagerService extends ActivityManagerNative Intent[] intents, String[] resolvedTypes, IBinder resultTo, Intent[] intents, String[] resolvedTypes, IBinder resultTo, Bundle options, int userId) { Bundle options, int userId) { userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityInPackage", null); false, true, "startActivityInPackage", null); int ret = mMainStack.startActivities(null, uid, intents, resolvedTypes, resultTo, int ret = mMainStack.startActivities(null, uid, intents, resolvedTypes, resultTo, options, userId); options, userId); Loading Loading @@ -3462,7 +3462,7 @@ public final class ActivityManagerService extends ActivityManagerNative enforceNotIsolatedCaller("clearApplicationUserData"); enforceNotIsolatedCaller("clearApplicationUserData"); int uid = Binder.getCallingUid(); int uid = Binder.getCallingUid(); int pid = Binder.getCallingPid(); int pid = Binder.getCallingPid(); userId = handleIncomingUserLocked(pid, uid, userId = handleIncomingUser(pid, uid, userId, false, true, "clearApplicationUserData", null); userId, false, true, "clearApplicationUserData", null); long callingId = Binder.clearCallingIdentity(); long callingId = Binder.clearCallingIdentity(); try { try { Loading Loading @@ -3518,7 +3518,7 @@ public final class ActivityManagerService extends ActivityManagerNative throw new SecurityException(msg); throw new SecurityException(msg); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, true, "killBackgroundProcesses", null); userId, true, true, "killBackgroundProcesses", null); long callingId = Binder.clearCallingIdentity(); long callingId = Binder.clearCallingIdentity(); try { try { Loading Loading @@ -3593,7 +3593,7 @@ public final class ActivityManagerService extends ActivityManagerNative Slog.w(TAG, msg); Slog.w(TAG, msg); throw new SecurityException(msg); throw new SecurityException(msg); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, true, "forceStopPackage", null); userId, true, true, "forceStopPackage", null); long callingId = Binder.clearCallingIdentity(); long callingId = Binder.clearCallingIdentity(); try { try { Loading Loading @@ -4598,7 +4598,7 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized(this) { synchronized(this) { int callingUid = Binder.getCallingUid(); int callingUid = Binder.getCallingUid(); int origUserId = userId; int origUserId = userId; userId = handleIncomingUserLocked(Binder.getCallingPid(), callingUid, userId, userId = handleIncomingUser(Binder.getCallingPid(), callingUid, userId, type == ActivityManager.INTENT_SENDER_BROADCAST, true, type == ActivityManager.INTENT_SENDER_BROADCAST, true, "getIntentSender", null); "getIntentSender", null); if (origUserId == UserHandle.USER_CURRENT) { if (origUserId == UserHandle.USER_CURRENT) { Loading Loading @@ -5758,26 +5758,8 @@ public final class ActivityManagerService extends ActivityManagerNative public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, int flags, int userId) { int flags, int userId) { final int callingUid = Binder.getCallingUid(); userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, if (userId != UserHandle.getCallingUserId()) { false, true, "getRecentTasks", null); // Check if the caller is holding permissions for cross-user requests. if (checkComponentPermission( android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, Binder.getCallingPid(), callingUid, -1, true) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: " + "Request to get recent tasks for user " + userId + " but is calling from user " + UserHandle.getUserId(callingUid) + "; this requires " + android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; Slog.w(TAG, msg); throw new SecurityException(msg); } else { if (userId == UserHandle.USER_CURRENT) { userId = mCurrentUserId; } } } synchronized (this) { synchronized (this) { enforceCallingPermission(android.Manifest.permission.GET_TASKS, enforceCallingPermission(android.Manifest.permission.GET_TASKS, Loading Loading @@ -6681,7 +6663,7 @@ public final class ActivityManagerService extends ActivityManagerNative throw new SecurityException(msg); throw new SecurityException(msg); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getContentProvider", null); false, true, "getContentProvider", null); return getContentProviderImpl(caller, name, null, stable, userId); return getContentProviderImpl(caller, name, null, stable, userId); } } Loading @@ -6690,7 +6672,7 @@ public final class ActivityManagerService extends ActivityManagerNative String name, int userId, IBinder token) { String name, int userId, IBinder token) { enforceCallingPermission(android.Manifest.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY, enforceCallingPermission(android.Manifest.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY, "Do not have permission in call getContentProviderExternal()"); "Do not have permission in call getContentProviderExternal()"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getContentProvider", null); false, true, "getContentProvider", null); return getContentProviderExternalUnchecked(name, token, userId); return getContentProviderExternalUnchecked(name, token, userId); } } Loading Loading @@ -6955,7 +6937,7 @@ public final class ActivityManagerService extends ActivityManagerNative */ */ public String getProviderMimeType(Uri uri, int userId) { public String getProviderMimeType(Uri uri, int userId) { enforceNotIsolatedCaller("getProviderMimeType"); enforceNotIsolatedCaller("getProviderMimeType"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getProviderMimeType", null); userId, false, true, "getProviderMimeType", null); final String name = uri.getAuthority(); final String name = uri.getAuthority(); final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); Loading Loading @@ -10928,14 +10910,6 @@ public final class ActivityManagerService extends ActivityManagerNative public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, boolean requireFull, String name, String callerPackage) { boolean requireFull, String name, String callerPackage) { synchronized(this) { return handleIncomingUserLocked(callingPid, callingUid, userId, allowAll, requireFull, name, callerPackage); } } int handleIncomingUserLocked(int callingPid, int callingUid, int userId, boolean allowAll, boolean requireFull, String name, String callerPackage) { final int callingUserId = UserHandle.getUserId(callingUid); final int callingUserId = UserHandle.getUserId(callingUid); if (callingUserId != userId) { if (callingUserId != userId) { if (callingUid != 0 && callingUid != Process.SYSTEM_UID) { if (callingUid != 0 && callingUid != Process.SYSTEM_UID) { Loading Loading @@ -10976,6 +10950,10 @@ public final class ActivityManagerService extends ActivityManagerNative } } if (userId == UserHandle.USER_CURRENT if (userId == UserHandle.USER_CURRENT || userId == UserHandle.USER_CURRENT_OR_SELF) { || userId == UserHandle.USER_CURRENT_OR_SELF) { // Note that we may be accessing this outside of a lock... // shouldn't be a big deal, if this is being called outside // of a locked context there is intrinsically a race with // the value the caller will receive and someone else changing it. userId = mCurrentUserId; userId = mCurrentUserId; } } if (!allowAll && userId < 0) { if (!allowAll && userId < 0) { Loading Loading @@ -11282,7 +11260,7 @@ public final class ActivityManagerService extends ActivityManagerNative callingPid = Binder.getCallingPid(); callingPid = Binder.getCallingPid(); } } userId = this.handleIncomingUserLocked(callingPid, callingUid, userId, userId = this.handleIncomingUser(callingPid, callingUid, userId, true, true, "registerReceiver", callerPackage); true, true, "registerReceiver", callerPackage); List allSticky = null; List allSticky = null; Loading Loading @@ -11517,7 +11495,7 @@ public final class ActivityManagerService extends ActivityManagerNative Slog.w(TAG, "Broadcast " + intent + " not ordered but result callback requested!"); Slog.w(TAG, "Broadcast " + intent + " not ordered but result callback requested!"); } } userId = handleIncomingUserLocked(callingPid, callingUid, userId, userId = handleIncomingUser(callingPid, callingUid, userId, true, false, "broadcast", callerPackage); true, false, "broadcast", callerPackage); // Make sure that the user who is receiving this broadcast is started. // Make sure that the user who is receiving this broadcast is started. Loading Loading @@ -11930,7 +11908,7 @@ public final class ActivityManagerService extends ActivityManagerNative throw new IllegalArgumentException("File descriptors passed in Intent"); throw new IllegalArgumentException("File descriptors passed in Intent"); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, false, "removeStickyBroadcast", null); Binder.getCallingUid(), userId, true, false, "removeStickyBroadcast", null); synchronized(this) { synchronized(this) { Loading Loading @@ -12018,7 +11996,7 @@ public final class ActivityManagerService extends ActivityManagerNative String profileFile, int flags, Bundle arguments, String profileFile, int flags, Bundle arguments, IInstrumentationWatcher watcher, int userId) { IInstrumentationWatcher watcher, int userId) { enforceNotIsolatedCaller("startInstrumentation"); enforceNotIsolatedCaller("startInstrumentation"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startInstrumentation", null); userId, false, true, "startInstrumentation", null); // Refuse possible leaked file descriptors // Refuse possible leaked file descriptors if (arguments != null && arguments.hasFileDescriptors()) { if (arguments != null && arguments.hasFileDescriptors()) { Loading Loading @@ -13864,7 +13842,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } private ProcessRecord findProcessLocked(String process, int userId, String callName) { private ProcessRecord findProcessLocked(String process, int userId, String callName) { userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, true, callName, null); userId, true, true, callName, null); ProcessRecord proc = null; ProcessRecord proc = null; try { try { Loading
api/current.txt +3 −3 Original line number Original line Diff line number Diff line Loading @@ -18797,7 +18797,7 @@ package android.provider { method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static synchronized java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putInt(android.content.ContentResolver, java.lang.String, int); method public static boolean putInt(android.content.ContentResolver, java.lang.String, int); Loading Loading @@ -18853,7 +18853,7 @@ package android.provider { method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static int getInt(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static synchronized java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static final boolean isLocationProviderEnabled(android.content.ContentResolver, java.lang.String); method public static final boolean isLocationProviderEnabled(android.content.ContentResolver, java.lang.String); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); Loading Loading @@ -18936,7 +18936,7 @@ package android.provider { method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String, long); method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static long getLong(android.content.ContentResolver, java.lang.String) throws android.provider.Settings.SettingNotFoundException; method public static deprecated boolean getShowGTalkServiceStatus(android.content.ContentResolver); method public static deprecated boolean getShowGTalkServiceStatus(android.content.ContentResolver); method public static synchronized java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static java.lang.String getString(android.content.ContentResolver, java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static android.net.Uri getUriFor(java.lang.String); method public static boolean putConfiguration(android.content.ContentResolver, android.content.res.Configuration); method public static boolean putConfiguration(android.content.ContentResolver, android.content.res.Configuration); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float); method public static boolean putFloat(android.content.ContentResolver, java.lang.String, float);
core/java/android/provider/Settings.java +47 −77 Original line number Original line Diff line number Diff line Loading @@ -764,10 +764,6 @@ public final class Settings { return true; return true; } } public boolean putString(ContentResolver cr, String name, String value) { return putStringForUser(cr, name, value, UserHandle.myUserId()); } public String getStringForUser(ContentResolver cr, String name, final int userHandle) { public String getStringForUser(ContentResolver cr, String name, final int userHandle) { final boolean isSelf = (userHandle == UserHandle.myUserId()); final boolean isSelf = (userHandle == UserHandle.myUserId()); if (isSelf) { if (isSelf) { Loading Loading @@ -855,10 +851,6 @@ public final class Settings { if (c != null) c.close(); if (c != null) c.close(); } } } } public String getString(ContentResolver cr, String name) { return getStringForUser(cr, name, UserHandle.myUserId()); } } } /** /** Loading @@ -869,8 +861,17 @@ public final class Settings { public static final class System extends NameValueTable { public static final class System extends NameValueTable { public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version"; public static final String SYS_PROP_SETTING_VERSION = "sys.settings_system_version"; // Populated lazily, guarded by class object: /** private static NameValueCache sNameValueCache = null; * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/system"); private static final NameValueCache sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION, CONTENT_URI, CALL_METHOD_GET_SYSTEM, CALL_METHOD_PUT_SYSTEM); private static final HashSet<String> MOVED_TO_SECURE; private static final HashSet<String> MOVED_TO_SECURE; static { static { Loading Loading @@ -937,28 +938,18 @@ public final class Settings { MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER); } } private static void lazyInitCache() { if (sNameValueCache == null) { sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION + '_' + UserHandle.myUserId(), CONTENT_URI, CALL_METHOD_GET_SYSTEM, CALL_METHOD_PUT_SYSTEM); } } /** /** * Look up a name in the database. * Look up a name in the database. * @param resolver to access the database with * @param resolver to access the database with * @param name to look up in the table * @param name to look up in the table * @return the corresponding value, or null if not present * @return the corresponding value, or null if not present */ */ public synchronized static String getString(ContentResolver resolver, String name) { public static String getString(ContentResolver resolver, String name) { return getStringForUser(resolver, name, UserHandle.myUserId()); return getStringForUser(resolver, name, UserHandle.myUserId()); } } /** @hide */ /** @hide */ public synchronized static String getStringForUser(ContentResolver resolver, String name, public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { int userHandle) { if (MOVED_TO_SECURE.contains(name)) { if (MOVED_TO_SECURE.contains(name)) { Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" Loading @@ -970,7 +961,6 @@ public final class Settings { + " to android.provider.Settings.Global, returning read-only value."); + " to android.provider.Settings.Global, returning read-only value."); return Global.getStringForUser(resolver, name, userHandle); return Global.getStringForUser(resolver, name, userHandle); } } lazyInitCache(); return sNameValueCache.getStringForUser(resolver, name, userHandle); return sNameValueCache.getStringForUser(resolver, name, userHandle); } } Loading Loading @@ -998,7 +988,6 @@ public final class Settings { + " to android.provider.Settings.Global, value is unchanged."); + " to android.provider.Settings.Global, value is unchanged."); return false; return false; } } lazyInitCache(); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); } } Loading Loading @@ -1367,12 +1356,6 @@ public final class Settings { putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); putIntForUser(cr, SHOW_GTALK_SERVICE_STATUS, flag ? 1 : 0, userHandle); } } /** * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/system"); /** /** * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead * @deprecated Use {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} instead */ */ Loading Loading @@ -2549,8 +2532,18 @@ public final class Settings { public static final class Secure extends NameValueTable { public static final class Secure extends NameValueTable { public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; public static final String SYS_PROP_SETTING_VERSION = "sys.settings_secure_version"; /** * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/secure"); // Populated lazily, guarded by class object: // Populated lazily, guarded by class object: private static NameValueCache sNameValueCache = null; private static final NameValueCache sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION, CONTENT_URI, CALL_METHOD_GET_SECURE, CALL_METHOD_PUT_SECURE); private static ILockSettings sLockSettings = null; private static ILockSettings sLockSettings = null; Loading Loading @@ -2654,28 +2647,18 @@ public final class Settings { MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); MOVED_TO_GLOBAL.add(Settings.Global.WTF_IS_FATAL); } } private static void lazyInitCache() { if (sNameValueCache == null) { sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION + '_' + UserHandle.myUserId(), CONTENT_URI, CALL_METHOD_GET_SECURE, CALL_METHOD_PUT_SECURE); } } /** /** * Look up a name in the database. * Look up a name in the database. * @param resolver to access the database with * @param resolver to access the database with * @param name to look up in the table * @param name to look up in the table * @return the corresponding value, or null if not present * @return the corresponding value, or null if not present */ */ public synchronized static String getString(ContentResolver resolver, String name) { public static String getString(ContentResolver resolver, String name) { return getStringForUser(resolver, name, UserHandle.myUserId()); return getStringForUser(resolver, name, UserHandle.myUserId()); } } /** @hide */ /** @hide */ public synchronized static String getStringForUser(ContentResolver resolver, String name, public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { int userHandle) { if (MOVED_TO_GLOBAL.contains(name)) { if (MOVED_TO_GLOBAL.contains(name)) { Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.Secure" Loading @@ -2683,21 +2666,23 @@ public final class Settings { return Global.getStringForUser(resolver, name, userHandle); return Global.getStringForUser(resolver, name, userHandle); } } if (MOVED_TO_LOCK_SETTINGS.contains(name)) { synchronized (Secure.class) { if (sLockSettings == null) { if (sLockSettings == null) { sLockSettings = ILockSettings.Stub.asInterface( sLockSettings = ILockSettings.Stub.asInterface( (IBinder) ServiceManager.getService("lock_settings")); (IBinder) ServiceManager.getService("lock_settings")); sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; sIsSystemProcess = Process.myUid() == Process.SYSTEM_UID; } } if (sLockSettings != null && !sIsSystemProcess } && MOVED_TO_LOCK_SETTINGS.contains(name)) { if (sLockSettings != null && !sIsSystemProcess) { try { try { return sLockSettings.getString(name, "0", userHandle); return sLockSettings.getString(name, "0", userHandle); } catch (RemoteException re) { } catch (RemoteException re) { // Fall through // Fall through } } } } } lazyInitCache(); return sNameValueCache.getStringForUser(resolver, name, userHandle); return sNameValueCache.getStringForUser(resolver, name, userHandle); } } Loading @@ -2720,7 +2705,6 @@ public final class Settings { + " to android.provider.Settings.Global"); + " to android.provider.Settings.Global"); return Global.putStringForUser(resolver, name, value, userHandle); return Global.putStringForUser(resolver, name, value, userHandle); } } lazyInitCache(); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); return sNameValueCache.putStringForUser(resolver, name, value, userHandle); } } Loading Loading @@ -3000,12 +2984,6 @@ public final class Settings { return putStringForUser(cr, name, Float.toString(value), userHandle); return putStringForUser(cr, name, Float.toString(value), userHandle); } } /** * The content:// style URL for this table */ public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/secure"); /** /** * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} * @deprecated Use {@link android.provider.Settings.Global#DEVELOPMENT_SETTINGS_ENABLED} * instead * instead Loading Loading @@ -5765,17 +5743,11 @@ public final class Settings { // Populated lazily, guarded by class object: // Populated lazily, guarded by class object: private static NameValueCache sNameValueCache = null; private static NameValueCache sNameValueCache = new NameValueCache( private static void lazyInitCache() { if (sNameValueCache == null) { sNameValueCache = new NameValueCache( SYS_PROP_SETTING_VERSION, SYS_PROP_SETTING_VERSION, CONTENT_URI, CONTENT_URI, CALL_METHOD_GET_GLOBAL, CALL_METHOD_GET_GLOBAL, CALL_METHOD_PUT_GLOBAL); CALL_METHOD_PUT_GLOBAL); } } /** /** * Look up a name in the database. * Look up a name in the database. Loading @@ -5783,14 +5755,13 @@ public final class Settings { * @param name to look up in the table * @param name to look up in the table * @return the corresponding value, or null if not present * @return the corresponding value, or null if not present */ */ public synchronized static String getString(ContentResolver resolver, String name) { public static String getString(ContentResolver resolver, String name) { return getStringForUser(resolver, name, UserHandle.myUserId()); return getStringForUser(resolver, name, UserHandle.myUserId()); } } /** @hide */ /** @hide */ public synchronized static String getStringForUser(ContentResolver resolver, String name, public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { int userHandle) { lazyInitCache(); return sNameValueCache.getStringForUser(resolver, name, userHandle); return sNameValueCache.getStringForUser(resolver, name, userHandle); } } Loading @@ -5809,7 +5780,6 @@ public final class Settings { /** @hide */ /** @hide */ public static boolean putStringForUser(ContentResolver resolver, public static boolean putStringForUser(ContentResolver resolver, String name, String value, int userHandle) { String name, String value, int userHandle) { lazyInitCache(); if (LOCAL_LOGV) { if (LOCAL_LOGV) { Log.v(TAG, "Global.putString(name=" + name + ", value=" + value Log.v(TAG, "Global.putString(name=" + name + ", value=" + value + " for " + userHandle); + " for " + userHandle); Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +2 −7 Original line number Original line Diff line number Diff line Loading @@ -315,10 +315,10 @@ public class SettingsProvider extends ContentProvider { String property = null, table = uri.getPathSegments().get(0); String property = null, table = uri.getPathSegments().get(0); final boolean isGlobal = table.equals(TABLE_GLOBAL); final boolean isGlobal = table.equals(TABLE_GLOBAL); if (table.equals(TABLE_SYSTEM)) { if (table.equals(TABLE_SYSTEM)) { property = Settings.System.SYS_PROP_SETTING_VERSION + '_' + userHandle; property = Settings.System.SYS_PROP_SETTING_VERSION; backedUpDataChanged = true; backedUpDataChanged = true; } else if (table.equals(TABLE_SECURE)) { } else if (table.equals(TABLE_SECURE)) { property = Settings.Secure.SYS_PROP_SETTING_VERSION + '_' + userHandle; property = Settings.Secure.SYS_PROP_SETTING_VERSION; backedUpDataChanged = true; backedUpDataChanged = true; } else if (isGlobal) { } else if (isGlobal) { property = Settings.Global.SYS_PROP_SETTING_VERSION; // this one is global property = Settings.Global.SYS_PROP_SETTING_VERSION; // this one is global Loading Loading @@ -447,11 +447,6 @@ public class SettingsProvider extends ContentProvider { sSystemCaches.delete(userHandle); sSystemCaches.delete(userHandle); sSecureCaches.delete(userHandle); sSecureCaches.delete(userHandle); sKnownMutationsInFlight.delete(userHandle); sKnownMutationsInFlight.delete(userHandle); String property = Settings.System.SYS_PROP_SETTING_VERSION + '_' + userHandle; SystemProperties.set(property, ""); property = Settings.Secure.SYS_PROP_SETTING_VERSION + '_' + userHandle; SystemProperties.set(property, ""); } } } } Loading
services/java/com/android/server/am/ActiveServices.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -706,7 +706,7 @@ public class ActiveServices { if (DEBUG_SERVICE) Slog.v(TAG, "retrieveServiceLocked: " + service if (DEBUG_SERVICE) Slog.v(TAG, "retrieveServiceLocked: " + service + " type=" + resolvedType + " callingUid=" + callingUid); + " type=" + resolvedType + " callingUid=" + callingUid); userId = mAm.handleIncomingUserLocked(callingPid, callingUid, userId, userId = mAm.handleIncomingUser(callingPid, callingUid, userId, false, true, "service", null); false, true, "service", null); if (service.getComponent() != null) { if (service.getComponent() != null) { Loading
services/java/com/android/server/am/ActivityManagerService.java +23 −45 Original line number Original line Diff line number Diff line Loading @@ -2450,7 +2450,7 @@ public final class ActivityManagerService extends ActivityManagerNative String resultWho, int requestCode, int startFlags, String resultWho, int requestCode, int startFlags, String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) { String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) { enforceNotIsolatedCaller("startActivity"); enforceNotIsolatedCaller("startActivity"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivity", null); false, true, "startActivity", null); return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, profileFile, profileFd, resultTo, resultWho, requestCode, startFlags, profileFile, profileFd, Loading @@ -2462,7 +2462,7 @@ public final class ActivityManagerService extends ActivityManagerNative String resultWho, int requestCode, int startFlags, String profileFile, String resultWho, int requestCode, int startFlags, String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) { ParcelFileDescriptor profileFd, Bundle options, int userId) { enforceNotIsolatedCaller("startActivityAndWait"); enforceNotIsolatedCaller("startActivityAndWait"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityAndWait", null); false, true, "startActivityAndWait", null); WaitResult res = new WaitResult(); WaitResult res = new WaitResult(); mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, Loading @@ -2476,7 +2476,7 @@ public final class ActivityManagerService extends ActivityManagerNative String resultWho, int requestCode, int startFlags, Configuration config, String resultWho, int requestCode, int startFlags, Configuration config, Bundle options, int userId) { Bundle options, int userId) { enforceNotIsolatedCaller("startActivityWithConfig"); enforceNotIsolatedCaller("startActivityWithConfig"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityWithConfig", null); false, true, "startActivityWithConfig", null); int ret = mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, int ret = mMainStack.startActivityMayWait(caller, -1, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, resultTo, resultWho, requestCode, startFlags, Loading Loading @@ -2615,7 +2615,7 @@ public final class ActivityManagerService extends ActivityManagerNative Intent intent, String resolvedType, IBinder resultTo, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, Bundle options, int userId) { String resultWho, int requestCode, int startFlags, Bundle options, int userId) { userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityInPackage", null); false, true, "startActivityInPackage", null); int ret = mMainStack.startActivityMayWait(null, uid, intent, resolvedType, int ret = mMainStack.startActivityMayWait(null, uid, intent, resolvedType, Loading @@ -2636,7 +2636,7 @@ public final class ActivityManagerService extends ActivityManagerNative Intent[] intents, String[] resolvedTypes, IBinder resultTo, Intent[] intents, String[] resolvedTypes, IBinder resultTo, Bundle options, int userId) { Bundle options, int userId) { userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startActivityInPackage", null); false, true, "startActivityInPackage", null); int ret = mMainStack.startActivities(null, uid, intents, resolvedTypes, resultTo, int ret = mMainStack.startActivities(null, uid, intents, resolvedTypes, resultTo, options, userId); options, userId); Loading Loading @@ -3462,7 +3462,7 @@ public final class ActivityManagerService extends ActivityManagerNative enforceNotIsolatedCaller("clearApplicationUserData"); enforceNotIsolatedCaller("clearApplicationUserData"); int uid = Binder.getCallingUid(); int uid = Binder.getCallingUid(); int pid = Binder.getCallingPid(); int pid = Binder.getCallingPid(); userId = handleIncomingUserLocked(pid, uid, userId = handleIncomingUser(pid, uid, userId, false, true, "clearApplicationUserData", null); userId, false, true, "clearApplicationUserData", null); long callingId = Binder.clearCallingIdentity(); long callingId = Binder.clearCallingIdentity(); try { try { Loading Loading @@ -3518,7 +3518,7 @@ public final class ActivityManagerService extends ActivityManagerNative throw new SecurityException(msg); throw new SecurityException(msg); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, true, "killBackgroundProcesses", null); userId, true, true, "killBackgroundProcesses", null); long callingId = Binder.clearCallingIdentity(); long callingId = Binder.clearCallingIdentity(); try { try { Loading Loading @@ -3593,7 +3593,7 @@ public final class ActivityManagerService extends ActivityManagerNative Slog.w(TAG, msg); Slog.w(TAG, msg); throw new SecurityException(msg); throw new SecurityException(msg); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, true, "forceStopPackage", null); userId, true, true, "forceStopPackage", null); long callingId = Binder.clearCallingIdentity(); long callingId = Binder.clearCallingIdentity(); try { try { Loading Loading @@ -4598,7 +4598,7 @@ public final class ActivityManagerService extends ActivityManagerNative synchronized(this) { synchronized(this) { int callingUid = Binder.getCallingUid(); int callingUid = Binder.getCallingUid(); int origUserId = userId; int origUserId = userId; userId = handleIncomingUserLocked(Binder.getCallingPid(), callingUid, userId, userId = handleIncomingUser(Binder.getCallingPid(), callingUid, userId, type == ActivityManager.INTENT_SENDER_BROADCAST, true, type == ActivityManager.INTENT_SENDER_BROADCAST, true, "getIntentSender", null); "getIntentSender", null); if (origUserId == UserHandle.USER_CURRENT) { if (origUserId == UserHandle.USER_CURRENT) { Loading Loading @@ -5758,26 +5758,8 @@ public final class ActivityManagerService extends ActivityManagerNative public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, int flags, int userId) { int flags, int userId) { final int callingUid = Binder.getCallingUid(); userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, if (userId != UserHandle.getCallingUserId()) { false, true, "getRecentTasks", null); // Check if the caller is holding permissions for cross-user requests. if (checkComponentPermission( android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, Binder.getCallingPid(), callingUid, -1, true) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: " + "Request to get recent tasks for user " + userId + " but is calling from user " + UserHandle.getUserId(callingUid) + "; this requires " + android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; Slog.w(TAG, msg); throw new SecurityException(msg); } else { if (userId == UserHandle.USER_CURRENT) { userId = mCurrentUserId; } } } synchronized (this) { synchronized (this) { enforceCallingPermission(android.Manifest.permission.GET_TASKS, enforceCallingPermission(android.Manifest.permission.GET_TASKS, Loading Loading @@ -6681,7 +6663,7 @@ public final class ActivityManagerService extends ActivityManagerNative throw new SecurityException(msg); throw new SecurityException(msg); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getContentProvider", null); false, true, "getContentProvider", null); return getContentProviderImpl(caller, name, null, stable, userId); return getContentProviderImpl(caller, name, null, stable, userId); } } Loading @@ -6690,7 +6672,7 @@ public final class ActivityManagerService extends ActivityManagerNative String name, int userId, IBinder token) { String name, int userId, IBinder token) { enforceCallingPermission(android.Manifest.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY, enforceCallingPermission(android.Manifest.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY, "Do not have permission in call getContentProviderExternal()"); "Do not have permission in call getContentProviderExternal()"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId, userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getContentProvider", null); false, true, "getContentProvider", null); return getContentProviderExternalUnchecked(name, token, userId); return getContentProviderExternalUnchecked(name, token, userId); } } Loading Loading @@ -6955,7 +6937,7 @@ public final class ActivityManagerService extends ActivityManagerNative */ */ public String getProviderMimeType(Uri uri, int userId) { public String getProviderMimeType(Uri uri, int userId) { enforceNotIsolatedCaller("getProviderMimeType"); enforceNotIsolatedCaller("getProviderMimeType"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "getProviderMimeType", null); userId, false, true, "getProviderMimeType", null); final String name = uri.getAuthority(); final String name = uri.getAuthority(); final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); Loading Loading @@ -10928,14 +10910,6 @@ public final class ActivityManagerService extends ActivityManagerNative public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, boolean requireFull, String name, String callerPackage) { boolean requireFull, String name, String callerPackage) { synchronized(this) { return handleIncomingUserLocked(callingPid, callingUid, userId, allowAll, requireFull, name, callerPackage); } } int handleIncomingUserLocked(int callingPid, int callingUid, int userId, boolean allowAll, boolean requireFull, String name, String callerPackage) { final int callingUserId = UserHandle.getUserId(callingUid); final int callingUserId = UserHandle.getUserId(callingUid); if (callingUserId != userId) { if (callingUserId != userId) { if (callingUid != 0 && callingUid != Process.SYSTEM_UID) { if (callingUid != 0 && callingUid != Process.SYSTEM_UID) { Loading Loading @@ -10976,6 +10950,10 @@ public final class ActivityManagerService extends ActivityManagerNative } } if (userId == UserHandle.USER_CURRENT if (userId == UserHandle.USER_CURRENT || userId == UserHandle.USER_CURRENT_OR_SELF) { || userId == UserHandle.USER_CURRENT_OR_SELF) { // Note that we may be accessing this outside of a lock... // shouldn't be a big deal, if this is being called outside // of a locked context there is intrinsically a race with // the value the caller will receive and someone else changing it. userId = mCurrentUserId; userId = mCurrentUserId; } } if (!allowAll && userId < 0) { if (!allowAll && userId < 0) { Loading Loading @@ -11282,7 +11260,7 @@ public final class ActivityManagerService extends ActivityManagerNative callingPid = Binder.getCallingPid(); callingPid = Binder.getCallingPid(); } } userId = this.handleIncomingUserLocked(callingPid, callingUid, userId, userId = this.handleIncomingUser(callingPid, callingUid, userId, true, true, "registerReceiver", callerPackage); true, true, "registerReceiver", callerPackage); List allSticky = null; List allSticky = null; Loading Loading @@ -11517,7 +11495,7 @@ public final class ActivityManagerService extends ActivityManagerNative Slog.w(TAG, "Broadcast " + intent + " not ordered but result callback requested!"); Slog.w(TAG, "Broadcast " + intent + " not ordered but result callback requested!"); } } userId = handleIncomingUserLocked(callingPid, callingUid, userId, userId = handleIncomingUser(callingPid, callingUid, userId, true, false, "broadcast", callerPackage); true, false, "broadcast", callerPackage); // Make sure that the user who is receiving this broadcast is started. // Make sure that the user who is receiving this broadcast is started. Loading Loading @@ -11930,7 +11908,7 @@ public final class ActivityManagerService extends ActivityManagerNative throw new IllegalArgumentException("File descriptors passed in Intent"); throw new IllegalArgumentException("File descriptors passed in Intent"); } } userId = handleIncomingUserLocked(Binder.getCallingPid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, false, "removeStickyBroadcast", null); Binder.getCallingUid(), userId, true, false, "removeStickyBroadcast", null); synchronized(this) { synchronized(this) { Loading Loading @@ -12018,7 +11996,7 @@ public final class ActivityManagerService extends ActivityManagerNative String profileFile, int flags, Bundle arguments, String profileFile, int flags, Bundle arguments, IInstrumentationWatcher watcher, int userId) { IInstrumentationWatcher watcher, int userId) { enforceNotIsolatedCaller("startInstrumentation"); enforceNotIsolatedCaller("startInstrumentation"); userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, true, "startInstrumentation", null); userId, false, true, "startInstrumentation", null); // Refuse possible leaked file descriptors // Refuse possible leaked file descriptors if (arguments != null && arguments.hasFileDescriptors()) { if (arguments != null && arguments.hasFileDescriptors()) { Loading Loading @@ -13864,7 +13842,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } private ProcessRecord findProcessLocked(String process, int userId, String callName) { private ProcessRecord findProcessLocked(String process, int userId, String callName) { userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, true, callName, null); userId, true, true, callName, null); ProcessRecord proc = null; ProcessRecord proc = null; try { try {