Enable all notifications permissions in Android - 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

Related

NFC realtime permission Android

I am trying to get NFC permission at real time, I am able to get any permission except this one, the only way I am able to achieve this permission is by opening the wireless settings of the phone and asking the user to turn it on, is there a way of asking for this permission in runtime from the app without going to the settings?
thanks!
NFC is listed as Protection level: normal in https://developer.android.com/reference/android/Manifest.permission#NFC
And as per https://developer.android.com/guide/topics/permissions/overview#normal_permissions
If an app declares in its manifest that it needs a normal permission, the system automatically grants the app that permission at install time. The system doesn't prompt the user to grant normal permissions, and users cannot revoke these permissions.
From https://source.android.com/devices/tech/config/runtime_perms are only for permissions classed as dangerous
Therefore you don't need runtime permissions to use NFC
But it sounds like you are trying to get permission to turn NFC ON or OFF programmatically which is not really possible
See https://stackoverflow.com/a/11195440/2373819

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.

android requesting permission I'm not asking for

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.

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.

Unable to trigger Broadcast SMS receiver in MIUI Rom

I have tested my code on Emulator as well as CM9 ROM. Everything works fine. But when I run my app on MIUI v3.6.28 Android Version 4.1.2 it doesn't trigger the SMS receiver.
I searched around on StackOverflow but couldnt find suitable answer except one mentioning about Phone manufacturers implementing internal classes themselves to avoid such behaviour. And MIUI being Xiami ROM maybe that is true. But then how would Go SMS and Handcent SMS work on these devices ?
http://miuiandroid.com/community/threads/sms-notification-not-working.16464/
This might solve the problem. I did not check it since I have moved to cm again for testing . but seems to solve exactly what I need. And description makes sense.
Miui takes preference and takes away the SMS before any other app can receive it.
In Xiaomi devices, you just have to add your app to Autostart list, to do so, follow these simple steps given below:
Open Security app on your phone.
Tap on Permissions, it'll show youtwo options: Autostart and Permissions.
Tap on Autostart, it'll show you list of apps with on or off toggle
buttons.
Turn on toggle of your app, you're done!
Note : When ran through your app via USB permissions is denied by
default for READ_SMS. You need to enable permission in Permission tab
of Security app for your app.

Categories

Resources