aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-06-22 15:05:27 -0700
committerSvet Ganov <svetoslavganov@google.com>2015-06-22 15:05:27 -0700
commit43e057c1ae9201eabbcc05a330e85b66d0b16576 (patch)
tree0ff9036f587f5629d5c68cad31d0c4fde8855fd8
parent876a6a921e532b6c1ca653e4c52c1819a75ff3be (diff)
downloadContactsProvider-43e057c1ae9201eabbcc05a330e85b66d0b16576.tar.gz
Remove read/write social stream permissions
Change-Id: Ic51857dd196494168aebb66148a4dfe0533c6924
-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();