Android permissions in the manifest

I wrote 2 applications.

The first application has only a service, and the second an Activity. I start the service in the 1st application from activity in the second application. In the service, I change the sound settings, so I need android.permission.MODIFY_AUDIO_SETTINGS in the manifest.

My question is in which manifest file should add this permission . Why I ask, because if I add this permission to the manifest of the Service application, I get a warning Exported service does not require permission .

If anyone knows this, post the solution.

+4
source share
1 answer

You need to add this permission to the application , not to the service. Permissions to provide services allow you to restrict access to them, which is something else. You need to add

 <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> 

in your manifest, above the <application> block, which changes the sound settings.

+3
source

Source: https://habr.com/ru/post/1436756/


All Articles