android-permissions

Android M email completition

十年热恋 提交于 2019-12-04 14:11:50
as you know the permission system on Android M has been updated. I currently use the permission GET_ACCOUNTS to autocomplete the user email when he sign in/sign up on my app. final ArrayList<String> emails = new ArrayList<String>(); for (Account account : AccountManager.get(this).getAccounts()) { emails.add(account.name); } email.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, emails)); The problem is that on Android M, to continue to use this feature, I'll need to ask the user for the permission to read his accounts. That doesn't make sense because to save the

Application (WiFi connections) doesn't work anymore on Android 6.0 Marshmallow

落爺英雄遲暮 提交于 2019-12-04 11:22:27
My application stopped working once I upgraded to Marshmallow, it was supposed to be able to change the WiFi connection, but now it doesn't do anything at all. I've spent some time reading about the new permission model of the Android 6.0. Well awesome, but old apps should continue working... Anyway, I started trying to implement the granting of permission, but realized that this is a normal permission and there should be done no permission request for it if it's defined in android manifest: <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> The permission has always been

Android 5.0 - Declaring custom permissions in a module

烂漫一生 提交于 2019-12-04 11:18:29
I have a module in Android Studio that I'm using across several apps (all signed with different keys) that handles GCM notifications. In the GCM Client documentation they say to define package namespaced custom permissions: <permission android:name="com.example.gcm.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" /> and then again with the GCM receiver the category is set to the package name: <receiver android:name=".GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent

Redmi phones not asking SMS permissions and hence not reading sms

ぃ、小莉子 提交于 2019-12-04 11:00:45
Following is my code: <!-- Data SMS Receiver --> <receiver android:name=".otp.OTPReceiver" android:enabled="true" android:exported="true" > <intent-filter> <action android:name="android.intent.action.DATA_SMS_RECEIVED" /> <data android:scheme="sms" /> <data android:port="9027" /> </intent-filter> </receiver> otp.OTPReceiver is the associated BroadcastReceiver This works in all other phones except Redmi devices. In Redmi phones you have to manually switch on autostart & other permissions in the Permissions app (This app handles permissions in Redmi phones). I see Facebook, whatsapp, etc. when

How Do I determine which app is causing the “Screen Overlay Detected” error?

一曲冷凌霜 提交于 2019-12-04 10:35:53
Let me preface this with I have already read through Android "Screen Overlay Detected" message if user is trying to grant a permission when a notification is showing and I understand exactly what the overlay problem is. I also understand how to request it as well as how to check if my current running app has permission to draw on overlays (!Settings.canDrawOverlays(this)). I was getting scolded for my app because every time a permission request would popup, the overlays popup would be shown and even though users gave permission for my application to draw overlays, they could never get past the

What's the difference between ACCESS_NETWORK_STATE and INTERNET?

霸气de小男生 提交于 2019-12-04 09:56:01
问题 What's the difference between ACCESS_NETWORK_STATE and INTERNET? If I use INTERNET, is it necessary to use ACCESS_NETWORK_STATE? In other words, can I use INTERNET without using ACCESS_NETWORK_STATE? 回答1: From the documentation: ACCESS_NETWORK_STATE : Allows applications to access information about networks INTERNET : Allows applications to open network sockets. In short, the INTERNET permission lets you use the internet, whereas ACCESS_NETWORK_STATE will just give you information about the

What is the use case for ContextCompat.checkSelfPermission?

戏子无情 提交于 2019-12-04 09:43:02
Currently I have the following method to check for runtime permission in AppCompatActivity for Marshmallow : if(Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) { boolean hasPermission = checkSelfPermission(Manifest.permission.XX) == PackageManager.PERMISSION_GRANTED; if(!hasPermission) { if(shouldShowRequestPermissionRationale(Manifest.permission.XX)) { // explain reason for permission, try again } else { // user deny with "don't show again" } } } So far I find it works reasonably well for Marshmallow. However, should I be worrying about permission in pre-M versions that I should use

Marshmallow app permission revoke notification? [duplicate]

旧巷老猫 提交于 2019-12-04 09:21:52
This question already has an answer here: Android Marshmallow Callback when user revokes permissions from settings ? 1 answer In Android 6.0 (Marshmallow), users can revoke specific app permissions, even after granting it from inside the app. I know I can check permissions with ContextCompat.checkSelfPermission() . But Is there a way for my app to get notified when the user revokes one of my app's permissions, without repeated checking with ContextCompat.checkSelfPermission() ? Maybe a broadcast/intent or something similar? Thanks in advance for any help. If your app needs a dangerous

Draw Overlay permission for apps installed from Play Store

扶醉桌前 提交于 2019-12-04 06:41:29
Here is a well-known Q/A about draw overlay permission issue. I observed same behavior on my previous apps also, i.e. it was automatically granted when the app is installed from Play Store. In my recent app, however, I observed that that permission is not granted even if it is installed from Play Store. At first, I thought that this might be a specific problem for our test devices. However, I wanted to be sure about it by tracking the number of such lack-of-permission situations in the wild through my favorite analytics tool. We published the version that notifies about this incident yesterday

Allow fine location permission to replace fragment

痴心易碎 提交于 2019-12-04 05:51:08
问题 I want to ask user does he want to grant a permission to accces his fine location and only if he grant it I want to replace a fragment and open the locator fragment. In locator fragments there are some stores that user can see based on his location. If he doesn't allow access to fine location I want to show him proper message. This is the code: else if (id == R.id.nav_locator) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); fragment = new