简体   繁体   中英

AOSP AndroidManifest.xml

It seems there is no way to validate an android manifest file and developers can only follow the document from the developer site. But sometimes I see funny things about the manifest files in AOSP.

For example, 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.

So the permitted value should be (-1000, 1000) . However in the latest AOSP code (get via https://source.android.com/source/downloading.html ) packages/apps/MusicFX/AndroidManifest.xml , packages/apps/MusicFX/AndroidManifest.xml I saw something like android:priority="2147483647" ; additionally there seems also many manifest files containing intent-filter priority with -1000/1000.

So does that mean AOSP does not fully obey the "rules" and these specs are merely for third-party apps?

Indeed AOSP code is wrong in this code (not between SYSTEM_LOW_PRIORITY and SYSTEM_HIGH_PRIORITY ). And no excuse because this is from API 1.

This particlar line of code if from Jun 24 2011 (git blames Marco Nelissen from Google). AOSP apps are like abandonware in some cases...

Nice catch. Anyway, try to follow the right range for android:priority in your manifests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM