1#filter substitution
2<?xml version="1.0" encoding="utf-8"?>
3<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4      package="@ANDROID_PACKAGE_NAME@"
5      android:installLocation="auto"
6      android:versionCode="@ANDROID_VERSION_CODE@"
7      android:versionName="@MOZ_APP_VERSION@"
8#ifdef MOZ_ANDROID_SHARED_ID
9      android:sharedUserId="@MOZ_ANDROID_SHARED_ID@"
10#endif
11      >
12    <uses-sdk android:minSdkVersion="@MOZ_ANDROID_MIN_SDK_VERSION@"
13#ifdef MOZ_ANDROID_MAX_SDK_VERSION
14              android:maxSdkVersion="@MOZ_ANDROID_MAX_SDK_VERSION@"
15#endif
16              android:targetSdkVersion="23"/>
17
18<!-- The bouncer APK and the main APK should define the same set of
19     <permission>, <uses-permission>, and <uses-feature> elements.  This reduces
20     the likelihood of permission-related surprises when installing the main APK
21     on top of a pre-installed bouncer APK.  Add such shared elements in the
22     fileincluded here, so that they can be referenced by both APKs. -->
23#include FennecManifest_permissions.xml.in
24
25    <application android:label="@string/moz_app_displayname"
26                 android:icon="@drawable/icon"
27                 android:logo="@drawable/logo"
28                 android:name="@MOZ_ANDROID_APPLICATION_CLASS@"
29                 android:hardwareAccelerated="true"
30                 android:allowBackup="false"
31# The preprocessor does not yet support arbitrary parentheses, so this cannot
32# be parenthesized thus to clarify that the logical AND operator has precedence:
33#   !defined(MOZILLA_OFFICIAL) || (defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG))
34#if !defined(MOZILLA_OFFICIAL) || defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG)
35                 android:debuggable="true">
36#else
37                 android:debuggable="false">
38#endif
39
40        <meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
41
42#ifdef MOZ_NATIVE_DEVICES
43        <!-- This resources comes from Google Play Services. Required for casting support. -->
44        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
45        <service android:name="org.mozilla.gecko.RemotePresentationService" android:exported="false"/>
46
47#endif
48
49        <!-- This activity handles all incoming Intents and dispatches them to other activities. -->
50        <activity android:name="org.mozilla.gecko.LauncherActivity"
51            android:theme="@android:style/Theme.Translucent.NoTitleBar"
52            android:relinquishTaskIdentity="true"
53            android:taskAffinity=""
54            android:excludeFromRecents="true" />
55
56        <!-- Fennec is shipped as the Android package named
57             org.mozilla.{fennec,firefox,firefox_beta}.  The internal Java
58             package hierarchy inside the Android package used to have an
59             org.mozilla.{fennec,firefox,firefox_beta} subtree *and* an
60             org.mozilla.gecko subtree; it now only has org.mozilla.gecko. -->
61        <activity android:name="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
62                  android:label="@string/moz_app_displayname"
63                  android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
64                  android:alwaysRetainTaskState="true"
65                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|locale|layoutDirection|smallestScreenSize|screenLayout"
66                  android:windowSoftInputMode="stateUnspecified|adjustResize"
67                  android:launchMode="singleTask"
68                  android:exported="true"
69                  android:theme="@style/Gecko.App" />
70
71        <!-- Bug 1256615 / Bug 1268455: We published an .App alias and we need to maintain it
72             forever.  If we don't, home screen shortcuts will disappear because the intent
73             filter details change. -->
74        <activity-alias android:name=".App"
75                        android:label="@MOZ_APP_DISPLAYNAME@"
76                        android:targetActivity="org.mozilla.gecko.LauncherActivity">
77
78            <!-- android:priority ranges between -1000 and 1000.  We never want
79                 another activity to usurp the MAIN action, so we ratchet our
80                 priority up. -->
81            <intent-filter android:priority="999">
82                <action android:name="android.intent.action.MAIN" />
83                <category android:name="android.intent.category.LAUNCHER" />
84                <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
85                <category android:name="android.intent.category.APP_BROWSER" />
86                <category android:name="android.intent.category.DEFAULT" />
87            </intent-filter>
88
89            <intent-filter>
90                <action android:name="android.intent.action.VIEW" />
91                <category android:name="android.intent.category.DEFAULT" />
92                <category android:name="android.intent.category.BROWSABLE" />
93                <data android:scheme="http" />
94                <data android:scheme="https" />
95                <data android:scheme="about" />
96                <data android:scheme="javascript" />
97            </intent-filter>
98            <intent-filter>
99                <action android:name="android.intent.action.VIEW" />
100                <category android:name="android.intent.category.BROWSABLE" />
101                <category android:name="android.intent.category.DEFAULT" />
102                <data android:scheme="file" />
103                <data android:scheme="http" />
104                <data android:scheme="https" />
105                <data android:mimeType="text/html"/>
106                <data android:mimeType="text/plain"/>
107                <data android:mimeType="application/xhtml+xml"/>
108            </intent-filter>
109
110            <meta-data android:name="com.sec.minimode.icon.portrait.normal"
111                       android:resource="@drawable/icon"/>
112
113            <meta-data android:name="com.sec.minimode.icon.landscape.normal"
114                       android:resource="@drawable/icon" />
115
116            <intent-filter>
117                <action android:name="org.mozilla.gecko.ACTION_ALERT_CALLBACK" />
118            </intent-filter>
119
120            <intent-filter>
121                <action android:name="org.mozilla.gecko.GUEST_SESSION_INPROGRESS" />
122                <category android:name="android.intent.category.DEFAULT" />
123            </intent-filter>
124
125            <intent-filter>
126                <action android:name="org.mozilla.gecko.UPDATE"/>
127                <category android:name="android.intent.category.DEFAULT" />
128            </intent-filter>
129
130            <intent-filter>
131                <action android:name="android.intent.action.WEB_SEARCH" />
132                <category android:name="android.intent.category.DEFAULT" />
133                <category android:name="android.intent.category.BROWSABLE" />
134                <data android:scheme="" />
135                <data android:scheme="http" />
136                <data android:scheme="https" />
137            </intent-filter>
138
139            <!-- For XPI installs from websites and the download manager. -->
140            <intent-filter>
141                <action android:name="android.intent.action.VIEW" />
142                <category android:name="android.intent.category.DEFAULT" />
143                <data android:scheme="file" />
144                <data android:scheme="http" />
145                <data android:scheme="https" />
146                <data android:mimeType="application/x-xpinstall" />
147            </intent-filter>
148
149            <!-- For XPI installs from file: URLs. -->
150            <intent-filter>
151                <action android:name="android.intent.action.VIEW" />
152                <category android:name="android.intent.category.DEFAULT" />
153                <data android:host="" />
154                <data android:scheme="file" />
155                <data android:pathPattern=".*\\.xpi" />
156            </intent-filter>
157
158#ifdef MOZ_ANDROID_BEAM
159            <intent-filter>
160                <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
161                <category android:name="android.intent.category.DEFAULT" />
162                <data android:scheme="http" />
163                <data android:scheme="https" />
164            </intent-filter>
165#endif
166
167            <!-- For debugging -->
168            <intent-filter>
169                <action android:name="org.mozilla.gecko.DEBUG" />
170                <category android:name="android.intent.category.DEFAULT" />
171            </intent-filter>
172        </activity-alias>
173
174        <service android:name="org.mozilla.gecko.GeckoService" />
175
176        <activity android:name="org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt"
177                  android:launchMode="singleTop"
178                  android:theme="@style/OverlayActivity" />
179
180        <activity android:name="org.mozilla.gecko.promotion.SimpleHelperUI"
181                  android:launchMode="singleTop"
182                  android:theme="@style/OverlayActivity" />
183
184        <activity android:name="org.mozilla.gecko.promotion.HomeScreenPrompt"
185                  android:launchMode="singleTop"
186                  android:theme="@style/OverlayActivity" />
187
188        <!-- The main reason for the Tab Queue build flag is to not mess with the VIEW intent filter
189             before the rest of the plumbing is in place -->
190
191        <service android:name="org.mozilla.gecko.tabqueue.TabQueueService" />
192
193        <activity android:name="org.mozilla.gecko.tabqueue.TabQueuePrompt"
194                  android:launchMode="singleTop"
195                  android:theme="@style/OverlayActivity" />
196
197        <receiver android:name="org.mozilla.gecko.restrictions.RestrictionProvider">
198          <intent-filter>
199            <action android:name="android.intent.action.GET_RESTRICTION_ENTRIES" />
200          </intent-filter>
201        </receiver>
202
203        <!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
204        <activity-alias
205            android:name="com.android.internal.app.ResolverActivity"
206            android:targetActivity="@MOZ_ANDROID_BROWSER_INTENT_CLASS@"
207            android:exported="true" />
208
209        <receiver android:name="org.mozilla.gecko.GeckoUpdateReceiver">
210            <intent-filter>
211                <action android:name="@ANDROID_PACKAGE_NAME@.CHECK_UPDATE_RESULT" />
212            </intent-filter>
213        </receiver>
214
215        <receiver android:name="org.mozilla.gecko.GeckoMessageReceiver"
216                  android:exported="false">
217        </receiver>
218
219        <!-- Catch install referrer so we can do post-install work. -->
220        <receiver android:name="org.mozilla.gecko.distribution.ReferrerReceiver"
221                  android:exported="true">
222            <intent-filter>
223                <action android:name="com.android.vending.INSTALL_REFERRER" />
224            </intent-filter>
225        </receiver>
226
227        <service android:name="org.mozilla.gecko.Restarter"
228                 android:exported="false"
229                 android:process="@MANGLED_ANDROID_PACKAGE_NAME@.Restarter">
230        </service>
231
232        <service android:name="org.mozilla.gecko.media.MediaControlService"
233                 android:exported="false">
234        </service>
235
236        <receiver android:name="org.mozilla.gecko.AlarmReceiver" >
237        </receiver>
238
239        <receiver
240            android:name="org.mozilla.gecko.notifications.WhatsNewReceiver"
241            android:exported="false">
242            <intent-filter>
243                <action android:name="android.intent.action.PACKAGE_REPLACED" />
244                <data android:scheme="package" android:path="org.mozilla.gecko" />
245            </intent-filter>
246        </receiver>
247
248        <receiver
249            android:name="org.mozilla.gecko.notifications.NotificationReceiver"
250            android:exported="false">
251            <!-- Notification API V2 -->
252            <intent-filter>
253                <action android:name="@ANDROID_PACKAGE_NAME@.helperBroadcastAction" />
254                <action android:name="@ANDROID_PACKAGE_NAME@.NOTIFICATION_CLICK" />
255                <action android:name="@ANDROID_PACKAGE_NAME@.NOTIFICATION_CLOSE" />
256                <data android:scheme="moz-notification" />
257                <category android:name="android.intent.category.DEFAULT" />
258            </intent-filter>
259        </receiver>
260
261#include ../services/manifests/FxAccountAndroidManifest_activities.xml.in
262#ifdef MOZ_ANDROID_SEARCH_ACTIVITY
263#include ../search/manifests/SearchAndroidManifest_activities.xml.in
264#endif
265
266#if MOZ_CRASHREPORTER
267  <activity android:name="org.mozilla.gecko.CrashReporter"
268            android:process="@ANDROID_PACKAGE_NAME@.CrashReporter"
269            android:label="@string/crash_reporter_title"
270            android:icon="@drawable/crash_reporter"
271            android:theme="@style/Gecko"
272            android:exported="false"
273            android:excludeFromRecents="true">
274          <intent-filter>
275            <action android:name="org.mozilla.gecko.reportCrash" />
276          </intent-filter>
277  </activity>
278#endif
279
280        <activity android:name="org.mozilla.gecko.preferences.GeckoPreferences"
281                  android:theme="@style/Gecko.Preferences"
282                  android:configChanges="orientation|screenSize|locale|layoutDirection"
283                  android:excludeFromRecents="true"/>
284
285        <provider android:name="org.mozilla.gecko.db.BrowserProvider"
286                  android:authorities="@ANDROID_PACKAGE_NAME@.db.browser"
287                  android:exported="false"/>
288
289        <provider android:name="org.mozilla.gecko.distribution.PartnerBookmarksProviderProxy"
290                  android:authorities="@ANDROID_PACKAGE_NAME@.partnerbookmarks"
291                  android:exported="false"/>
292
293        <!-- Share overlay activity
294
295             Setting launchMode="singleTop" ensures onNewIntent is called when the Activity is
296             reused. Ideally we create a new instance but Android L breaks this (bug 1137928). -->
297        <activity android:name="org.mozilla.gecko.overlays.ui.ShareDialog"
298                  android:label="@string/overlay_share_label"
299                  android:theme="@style/OverlayActivity"
300                  android:configChanges="keyboard|keyboardHidden|mcc|mnc|locale|layoutDirection"
301                  android:launchMode="singleTop"
302                  android:windowSoftInputMode="stateAlwaysHidden|adjustResize">
303
304            <intent-filter>
305                <action android:name="android.intent.action.SEND" />
306                <category android:name="android.intent.category.DEFAULT" />
307                <data android:mimeType="text/plain" />
308            </intent-filter>
309
310        </activity>
311
312#ifdef MOZ_ANDROID_CUSTOM_TABS
313        <activity android:name="org.mozilla.gecko.customtabs.CustomTabsActivity"
314            android:theme="@style/Theme.AppCompat.NoActionBar" />
315#endif
316
317        <!-- Service to handle requests from overlays. -->
318        <service android:name="org.mozilla.gecko.overlays.service.OverlayActionService" />
319
320        <!--
321          Ensure that passwords provider runs in its own process. (Bug 718760.)
322          Process name is per-application to avoid loading CPs from multiple
323          Fennec versions into the same process. (Bug 749727.)
324          Process name is a mangled version to avoid a Talos bug. (Bug 750548.)
325          -->
326        <provider android:name="org.mozilla.gecko.db.PasswordsProvider"
327                  android:label="@string/sync_configure_engines_title_passwords"
328                  android:authorities="@ANDROID_PACKAGE_NAME@.db.passwords"
329                  android:exported="false"
330                  android:process="@MANGLED_ANDROID_PACKAGE_NAME@.PasswordsProvider"/>
331
332        <provider android:name="org.mozilla.gecko.db.LoginsProvider"
333                  android:label="@string/sync_configure_engines_title_passwords"
334                  android:authorities="@ANDROID_PACKAGE_NAME@.db.logins"
335                  android:exported="false"/>
336
337        <provider android:name="org.mozilla.gecko.db.FormHistoryProvider"
338                  android:label="@string/sync_configure_engines_title_history"
339                  android:authorities="@ANDROID_PACKAGE_NAME@.db.formhistory"
340                  android:exported="false"/>
341
342        <provider android:name="org.mozilla.gecko.GeckoProfilesProvider"
343                  android:authorities="@ANDROID_PACKAGE_NAME@.profiles"
344                  android:exported="false"/>
345
346        <provider android:name="org.mozilla.gecko.db.TabsProvider"
347                  android:label="@string/sync_configure_engines_title_tabs"
348                  android:authorities="@ANDROID_PACKAGE_NAME@.db.tabs"
349                  android:exported="false"/>
350
351        <provider android:name="org.mozilla.gecko.db.HomeProvider"
352                  android:authorities="@ANDROID_PACKAGE_NAME@.db.home"
353                  android:exported="false"/>
354
355        <provider android:name="org.mozilla.gecko.db.SearchHistoryProvider"
356                  android:authorities="@ANDROID_PACKAGE_NAME@.db.searchhistory"
357                  android:exported="false"/>
358
359        <service
360            android:exported="false"
361            android:name="org.mozilla.gecko.updater.UpdateService"
362            android:process="@MANGLED_ANDROID_PACKAGE_NAME@.UpdateService">
363        </service>
364
365        <service
366            android:exported="false"
367            android:name="org.mozilla.gecko.notifications.NotificationService">
368        </service>
369
370        <service
371            android:exported="false"
372            android:name="org.mozilla.gecko.dlc.DownloadContentService">
373        </service>
374
375        <service
376            android:exported="false"
377            android:name="org.mozilla.gecko.feeds.FeedService">
378        </service>
379
380        <!-- DON'T EXPORT THIS, please! An attacker could delete arbitrary files. -->
381        <service
382            android:exported="false"
383            android:name="org.mozilla.gecko.cleanup.FileCleanupService">
384        </service>
385
386        <receiver
387            android:name="org.mozilla.gecko.feeds.FeedAlarmReceiver"
388            android:exported="false" />
389
390        <receiver
391            android:name="org.mozilla.gecko.BootReceiver"
392            android:exported="false">
393            <intent-filter>
394                <action android:name="android.intent.action.BOOT_COMPLETED"></action>
395            </intent-filter>
396        </receiver>
397
398        <receiver
399            android:name="org.mozilla.gecko.PackageReplacedReceiver"
400            android:exported="false">
401            <intent-filter>
402                <action android:name="android.intent.action.MY_PACKAGE_REPLACED"></action>
403            </intent-filter>
404        </receiver>
405
406        <service
407          android:name="org.mozilla.gecko.telemetry.TelemetryUploadService"
408          android:exported="false"/>
409
410#ifdef MOZ_ANDROID_CUSTOM_TABS
411        <service
412            android:name="org.mozilla.gecko.customtabs.GeckoCustomTabsService"
413            android:exported="true">
414            <intent-filter>
415                <action android:name="android.support.customtabs.action.CustomTabsService" />
416            </intent-filter>
417        </service>
418#endif
419
420#include ../services/manifests/FxAccountAndroidManifest_services.xml.in
421
422        <service
423            android:name="org.mozilla.gecko.tabqueue.TabReceivedService"
424            android:exported="false" />
425
426
427#ifdef MOZ_ANDROID_SEARCH_ACTIVITY
428#include ../search/manifests/SearchAndroidManifest_services.xml.in
429#endif
430#ifdef MOZ_ANDROID_MLS_STUMBLER
431#include ../stumbler/manifests/StumblerManifest_services.xml.in
432#endif
433
434#ifdef MOZ_ANDROID_GCM
435#include GcmAndroidManifest_services.xml.in
436#endif
437
438        <service
439            android:name="org.mozilla.gecko.media.MediaManager"
440            android:enabled="true"
441            android:exported="false"
442            android:process=":media"
443            android:isolatedProcess="false">
444        </service>
445
446    </application>
447</manifest>
448