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/Android.mk b/tests/Android.mk
index 6b31593..46ab201 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -21,7 +21,9 @@
LOCAL_STATIC_JAVA_LIBRARIES += \
hamcrest-library \
- mockito-target-minus-junit4
+ mockito-target-minus-junit4 \
+ ub-uiautomator
+
LOCAL_AAPT_FLAGS := \
--auto-add-overlay \