diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-09-05 18:11:45 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2013-09-06 08:08:18 -0700 |
commit | 911d7f411f36f2279aae44c89ff1d33a29140046 (patch) | |
tree | 98cdcb6ae4f9720b2096f252c8c0fe1d0726f56a /packages/SettingsProvider/src/com/android/providers | |
parent | a61dc8e03e6e863005b3a4629ca8f3801d33d3c4 (diff) | |
download | frameworks_base-911d7f411f36f2279aae44c89ff1d33a29140046.zip frameworks_base-911d7f411f36f2279aae44c89ff1d33a29140046.tar.gz frameworks_base-911d7f411f36f2279aae44c89ff1d33a29140046.tar.bz2 |
Provide calling package to ContentProviders.
The calling package is important for ContentProviders that want to
grant Uri permissions as a side effect of operations, so offer it
through a new API. Validates the provided package against the
calling UID before returning.
Bug: 10626527
Change-Id: I7277880eebbd48444c024bcf5f69199133cd59e4
Diffstat (limited to 'packages/SettingsProvider/src/com/android/providers')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index a5dab33..bc02b0d 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -567,8 +567,7 @@ public class SettingsProvider extends ContentProvider { * Fast path that avoids the use of chatty remoted Cursors. */ @Override - public Bundle callFromPackage(String callingPackage, String method, String request, - Bundle args) { + public Bundle call(String method, String request, Bundle args) { int callingUser = UserHandle.getCallingUserId(); if (args != null) { int reqUser = args.getInt(Settings.CALL_METHOD_USER_KEY, callingUser); @@ -623,7 +622,7 @@ public class SettingsProvider extends ContentProvider { // Also need to take care of app op. if (getAppOpsManager().noteOp(AppOpsManager.OP_WRITE_SETTINGS, Binder.getCallingUid(), - callingPackage) != AppOpsManager.MODE_ALLOWED) { + getCallingPackage()) != AppOpsManager.MODE_ALLOWED) { return null; } |