Reputation: 13942
I have two apps : App1 and App2
In App1 specified permission like this
<uses-permission android:name="com.commonname.providers.app2.READ_LOGIN_TOKEN" />
In App2 specified peromission like this
<uses-permission android:name="com.commonname.providers.app1.READ_LOGIN_TOKEN" />
I have installed applications in order: first App1 then App2. When I run App1 I received SecurityException, like this:
Writing exception to parcel
java.lang.SecurityException: Permission Denial: reading com.commonname.providers.App1 uri content://com.commonname.providers.app1/logintoken from pid=5550, uid=10919 requires com.commonname.providers.app1.READ_LOGIN_TOKEN, or grantUriPermission() at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:608) at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:483) at android.content.ContentProvider$Transport.query(ContentProvider.java:212) at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112) at android.os.Binder.execTransact(Binder.java:565)
Is exists way to request permissions again, while running application? Or other way to grand access to this permission if application was installed first.
I have read this article https://github.com/commonsguy/cwac-security/blob/master/PERMS.md#android-50-behavior, and known depending from install order, but maybe exists some way.
Upvotes: 1
Views: 99
Reputation: 37
It depens on your SDK version, if it higher than 23 you must request permissions runtime.
Upvotes: -3