AOSP AndroidManifest.xml

似乎无法验证
Android清单文件,开发人员只能跟踪开发人员网站上的文档.但有时我看到有关AOSP中清单文件的有趣内容.

例如,there is a requirement for the priority attribute of intent-filter.

The value must be an integer, such as “100”. Higher numbers have a higher priority. The default value is 0. The value must be greater than -1000 and less than 1000.

所以允许的值应该是(-1000,1000).但是在最新的AOSP代码中(通过https://source.android.com/source/downloading.html获取)
packages / apps / MusicFX / AndroidManifest.xml,packages / apps / MusicFX / AndroidManifest.xml我看到像android:priority =“2147483647”;此外,似乎还有许多清单文件包含-1000/1000的intent-filter优先级.

这是否意味着AOSP不完全遵守“规则”,这些规范仅适用于第三方应用程序?

最佳答案 实际上,AOSP代码在此代码中是错误的(不在SYSTEM_LOW_PRIORITY和SYSTEM_HIGH_PRIORITY之间).没有任何借口,因为这是来自API 1.

这个特殊的代码行从2011年6月24日开始(git指责Google的Marco Nelissen).
在某些情况下,AOSP应用程序就像放弃软件一样……

很好的抓住.无论如何,尝试在你的清单中遵循android:priority的正确范围.

点赞