aboutsummaryrefslogtreecommitdiffstats
path: root/manifmerger/tests/src/com/android/manifmerger/data/16_fqcn_merge.xml
blob: 8414a3c4e4be9a97cb3136a5604a5f7f6a9bf6b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#
# Test how FQCN class names are expanded and handled:
# - A library application can be merged doesn't have an app class name.
# - A library application can be merged if it has the same class name as the app.
# - A partial class name is expanded using the package name in a library or app.
#

@main

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.app1"
    android:versionCode="100"
    android:versionName="1.0.0">

    <application
            android:name="TheApp"
            android:backupAgent=".MyBackupAgent" >
        <activity android:name=".MainActivity" />
        <receiver android:name="AppReceiver" />
        <activity android:name="com.example.lib2.LibActivity" />
    </application>
</manifest>


@lib1_widget

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.lib1">

    <application android:name="com.example.app1.TheApp" >
        <activity android:name=".WidgetLibrary" />
        <receiver android:name=".WidgetReceiver" />
        <service  android:name="AppService" />
        <activity android:name="com.example.lib1.WidgetConfigurationUI" />
    </application>
</manifest>


@lib2_activity

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.lib2">

    <application>
        <!-- This won't be merged because there's already an identical definition in the main. -->
        <activity android:name="LibActivity" />

        <!-- Provider extracted from ApiDemos -->
        <provider android:name=".app.LoaderThrottle$SimpleProvider" />

        <!-- This one does not conflict with the main -->
        <activity android:name="com.example.lib2.LibActivity2" />

    </application>
</manifest>


@lib3_alias

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.lib3" >
    <!-- This manifest has a 'package' attribute and FQCNs get resolved. -->

    <application
            android:name="com.example.app1.TheApp"
            android:backupAgent="com.example.app1.MyBackupAgent">
        <activity-alias android:name="com.example.lib3.MyActivity"
            android:targetActivity="com.example.app1.MainActivity" />

        <!-- This is a dup of the 2nd activity in lib2 -->
        <activity android:name="com.example.lib2.LibActivity2" />

        <!-- These class name should be expanded. -->
        <activity android:name=".LibActivity3" />
        <service  android:name=".LibService3" />
        <receiver android:name=".LibReceiver3" />
        <provider android:name=".LibProvider3" />

    </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">

    <application
            android:name="com.example.app1.TheApp"
            android:backupAgent="com.example.app1.MyBackupAgent" >
        <activity android:name="com.example.app1.MainActivity" />
        <receiver android:name="com.example.app1.AppReceiver" />
        <activity android:name="com.example.lib2.LibActivity" />
# from @lib1_widget
        <activity android:name="com.example.lib1.WidgetLibrary" />
        <activity android:name="com.example.lib1.WidgetConfigurationUI" />
        <service  android:name="com.example.lib1.AppService" />
        <receiver android:name="com.example.lib1.WidgetReceiver" />

# from @lib2_activity
        <!-- This one does not conflict with the main -->
        <activity android:name="com.example.lib2.LibActivity2" />

        <!-- Provider extracted from ApiDemos -->
        <provider android:name="com.example.lib2.app.LoaderThrottle$SimpleProvider" />

# from @lib3_alias
        <!-- These class name should be expanded. -->
        <activity android:name="com.example.lib3.LibActivity3" />
        <activity-alias android:name="com.example.lib3.MyActivity"
            android:targetActivity="com.example.app1.MainActivity" />
        <service  android:name="com.example.lib3.LibService3" />
        <receiver android:name="com.example.lib3.LibReceiver3" />
        <provider android:name="com.example.lib3.LibProvider3" />
    </application>
</manifest>

@errors

P [ManifestMergerTest0_main.xml:6, ManifestMergerTest2_lib2_activity.xml:5] Skipping identical /manifest/application/activity[@name=com.example.lib2.LibActivity] element.
P [ManifestMergerTest0_main.xml, ManifestMergerTest3_lib3_alias.xml:8] Skipping identical /manifest/application/activity[@name=com.example.lib2.LibActivity2] element.