diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-06-23 04:01:02 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-23 04:01:06 +0000 |
commit | c8ceb95134cfc2cd67454343c3235dbbf6b97b48 (patch) | |
tree | 441ebb05e360f32e4749725d1eb4fb78476e7a10 /src/com/android/providers/contacts | |
parent | e090212bd2ff31a8f79a11e1e9b0980f7f6079fe (diff) | |
parent | 43e057c1ae9201eabbcc05a330e85b66d0b16576 (diff) | |
download | packages_providers_ContactsProvider-c8ceb95134cfc2cd67454343c3235dbbf6b97b48.zip packages_providers_ContactsProvider-c8ceb95134cfc2cd67454343c3235dbbf6b97b48.tar.gz packages_providers_ContactsProvider-c8ceb95134cfc2cd67454343c3235dbbf6b97b48.tar.bz2 |
Merge "Remove read/write social stream permissions" into mnc-dev
Diffstat (limited to 'src/com/android/providers/contacts')
-rw-r--r-- | src/com/android/providers/contacts/ContactsProvider2.java | 41 |
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 7835589..a7595e4 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(); |