summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-06-23 04:10:09 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-06-23 04:10:09 +0000
commit0371d431e0954ba818f29c63b03bdc4927a09e7c (patch)
tree7b6f9c12cbf4fa7b47780f7c9c05abfc2c350e58
parent9654188540a5a900ba5d80f5f955c46887c3f398 (diff)
parentc8ceb95134cfc2cd67454343c3235dbbf6b97b48 (diff)
downloadpackages_providers_ContactsProvider-0371d431e0954ba818f29c63b03bdc4927a09e7c.tar.gz
packages_providers_ContactsProvider-0371d431e0954ba818f29c63b03bdc4927a09e7c.tar.bz2
packages_providers_ContactsProvider-0371d431e0954ba818f29c63b03bdc4927a09e7c.zip
am c8ceb951: Merge "Remove read/write social stream permissions" into mnc-dev
* commit 'c8ceb95134cfc2cd67454343c3235dbbf6b97b48': Remove read/write social stream permissions
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index 78355898..a7595e40 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -2176,9 +2176,6 @@ public class ContactsProvider2 extends AbstractContactsProvider
public Uri insert(Uri uri, ContentValues values) {
waitForAccess(mWriteAccessLatch);
- // Enforce stream items access check if applicable.
- enforceSocialStreamWritePermission(uri);
-
if (mapsToProfileDbWithInsertedValues(uri, values)) {
switchToProfileMode();
return mProfileProvider.insert(uri, values);
@@ -2191,9 +2188,6 @@ public class ContactsProvider2 extends AbstractContactsProvider
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
waitForAccess(mWriteAccessLatch);
- // Enforce stream items access check if applicable.
- enforceSocialStreamWritePermission(uri);
-
if (mapsToProfileDb(uri)) {
switchToProfileMode();
return mProfileProvider.update(uri, values, selection, selectionArgs);
@@ -2206,9 +2200,6 @@ public class ContactsProvider2 extends AbstractContactsProvider
public int delete(Uri uri, String selection, String[] selectionArgs) {
waitForAccess(mWriteAccessLatch);
- // Enforce stream items access check if applicable.
- enforceSocialStreamWritePermission(uri);
-
if (mapsToProfileDb(uri)) {
switchToProfileMode();
return mProfileProvider.delete(uri, selection, selectionArgs);
@@ -2224,10 +2215,6 @@ public class ContactsProvider2 extends AbstractContactsProvider
if (Authorization.AUTHORIZATION_METHOD.equals(method)) {
Uri uri = extras.getParcelable(Authorization.KEY_URI_TO_AUTHORIZE);
- // Check permissions on the caller. The URI can only be pre-authorized if the caller
- // already has the necessary permissions. And, we can't rely on the ContentResolver to
- // enforce permissions for the ContentProvider#call() method.
- enforceSocialStreamReadPermission(uri);
ContactsPermissions.enforceCallingOrSelfPermission(getContext(), READ_PERMISSION);
// If there hasn't been a security violation yet, we're clear to pre-authorize the URI.
@@ -2985,31 +2972,6 @@ public class ContactsProvider2 extends AbstractContactsProvider
}
/**
- * If the given URI is reading stream items or stream photos, this will run a permission check
- * for the android.permission.READ_SOCIAL_STREAM permission - otherwise it will do nothing.
- * @param uri The URI to check.
- */
- private void enforceSocialStreamReadPermission(Uri uri) {
- if (SOCIAL_STREAM_URIS.contains(sUriMatcher.match(uri))
- && !isValidPreAuthorizedUri(uri)) {
- ContactsPermissions.enforceCallingOrSelfPermission(getContext(),
- "android.permission.READ_SOCIAL_STREAM");
- }
- }
-
- /**
- * If the given URI is modifying stream items or stream photos, this will run a permission check
- * for the android.permission.WRITE_SOCIAL_STREAM permission - otherwise it will do nothing.
- * @param uri The URI to check.
- */
- private void enforceSocialStreamWritePermission(Uri uri) {
- if (SOCIAL_STREAM_URIS.contains(sUriMatcher.match(uri))) {
- ContactsPermissions.enforceCallingOrSelfPermission(getContext(),
- "android.permission.WRITE_SOCIAL_STREAM");
- }
- }
-
- /**
* Queries the database for stream items under the given raw contact. If there are
* more entries than {@link ContactsProvider2#MAX_STREAM_ITEMS_PER_RAW_CONTACT},
* the oldest entries (as determined by timestamp) will be deleted.
@@ -5053,9 +5015,6 @@ public class ContactsProvider2 extends AbstractContactsProvider
waitForAccess(mReadAccessLatch);
- // Enforce stream items access check if applicable.
- enforceSocialStreamReadPermission(uri);
-
// Query the profile DB if appropriate.
if (mapsToProfileDb(uri)) {
switchToProfileMode();