Check permissions before creating dynamic shortcuts.
Dynamic shortcuts is initialized before permissions may have been granted so
it needs to check permissions before running queries.
Test
Ran the following:
$ adb shell pm revoke com.android.contacts android.permission.READ_CONTACTS
$ adb shell pm revoke com.android.contacts android.permission.WRITE_CONTACTS
$ adb shell pm revoke com.android.contacts android.permission.GET_ACCOUNTS
$ adb shell pm revoke com.android.contacts android.permission.READ_PHONE_STATE
$ adb shell pm revoke com.android.contacts android.permission.READ_CALL_LOG
$ adb shell pm revoke com.android.contacts android.permission.CALL_PHONE
$ adb shell am instrument -w \
com.google.android.contacts.tests/android.support.test.runner.AndroidJUnitRunner \
-e class com.android.contacts.NoPermissionsLaunchSmokeTest
Bug 30189449
Change-Id: I3e7f865559d142c12f3b026a9d6aa2d7e1a1e5f9
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 65be28a..0c2cda7 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -93,7 +93,7 @@
<service android:name=".PhoneNumberTestService" />
</application>
- <instrumentation android:name="android.test.InstrumentationTestRunner"
+ <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.contacts"
android:label="Contacts app tests">
</instrumentation>