Questions tagged [android-permissions]

Permissions in the AndroidManifest.xml that allows an app to perform certain actions that are disallowed by default

3946 questions
16
votes
5 answers

Android M permissions close my app

I check for the required permissions on my Log In screen. The dialog shows asking for the 4 permissions I need. All good, but when the dialog appears, the background becomes black and my app closes (doesn't crash, just closes). When I'm done with…
N. Park
  • 387
  • 4
  • 14
16
votes
1 answer

How to fix Unprotected SMS BroadcastReceiver lint warning

My app needs to be able to receive SMS messages. It all works, but I get this lint warning: BroadcastReceivers that declare an intent-filter for SMS_DELIVER or SMS_RECEIVED must ensure that the caller has the BROADCAST_SMS permission, otherwise…
16
votes
6 answers

Read and Write permission for storage and gallery usage for marshmallow

I am developing an android app in which it is required to provide permission for Read and write external storage. My requirement is to select a picture from gallery and use it in my app. Everything is working fine except Marshmallow devices. I want…
16
votes
3 answers

Android Robolectric unit test for Marshmallow PermissionHelper

I wanna learn Robolectric to use it for unit tests on an Android Marshmallow app. I wrote a PermissionHelper with some methods to make permission handling a bit easier. To get started with unit tests for this class, I am trying to test the most…
16
votes
2 answers

"You cannot change private secure settings" - how to toggle ringtone vibration in Android 6?

Due to recent changes in Android 6 Marshmallow regarding permissions, the following code no longer works and throws an exception. Settings.System.putInt(getContentResolver(), "vibrate_when_ringing", 0); This happens even after granting…
EyesClear
  • 28,077
  • 7
  • 32
  • 43
16
votes
2 answers

Android 5(HTC) EACCES (Permission denied)

app can't create folder/file on android 5(HTC HTC6525LVW os version: 5.0.1) external storage in directory owned by app. Parent folder is returned by [getExternalFilesDirs(String type)][1] method. Sdcard is mounted. Anyone else having this problem…
16
votes
5 answers

Android internet connectivity check problem

I'm new to Android development and working on an Android application that requires the phone to be connected to the internet, through either Wifi, EDGE or 3G. This is the code that I'm using to check whether an internet connection is…
Charles
  • 2,615
  • 3
  • 29
  • 35
16
votes
1 answer

Grant uri permission to uri in EXTRA_STREAM in intent

With FLAG_GRANT_READ_URI_PERMISSION in intent that passed to startActivity, we can grant Uri permission if the uri is set using setData. But if the Uri in put in EXTRA_STREAM, the Uri is not granted before jeallybean. I know we can use…
Bear
  • 5,138
  • 5
  • 50
  • 80
16
votes
2 answers

Security Exception when trying to access a Picasa image on device running 4.2

in my app i let the user select an image from the gallery and had no problems doing this pre 4.2 but now when I select an image that is synced from my google+ account which i guess is a Picasa image I get this error 11-25 20:31:52.508:…
tyczj
  • 71,600
  • 54
  • 194
  • 296
15
votes
5 answers

How to end an incoming call programmatically on Android 8.0 Oreo

Up to Android 7.1 it was possible to end an incoming call by using the ITelephony.endCall() method and giving your app the permissions android.permission.CALL_PHONE and android.permission.READ_PHONE_STATE. When doing the same on Android 8.0 Oreo…
15
votes
1 answer

Android: Find out which third party library is requesting a permission?

One of my projects has multiple third party libraries and one of those libraries is requesting a permission that I don't have defined in my Manifest. How can I find out which of the libraries is requesting the permission? If I perform the…
Jon
  • 7,941
  • 9
  • 53
  • 105
15
votes
3 answers

Android Fatal Error - Can not perform this action after onSaveInstanceState

I'm attempting to perform a fragment transaction after requesting permissions in Android - however the app continually crashes. How might this code be changed in order to avoid this? Any assistance is appreciated. CHECK PERMISSIONS BEFORE SENDING…
15
votes
2 answers

BroadcastReceiver permission for adb shell

Consider a simple tool using a BroadcastReceiver to achieve a simple goal. Because this should not be used by other applications, it defines a permission with a protectionLevel of signature or signatureOrSystem:
tynn
  • 38,113
  • 8
  • 108
  • 143
15
votes
5 answers

java.lang.SecurityException: BLUETOOTH permission crash. (Samsung devices only)

I'm getting the following crash, but this only occurs on some Samsung devices (not all, we develop/test on Samsung devices) Crash log: java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10025 nor current process has…
eric
  • 215
  • 2
  • 12
15
votes
3 answers

Duplicate permission request after orientation change

Because the Android SDK 23 gives users the possibility to deny apps access to certain functionalities I wanted to update one of my apps to request permissions as it is described in here:…