diff options
author | Makoto Onuki <omakoto@google.com> | 2015-05-15 17:39:00 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-15 17:39:00 +0000 |
commit | 2d66b50b00603e1b54da45aa1129e6bc659fd46d (patch) | |
tree | bac8ab7b93afcef303b043f3c5c4e3b389f6971f /tests | |
parent | 64605820a3c27ca1d1bf2499aea8418bb80621d0 (diff) | |
parent | 400e50c1efeb601f6162bd829fdf33e9dc5252f6 (diff) | |
download | packages_providers_ContactsProvider-2d66b50b00603e1b54da45aa1129e6bc659fd46d.zip packages_providers_ContactsProvider-2d66b50b00603e1b54da45aa1129e6bc659fd46d.tar.gz packages_providers_ContactsProvider-2d66b50b00603e1b54da45aa1129e6bc659fd46d.tar.bz2 |
Merge "Clean up permissions" into mnc-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | tests/src/com/android/providers/contacts/ContactsActor.java | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml index 91fceae..e08429a 100644 --- a/tests/AndroidManifest.xml +++ b/tests/AndroidManifest.xml @@ -18,8 +18,6 @@ package="com.android.providers.contacts.tests" android:sharedUserId="android.uid.shared"> - <uses-permission android:name="android.permission.READ_CONTACTS" /> - <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /> diff --git a/tests/src/com/android/providers/contacts/ContactsActor.java b/tests/src/com/android/providers/contacts/ContactsActor.java index bad7d5d..3ff4086 100644 --- a/tests/src/com/android/providers/contacts/ContactsActor.java +++ b/tests/src/com/android/providers/contacts/ContactsActor.java @@ -65,6 +65,7 @@ import android.test.mock.MockContentResolver; import android.test.mock.MockContext; import android.util.Log; +import com.android.providers.contacts.util.ContactsPermissions; import com.android.providers.contacts.util.MockSharedPreferences; import com.google.android.collect.Sets; @@ -263,6 +264,10 @@ public class ContactsActor { */ public ContactsActor(final Context overallContext, String packageName, Class<? extends ContentProvider> providerClass, String authority) throws Exception { + + // Force permission check even when called by self. + ContactsPermissions.ALLOW_SELF_CALL = false; + resolver = new MockContentResolver(); context = new RestrictionMockContext(overallContext, packageName, resolver, mGrantedPermissions, mGrantedUriPermissions); |