android-permissions

Not all permissions in ACCOUNT permission group granted automatically

て烟熏妆下的殇ゞ 提交于 2019-12-01 06:23:45
In my app, I need the following permissions for creating an account: <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/> <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/> <uses-permission android:name="android.permission.USE_CREDENTIALS"/> It is my understanding that in the M, these should be granted automatically. However, what I'm seeing is that only GET_ACCOUNTS is granted. I've checked this with the following code: @Override protected void onCreate(Bundle savedInstanceState) { super

Activity restart every time when disable permission from setting

限于喜欢 提交于 2019-12-01 06:23:31
I am developing an android app with structure: MainActivity->FragmentA->FragmentB->Fragment C Now in Fragment C, I go to Permission Setting and make access Camera to Deny, then I return an App. I realize that app restarted (transit to Fragment A). May you give me any reason and suggestion to solve it. When you revoke permissions from app settings - Activity restarts and all it's components too. But in onCreate(...) savedInstanceState doesn't equal to null. Thus you can use such hack: if (savedInstanceState != null) { } Using the above hack app resume last fragmentC. This is something normal

Which permissions are required for Flashlight?

眉间皱痕 提交于 2019-12-01 05:30:50
问题 I've used <uses-permission android:name="android.permission.FLASHLIGHT" /> but my app keeps crashing. I'm making a Torch app. Here's my Manifest code: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.Torch"> <uses-permission android:name="android.permission.FLASHLIGHT" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="

Permission denied : opening provider com.google.android.apps.photos.contentprovider.MediaContentProvider that is not exported from uid

纵然是瞬间 提交于 2019-12-01 05:10:17
My app is crashing only in android >= 6.0 (marshmallow) when I try to access a photo URI stored previously in SharedPreferences. Though the image is retrieved for the first time without any error. I am using targetSdkVersion 22 so that I don't need to handle run-time permissions in API >=23. Permissions in my Manifest file <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.READ_SMS" /> <uses

FIleObserver and ContentObserver not working in Android Marshmallow

眉间皱痕 提交于 2019-12-01 03:57:20
I have issue with both FIleObserver and ContentObserver not working in Android Marshmallow. I am using this thing for detecting changes that happening inside a folder. I set run time permissions for marshmallow. But after that also it shows no events. It works perfectly in other versions. Please help me to solve this problem. First I tried Content Resolver inside Service for detect folder changes in background. public class TestService extends Service { @Override public void onCreate() { super.onCreate(); } @Override public int onStartCommand(Intent intent, int flags, int startId) { initial();

Android 6.0 (Marshmallow) READ_CONTACTS permission allows to read Contact's name when permission is denied

怎甘沉沦 提交于 2019-12-01 03:47:16
I want to check how new permission model works so in app's settings I disable Contacts . Then I go to app and try to read Contacts and ... it kinda works: try { Uri result = data.getData(); int contentIdx; cursor = getContentResolver().query(result, null, null, null, null); contentIdx = cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER); if(cursor.moveToFirst()) { content = cursor.getInt(contentIdx); } if(content > 0) { contentIdx = cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME); if(cursor.moveToFirst()) { name = cursor.getString(contentIdx); } contentIdx = cursor

java.lang.SecurityException: Permission Denial: opening provider

荒凉一梦 提交于 2019-12-01 03:40:53
问题 I start image picker intent using: final Intent pickIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); pickIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); startActivityForResult(intent, PICK_IMAGE); and in onActivityResult() I get uris of all picked images and start Jobs which run in background and upload those images (https://github.com/yigit/android-priority-jobqueue). But if I press back button and exit out of activity then any job that was not

Activity restart every time when disable permission from setting

只谈情不闲聊 提交于 2019-12-01 03:21:48
问题 I am developing an android app with structure: MainActivity->FragmentA->FragmentB->Fragment C Now in Fragment C, I go to Permission Setting and make access Camera to Deny, then I return an App. I realize that app restarted (transit to Fragment A). May you give me any reason and suggestion to solve it. 回答1: When you revoke permissions from app settings - Activity restarts and all it's components too. But in onCreate(...) savedInstanceState doesn't equal to null. Thus you can use such hack: if

Android M : Billing and GCM permissions

我怕爱的太早我们不能终老 提交于 2019-12-01 02:40:14
I have an app which use GCM and Billing. In order to make it Android M-ready i'm trying to implement the new permission model . Unfortunately i can't find any informations about GCM and Billing permissions. They don't appear in the normal permission list and are obviously not available with Manifest.permission.* because they are not under android.permission namespace. Nevertheless , we still have to declare them in the manifest <uses-permission android:name="com.android.vending.BILLING"> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"> So how those permissions should

Permission denied : opening provider com.google.android.apps.photos.contentprovider.MediaContentProvider that is not exported from uid

℡╲_俬逩灬. 提交于 2019-12-01 01:56:05
问题 My app is crashing only in android >= 6.0 (marshmallow) when I try to access a photo URI stored previously in SharedPreferences. Though the image is retrieved for the first time without any error. I am using targetSdkVersion 22 so that I don't need to handle run-time permissions in API >=23. Permissions in my Manifest file <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name=