blob: d14dcaa0698841a6eb51d7344c9b6d6fd17ae25c [file] [log] [blame]
#
# Test merge of uses-feature:
# - Merge is OK if destination already has one with the same @name.
# - required defaults to "true"
# - when merging, a required=true (explicit or implicit) overwrites a required=false.
#
# Note: uses-feature with android:glEsVersion is dealt with in another test case.
#
@main
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app1"
android:versionCode="100"
android:versionName="1.0.0">
<!-- A feature that is implicitly marked as required=true -->
<uses-feature
android:name="com.example.SomeFeature0_DefaultTrue" />
<!-- A feature that is implicitly marked as required=true -->
<uses-feature
android:name="com.example.SomeFeature1_DefaultTrue" />
<!-- A feature that is explicitly marked as required=true -->
<uses-feature
android:name="com.example.SomeFeature2_RequiredTrue"
android:required="true" />
<!-- A feature that is explicitly marked as required=false -->
<uses-feature
android:name="com.example.SomeFeature3_RequiredFalse"
android:required="false" />
<!-- A feature that is explicitly marked as required=false -->
<uses-feature
android:name="com.example.SomeFeature4_RequiredFalse"
android:required="false" />
<application
android:label="@string/app_name"
android:icon="@drawable/app_icon"
android:backupAgent="com.example.app.BackupAgentClass"
android:restoreAnyVersion="true"
android:allowBackup="true"
android:killAfterRestore="true"
android:name="com.example.TheApp" >
</application>
</manifest>
@lib1
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib1">
<!-- Same as 1 from main, marking it as required=false -->
<uses-feature
android:name="com.example.SomeFeature1_DefaultTrue"
android:required="false" />
<!-- Same as 3 from main -->
<uses-feature
android:name="com.example.SomeFeature3_RequiredFalse"
android:required="false" />
<!-- Same as 4 from main -->
<uses-feature
android:name="com.example.SomeFeature4_RequiredFalse"
android:required="false" />
<!-- Add a new feature that is implicitly marked as required=true -->
<uses-feature
android:name="com.example.SomeFeature5_RequiredTrue"
android:required="true" />
<!-- Add a new feature that is implicitly marked as required=false -->
<uses-feature
android:name="com.example.SomeFeature6_RequiredFalse"
android:required="false" />
<application android:label="@string/lib_name1" >
</application>
</manifest>
@lib2
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib2">
<!-- Overrides 3, changing it from required=false to true -->
<uses-feature
android:name="com.example.SomeFeature3_RequiredFalse"
android:required="true" />
<!-- Same as 4 from main -->
<uses-feature
android:name="com.example.SomeFeature4_RequiredFalse"
android:required="false" />
<!-- Overrides 6, but implicitly declaring required=True -->
<uses-feature
android:name="com.example.SomeFeature6_RequiredFalse" />
<application android:label="@string/lib_name2" >
</application>
</manifest>
@result
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app1"
android:versionCode="100"
android:versionName="1.0.0">
<!-- A feature that is implicitly marked as required=true -->
<uses-feature
android:name="com.example.SomeFeature0_DefaultTrue" />
<!-- A feature that is implicitly marked as required=true -->
# required=false from lib1 is ignored, it stays at the default
<uses-feature
android:name="com.example.SomeFeature1_DefaultTrue" />
<!-- A feature that is explicitly marked as required=true -->
<uses-feature
android:name="com.example.SomeFeature2_RequiredTrue"
android:required="true" />
<!-- A feature that is explicitly marked as required=false -->
# lib1 keeps it required=false but lib2 makes it switch to required=true
<uses-feature
android:name="com.example.SomeFeature3_RequiredFalse"
android:required="true" />
<!-- A feature that is explicitly marked as required=false -->
<uses-feature
android:name="com.example.SomeFeature4_RequiredFalse"
android:required="false" />
<application
android:label="@string/app_name"
android:icon="@drawable/app_icon"
android:backupAgent="com.example.app.BackupAgentClass"
android:restoreAnyVersion="true"
android:allowBackup="true"
android:killAfterRestore="true"
android:name="com.example.TheApp" >
</application>
# new from lib1
<!-- Add a new feature that is implicitly marked as required=true -->
<uses-feature
android:name="com.example.SomeFeature5_RequiredTrue"
android:required="true" />
# new from lib1, but lib2 makes it switch to required=true
<!-- Add a new feature that is implicitly marked as required=false -->
<uses-feature
android:name="com.example.SomeFeature6_RequiredFalse"
android:required="true" />
</manifest>
@errors