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
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
  189
  190
  191
  192
  193
  194
  195
  196
  197
  198
  199
  200
  201
  202
  203
  204
  205
  206
  207
  208
  209
  210
  211
  212
  213
  214
  215
  216
  217
  218
  219
  220
  221
  222
  223
  224
  225
  226
  227
  228
  229
  230
  231
  232
  233
  234
  235
  236
  237
  238
  239
  240
  241
  242
  243
  244
  245
  246
  247
  248
  249
  250
  251
  252
  253
  254
  255
  256

android_webview / nonembedded / java / AndroidManifest.xml [blame]

<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2012 The Chromium Authors
  Use of this source code is governed by a BSD-style license that can be
  found in the LICENSE file.
-->

<!--
Note: This is a jinja2 template, processed at build time into the final manifest.

Blocks denoted with { % block some_name % }foo{ % endblock % } can be overridden
by a child template that "extends" this file.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="{{manifest_package|default('com.android.webview')}}"
    android:isolatedSplits="true"
    tools:ignore="MissingLeanbackLauncher">

    <uses-feature android:name="android.hardware.touchscreen"
                  android:required="false" />
    <uses-feature android:name="android.software.leanback"
                  android:required="false" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- Required by WebView Developer UI only -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/>
    <!-- Required to run the foreground service-->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

    <application android:label="{{ application_label|default('Android System WebView') }}"
                 android:icon="@{{manifest_package|default('com.android.webview')}}:drawable/icon_webview"
                 android:name="{{ application_name|default('org.chromium.android_webview.nonembedded.WebViewApkApplication') }}"
                 android:multiArch="true"
                 {% if force_32_bit is defined and force_32_bit == 'true' %}
                 android:use32bitAbi="true"
                 {% endif %}
                 android:extractNativeLibs="false">
        {# This part is shared between stand-alone WebView and Monochrome #}
        {% macro common(manifest_package, webview_lib) %}
            <meta-data android:name="com.android.webview.WebViewLibrary"
                       android:value="{{ webview_lib }}" />
            <!-- Service used to hold androidx.webkit startup feature metadata
                 that can be read from other apps via PackageManager. -->
            <service
              android:name="org.chromium.android_webview.services.StartupFeatureMetadataHolder"
              android:enabled="false"
              android:exported="true"
              tools:ignore="ExportedService">
              <meta-data
                  android:name="STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX"
                  android:value="true"/>
              <meta-data
                  android:name="STARTUP_FEATURE_SET_DIRECTORY_BASE_PATH"
                  android:value="true"/>
              <meta-data
                  android:name="STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES"
                  android:value="true"/>
            </service>
            <!-- WebView Developer UI Activities. If you change these Activities, please update
                 android_webview/test/shell/AndroidManifest.xml as well. -->
            <!--suppress HardcodedText -->
            <activity android:name="org.chromium.android_webview.devui.MainActivity"
                      android:windowSoftInputMode="adjustPan"
                      android:visibleToInstantApps="true"
                      android:label="WebView DevTools"
                      android:icon="@drawable/icon_webview"
                      android:theme="@style/Theme.DevUi.DayNight"
                      android:launchMode="singleTask"
                      android:taskAffinity="{{ manifest_package }}.org.chromium.android_webview.devui" {# Explicit taskAffinity to distinguish from monochrome browser task. #}
                      android:process=":webview_apk"  {# Explicit process required for monochrome compatibility. #}
                      android:exported="true">
                <intent-filter>
                    <action android:name="com.android.webview.SHOW_DEV_UI" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
            </activity>
            <!-- Don't actually try to launch with this alias: it only exists so we can query its enabled state. -->
            <!-- If you change this component make sure to update the corresponding copy in
                 test/shell/AndroidManifest.xml -->
            <activity-alias android:name="org.chromium.android_webview.devui.DeveloperModeState"
                      android:targetActivity="org.chromium.android_webview.devui.MainActivity"
                      android:visibleToInstantApps="true"
                      android:enabled="false"
                      android:process=":webview_apk" />  {# Explicit process required for monochrome compatibility. #}
            <!-- End of WebView Developer UI Activities -->

            <!-- Don't actually try to launch with this alias: it only exists so we can query its enabled state. -->
            <!-- If you change this component make sure to update the corresponding copy in
                 test/shell/AndroidManifest.xml -->
            <activity-alias android:name="org.chromium.android_webview.SafeModeState"
                      android:targetActivity="org.chromium.android_webview.devui.MainActivity"
                      android:visibleToInstantApps="true"
                      android:enabled="false"
                      android:process=":webview_apk" />  {# Explicit process required for monochrome compatibility. #}

            <activity android:name="org.chromium.android_webview.nonembedded.LicenseActivity"
                      android:label="@string/license_activity_title"
                      android:process=":webview_apk"  {# Explicit process required for monochrome compatibility. #}
                      android:exported="true">
                <intent-filter>
                    <action android:name="android.settings.WEBVIEW_LICENSE" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
                <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
                           android:value="true" />
            </activity>
            <provider android:name="org.chromium.android_webview.nonembedded.LicenseContentProvider"
                      android:exported="true"
                      android:authorities="{{ manifest_package }}.LicenseContentProvider"
                      android:grantUriPermissions="true"
                      android:process=":webview_apk"  {# Explicit process required for monochrome compatibility. #}
                      tools:ignore="ExportedContentProvider"/>
            <!-- Disabled by default, enabled at runtime by Developer UI. -->
            <!-- If you change this component make sure to update the corresponding copy in
                 test/shell/AndroidManifest.xml-->
            <provider android:name="org.chromium.android_webview.services.DeveloperModeContentProvider"
                      android:visibleToInstantApps="true"
                      android:exported="true"
                      android:authorities="{{ manifest_package }}.DeveloperModeContentProvider"
                      android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                      tools:ignore="ExportedContentProvider" />
            <provider android:name="androidx.core.content.FileProvider"
                      android:visibleToInstantApps="true"
                      android:exported="false"
                      android:authorities="{{ manifest_package }}.net_logs_provider"
                      android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                      android:grantUriPermissions="true"
                      tools:ignore="ExportedContentProvider">
                      <meta-data android:name="android.support.FILE_PROVIDER_PATHS"
                          android:resource="@xml/provider_paths" />
            </provider>
            <!-- If you change this component make sure to update the corresponding copy in
                 test/shell/AndroidManifest.xml-->
            <provider android:name="org.chromium.android_webview.services.SafeModeVariationsSeedContentProvider"
                      android:visibleToInstantApps="true"
                      android:exported="true"
                      android:authorities="{{ manifest_package }}.SafeModeVariationsSeedContentProvider"
                      android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                      tools:ignore="ExportedContentProvider" />
            <provider android:name="org.chromium.android_webview.services.SafeModeContentProvider"
                      android:visibleToInstantApps="true"
                      android:exported="true"
                      android:authorities="{{ manifest_package }}.SafeModeContentProvider"
                      android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                      tools:ignore="ExportedContentProvider" />
            <!-- Disables at startup init of Emoji2. See http://crbug.com/1205141 -->
            <provider
                android:name="androidx.startup.InitializationProvider"
                tools:node="remove">
            </provider>
            {% if donor_package is not defined %}
                <!-- If you change the variations services, also see
                     android_webview/test/shell/AndroidManifest.xml. -->
                <!-- These have a separate android:process so that they can
                     run in Monochrome with a different value for
                     PathUtils.getDataDirectory() from Chrome. -->
                <service android:name="org.chromium.android_webview.services.VariationsSeedServer"
                         android:exported="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" />
                <service android:name="org.chromium.android_webview.services.AwVariationsSeedFetcher"
                         android:permission="android.permission.BIND_JOB_SERVICE"
                         android:exported="false"
                         android:process=":webview_service" />  {# Explicit process required for monochrome compatibility. #}
                <service android:name="org.chromium.android_webview.services.CrashReceiverService"
                         android:exported="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" />
                <service android:name="org.chromium.android_webview.services.AwMinidumpUploadJobService"
                         android:permission="android.permission.BIND_JOB_SERVICE"
                         android:exported="true"
                         android:process=":webview_service" />  {# Explicit process required for monochrome compatibility. #}
                <service android:name="org.chromium.android_webview.services.DeveloperUiService"
                         android:foregroundServiceType="specialUse"
                         android:exported="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" >
                          <property
                            android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                            android:value="debugging"
                          />
                </service>
                <service android:name="org.chromium.android_webview.services.SafeModeService"
                         android:exported="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" />
                <service android:name="org.chromium.android_webview.services.AwNetLogService"
                         android:exported="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" />
                <service android:name="org.chromium.android_webview.services.MetricsBridgeService"
                         android:exported="true"
                         android:visibleToInstantApps="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" />
                <service android:name="org.chromium.android_webview.services.MetricsUploadService"
                         android:exported="true"
                         android:visibleToInstantApps="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" />
                <!-- This service runs inside webview_apk process because it loads native -->
                <service android:name="org.chromium.android_webview.nonembedded.AwComponentUpdateService"
                         android:permission="android.permission.BIND_JOB_SERVICE"
                         android:exported="false"
                         android:process=":webview_apk"/>  {# Explicit process required for monochrome compatibility. #}
                <service android:name="org.chromium.android_webview.services.ComponentsProviderService"
                         android:exported="true"
                         android:visibleToInstantApps="true"
                         android:process=":webview_service"  {# Explicit process required for monochrome compatibility. #}
                         tools:ignore="ExportedService" />
                <!-- JS Execution Sandbox -->
                <service android:name="org.chromium.android_webview.js_sandbox.service.JsSandboxService0"
                    android:process=":js_sandboxed_process0"
                    android:isolatedProcess="true"
                    android:exported="true"
                    android:externalService="true"
                    tools:ignore="ExportedService"
                    android:visibleToInstantApps="true" />
                {% block extra_application_definitions %}
                {% endblock %}
            {% endif %}
        {% endmacro %}
        {{ common(manifest_package|default('com.android.webview'), library|default('libwebviewchromium.so')) }}
        {% if donor_package is defined %}
            <meta-data android:name="com.android.webview.WebViewDonorPackage"
                       android:value="{{ donor_package }}" />
        {% endif %}
        {% set num_sandboxed_services = 40 %}
        <meta-data android:name="org.chromium.content.browser.NUM_SANDBOXED_SERVICES"
                   android:value="{{ num_sandboxed_services }}" />
        {% for i in range(num_sandboxed_services) %}
            <service android:name="org.chromium.content.app.SandboxedProcessService{{ i }}"
                     android:process=":sandboxed_process{{ i }}"
                     android:isolatedProcess="true"
                     android:exported="true"
                     android:externalService="true"
                     tools:ignore="ExportedService"
                     android:visibleToInstantApps="true" />
        {% endfor %}
        <meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES"
                   android:value="0" />
        {% if trichrome_library is defined %}
        <uses-static-library
            android:name="{{ trichrome_library }}"
            android:version="{{ trichrome_version }}"
            android:certDigest="{{ trichrome_certdigest }}" />
        {% endif %}
    </application>
</manifest>