android requesting permission I'm not asking for - android

In my android manifest I never request for the permission to allow my app to record audio however when I run my app on a Galaxy s7, there is a pop up asking for such permission.
The weird thing is this only happens when I run on an s7, if I run my app on an s6 it does not request permission to record audio.
Would anyone know why it is requesting permission to record audio when I never included it in my android manifest and why its only happening on an s7 and not an s6.
Thanks

Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. This approach streamlines the app install process, since the user does not need to grant permissions when they install or update the app. It also gives the user more control over the app's functionality; for example, a user could choose to give a camera app access to the camera but not to the device location. The user can revoke the permissions at any time, by going to the app's Settings screen
Requesting Permissions at Run Time
The weird thing is this only happens when I run on an s7, if I run my app on an s6 it does not request permission to record audio.
Basically this happens because your s7 device may have lollipop or higher android version . and s6 has lower API level (<23);

Thanks to CommonsWare in the comments for posting that link, helped me solve the problem.
Basically what I did was add
uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"
to my manifest file and it stopped asking for permission.

Related

Enable all notifications permissions in Android

At least in my two xiaomi's phones when I install my app, it doesn't have all notifications permission (only vibrate, badge and lock screen) like in the pic.
What can I do to in my app to have all the notification permissions enabled by default?
Thanks!
Starting from android 6.0 marshmallow you need to manually give permissions for security reasons. If the application isn't written in such way that it checks for permissions and asks for them, then you can't get them enabled by default(without going to settings).
You need to manually ask for permission for Android 6.0 and above. More informations :
Request App Permissions

Android Runtime permissions in marshmallow for Android Camera application

In Android marshmallow android introduced runtime permissions.
Here my question is Do Android system application such as Camera, Phonebook need to ask for permission like any other non system applications.
Does android system application have some privileges.
Thanks
If you are going to run system applications (by Intent), then you must request the appropriate permissions, except Normal Permissions.
NOTE. And you must remember that the user can at any time revoke the granted permissions.

Issue in restrict disabling permissions for android marshmallow and later

I am developing an app that does some admin operations on android devices.
The users of android devices running on marshmallow and later has the ability to disable or enable the permissions for a particular app, and I want to restrict the user from disabling my app's permissions since it is an admin app and it need the permissions to run the app.
Is there anyway to restrict enabling/disabling permissions particularly for apps with device administrator privileges?
You Cannot restrict a user from enabling and/or disabling permissions on devices above Marshmallow.
The Only thing you can do is just check if the user has disabled the permission then either explain him why your app needs the permissions and if he is still not giving permissions then don't let him enter the app.
You can check at start of app whether the user has disabled your permission using
ContextCompat.checkSelfPermission(context, permission);
It will return -1 if the permission is not available.
No, This is not under the legal standard of android,
you have to check permission on your app at Splash or First Screen that your app has access that permission or not for move further.

Permission dialog is not showing in version 5.0

android permission dialog is not showing in lollipop version I.e 5.1, but permission dialog is showing in version 6.0 ie marshmallow. Can any one tell me what is the reason behind this, and how to solve this problem.
For below Android 6.0 permission dialog will not shown to the user.
From Android Docs:
If the device is running Android 5.1 or lower, or your app's target SDK is 22 or lower: If you list a dangerous permission in your
manifest, the user has to grant the permission when they install the
app; if they do not grant the permission, the system does not install
the app at all.
If the device is running Android 6.0 or higher, and your app's target SDK is 23 or higher: The app has to list the permissions in the
manifest, and it must request each dangerous permission it needs while
the app is running. The user can grant or deny each permission, and
the app can continue to run with limited capabilities even if the user
denies a permission request.
Can any one tell me what is the reason behind this
Assuming that you mean the runtime permission dialog triggered by requestPermissions(), the reason is that this dialog exists only on Android 6.0+. ActivityCompat.requestPermissions(), ContextCompat.checkSelfPermission(), and related methods call their native equivalents on Android 6.0 devices and fail gracefully on older devices.
how to solve this problem.
There is no problem. Runtime permissions only exist on Android 6.0+. On Android 1.0-5.1 devices, permissions are granted purely at install time.

Bluetooth discover/scan code not working after update Android 6 on my Nexus 5

After the update (Android 6) my nexus 5, my running application not able to scan(find) the any bluetooth device. getBondedDevices() to get paired devices list working fine.
I have also test many sample code and application (I have put link below) of bluetooth functionality. all have the same problem, it's not able to find the bluetooth device.
But yes I have found only one application on play store which is working and it able to discover/scan the bluetooth device.
Not working apps on Android 6 (Nexus 5)
I have tested many app like, bluetrem, sample code by Android Developer and many more.
Working app
Bluetooth 4.0 Scanner
https://play.google.com/store/apps/details?id=com.bluemotionlabs.bluescan
Is Any one know what is the problem, is there any changes required on code to make compatible with Android 6
At least in Android 6.0 November 1, 2015 security patch, you not only need ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions but also need the location service actually turned on in order for Bluetooth scan to work.
I verified this in my app and a bunch of other BLE apps in Play Store, including Bluetooth 4.0 Scanner.
This means we have to make sure location is on before starting a scan, otherwise it will fail silently.
It works, this is a solution, try to turn on GPS after put ACCESS_FILE_LOCATION or ACCESS_COARSE_LOCATION and after ask the runtime permission
As it's in the change list of Android 6, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions for some bluetooth calls. Please check if you have it.

Categories

Resources