22

I am developing an Android project which includes two modules where one is a library module for producing .aar files and another is a sample app utilising the produced .aar file.

Thus, there are two AndroidManifest.xml files in this project. Say I am developing a Bluetooth library, so I put permissions for bluetooth in library's manifest file. By including this library .aar as dependency, can I omit the <uses-permission> tag in the app's manifest file? In other words, does Android app "merge" (may be not literally but semantically) its dependent .aar libraries' permissions?

My experience suggests that while some permissions tend to behave as above, others demand explicit declaration in application's AndroidManifest.xml. I would like to know if my assumption is true, if there are any resources or documentations clearly distinguishing permissions those can reside in .aar library's manifest and those required to be declared in application's own manifest file.

Thank you!

Maurice
  • 416
  • 1
  • 5
  • 15

1 Answers1

23

As far as I know libraries' manifests are merged into the main manifest. According to this document all permissions should be merged as well.

AndroidEx
  • 15,524
  • 9
  • 54
  • 50
  • Thank you for specifying the document in regards to this topic. I might have to further look/test on why some permissions were fidgety. My experiences with permissions of varying behaviours in merge process has been a while ago, so things might have changed by now. Thank you so much! :) – Maurice Apr 16 '15 at 03:22
  • @Maurice thank you for the good question, happy to be of any help :) – AndroidEx Apr 16 '15 at 03:23