1

Based on a new feature of Android 11, the per process permissions https://developer.android.com/training/basics/network-ops/managing

Android Studio does not recognize the <processes> tag, with app target sdk set to 30, not much documentation is actually available on it and the sample app does not include it, does someone experimented this feature ?

User One
  • 455
  • 3
  • 11
  • 1
    I'm seeing code for parsing `` in the manifest (it looks like it should be a child element of ``). I [asked Google to document it](https://issuetracker.google.com/issues/1541977010), and they declined. The fact that the manifest parsing exists suggests that the feature exists -- the fact that it is undocumented may be why the Studio developers never added it to their Lint rules. – CommonsWare Dec 05 '20 at 14:47
  • yes @CommonsWare it is announced as a new feature but there is almost no informations about it, even in the application tag it seem to be not recognized(maybe at parsing time) – User One Dec 05 '20 at 14:49
  • "even in the application tag it seem to be not recognized" -- if you are referring to Android Studio complaining about it, that is controlled by a Lint rule, and the Lint rule was not updated to include `processes`, apparently. That does not mean much with respect to what the OS will do with it. For example, for a while, [Android Studio did not know about ``](https://stackoverflow.com/q/62969917/115145), even though the OS would use the element. – CommonsWare Dec 05 '20 at 14:51
  • Ok i see, it is also not clear if this attribute will take effect if the app target sdk is 30 and the app run on api 29, the sample say "and which target Android 11" i guess it will work on(ly) Android 11 – User One Dec 05 '20 at 14:55
  • 1
    anyways getting AAPT: error: unexpected element found in . when trying to build – User One Dec 05 '20 at 14:59
  • 1
    Ah, that's interesting. The code that I was looking at was in Android itself for parsing the manifest, not the toolchain. However, I do see references to it in [AAPT2 source](https://cs.android.com/android/platform/superproject/+/master:frameworks/base/tools/aapt2/link/ManifestFixer.cpp?q=processes), though it looks like there is no associated action with them. FWIW, there is also [this set of manifest attribute declarations](https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/res/res/values/attrs_manifest.xml;l=2333-2381). – CommonsWare Dec 05 '20 at 15:28
  • Nice find, so it will not only set permissions for the specified processe, but also create a processe ? "The processes tag specifies the processes the application will run code in", also this "they can only specify processes that are enumerated here", so maybe it is not yet ready to be released or something else, actually i've not be able to test it i have also not tested this in the last AS Studio 4.2 beta – User One Dec 05 '20 at 15:34
  • Prior to my research triggered by your question, I assumed that the feature did not make it into Android 11. Based on all that I have seen this morning, my best guess is that the feature indeed did not make it in, but they did not completely clean out what they had already implemented, leaving behind a confusing set of clues. Or, IOW, `¯\_(ツ)_/¯`. – CommonsWare Dec 05 '20 at 15:37
  • yes it look like, it would(will) be anyways a good feature, thanks for your infos – User One Dec 05 '20 at 15:42

0 Answers0