<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.car.frameworkpackagestubs"
          android:versionCode="1"
          android:versionName="1.0.1">

    <uses-sdk android:minSdkVersion="28"/>

    <application android:label="@string/app_name"
                 android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">

        <!-- Dialer stubs -->
        <activity android:name=".Stubs$DialerStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.DIAL"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="voicemail"/>
            </intent-filter>
        </activity>

        <!-- Music / media stubs. -->
        <activity android:name=".Stubs$MediaStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="audio/*"/>
                <data android:mimeType="application/ogg"/>
                <data android:mimeType="application/x-0gg/application/itunes"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="file"/>
                <data android:mimeType="audio/*"/>
                <data android:mimeType="application/ogg"/>
                <data android:mimeType="application/x-ogg"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme="http"/>
                <data android:mimeType="audio/*"/>
                <data android:mimeType="application/ogg"/>
                <data android:mimeType="application/x-ogg"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme="content"/>
                <data android:mimeType="audio/*"/>
                <data android:mimeType="application/ogg"/>
                <data android:mimeType="application/x-ogg"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/audio"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme=""/>
                <data android:scheme="http"/>
                <data android:scheme="https"/>
                <data android:scheme="content"/>
                <data android:scheme="file"/>
                <data android:mimeType="video/*"/>
                <data android:mimeType="image/*"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK"/>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/image"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK"/>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/video"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="audio/*"/>
                <data android:mimeType="application/ogg"/>
                <data android:mimeType="application/x-ogg"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/audio/album/track"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.MEDIA_SEARCH" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="com.android.music.PLAYBACK_VIEWER" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- Settings package stubs -->
        <activity android:name=".Stubs$SettingsStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.settings.ACCESSIBILITY_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.settings.LOCATION_SCANNING_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.settings.PROCESS_WIFI_EASY_CONNECT_URI"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="DPP"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.settings.USER_DICTIONARY_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- These disable the Settings UI to enable a trusted external source
             to install unknown apks. Set android:priority="101" to avoid other
             apps to take the priority, nor conflicting with Settings' 1 -->
        <activity android:name=".Stubs$ManageExternalSourcesActivityStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <!-- ManageExternalSourcesActivity stub -->
            <intent-filter android:priority="101">
                <action android:name="android.settings.MANAGE_UNKNOWN_APP_SOURCES"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <!-- ManageAppExternalSourcesActivity stub when a package is specified -->
            <intent-filter android:priority="101">
                <action android:name="android.settings.MANAGE_UNKNOWN_APP_SOURCES"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="package"/>
            </intent-filter>
        </activity>

        <!-- CDD Core Application Intents Stubs -->
        <!-- Desk Clock -->
        <activity android:name=".Stubs$DeskClockStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.SET_ALARM"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.SET_TIMER"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.SHOW_ALARMS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.DISMISS_ALARM"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.SHOW_TIMERS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.DISMISS_TIMER"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.SNOOZE_ALARM"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- Calendar -->
        <activity android:name=".Stubs$GalleryStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/image"/>
                <data android:mimeType="vnd.android.cursor.dir/video"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="image/*"/>
                <data android:mimeType="video/*"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.SET_WALLPAPER" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.ATTACH_DATA" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data scheme="http"/>
                <data scheme="https"/>
                <data scheme="content"/>
                <data scheme="file"/>
                <data android:mimeType="video/mpeg4"/>
                <data android:mimeType="video/mp4"/>
                <data android:mimeType="video/3gp"/>
                <data android:mimeType="video/3gpp2"/>
                <data android:mimeType="video/webm"/>
                <data android:mimeType="video/avi"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="http"/>
                <data android:scheme="https"/>
                <data android:mimeType="application/vnd.apple.mpegurl"/>
                <data android:mimeType="audio/x-mpgeurl"/>
                <data android:mimeType="audio/mpegurl"/>
                <data android:mimeType="applicaion/x-mpegurl"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="application/vnd.google.panorama360+jpg"/>
                <data android:mimeType="image/*"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="application/vnd.apple.mpegurl"/>
                <data android:mimeType="audio/x-mpgeurl"/>
                <data android:mimeType="audio/mpegurl"/>
                <data android:mimeType="application/x-mpegurl"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="com.android.camera.action.REVIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="com.android.camera.action.REVIEW" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="com.android.camera.action.TRIM" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="com.android.camera.action.CROP" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.EDIT" />
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="image/*"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.GET_CONTENT" />
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- LauncherStub -->
        <activity android:name=".Stubs$LauncherStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.content.pm.action.CONFIRM_PIN_APPWIDGET"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- Calendar -->
        <activity android:name=".Stubs$CalendarStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.EDIT"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.item/event"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.provider.calendar.action.HANDLE_CUSTOM_EVENT"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.INSERT"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.item/event"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="time/epoch"/>
                <data android:scheme="content"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="time/epoch"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.item/event"/>
            </intent-filter>
        </activity>

        <!-- Browser -->
        <activity android:name=".Stubs$BrowserStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.WEB_SEARCH"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.search.action.GLOBAL_SEARCH"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="text/html"/>
                <data android:mimeType="text/plain"/>
                <data android:mimeType="application/xhtml+xml"/>
                <data android:mimeType="application/vnd.wap.xhtml+xml"/>
            </intent-filter>
        </activity>

        <!-- Ignore Background Data Restriction Setting -->
        <activity android:name=".Stubs$IgnoreBackgroundDataRestrictionsSettingsStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action
                    android:name="android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="package"/>
            </intent-filter>
        </activity>

        <!-- Ignore Battery Optimization Setting -->
        <activity android:name=".Stubs$IgnoreBatteryOptimizationSettingsStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- Request Ignore Battery Optimization Setting -->
        <activity android:name=".Stubs$RequestIgnoreBatteryOptimizationsStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="package"/>
            </intent-filter>
        </activity>

        <!-- WebView Setting -->
        <activity android:name=".Stubs$WebViewSettingsStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.settings.WEBVIEW_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- Picture in picture settings stub -->
        <activity android:name=".Stubs$PictureInPictureSettingsStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.settings.PICTURE_IN_PICTURE_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- Dream settings stub -->
        <activity android:name=".Stubs$DreamSettingsStub"
                  android:label="@string/stub_name"
                  android:excludeFromRecents="true"
                  android:exported="true">
            <intent-filter android:priority="-1">
                <action android:name="android.settings.DREAM_SETTINGS"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- Contacts package stubs -->
        <activity
            android:name=".Stubs$ContactsStub"
            android:label="@string/stub_name"
            android:excludeFromRecents="true"
            android:exported="true"
            android:visibleToInstantApps="true">
            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/contact"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.GET_CONTENT"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/contact"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/contact"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.PICK"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="vnd.android.cursor.dir/contact"/>
                <data android:mimeType="vnd.android.cursor.dir/person"/>
                <data android:mimeType="vnd.android.cursor.dir/phone_v2"/>
                <data android:mimeType="vnd.android.cursor.dir/phone"/>
                <data android:mimeType="vnd.android.cursor.dir/postal-address_v2"/>
                <data android:mimeType="vnd.android.cursor.dir/postal-address"/>
                <data android:mimeType="vnd.android.cursor.dir/email_v2"/>
                <data android:mimeType="vnd.android.cursor.dir/group"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="text/directory"/>
                <data android:mimeType="text/vcard"/>
                <data android:mimeType="text/x-vcard"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="text/vcard"/>
                <data android:mimeType="test/x-vcard"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="com.android.contacts.action.SHOW_OR_CREATE_CONTACT"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>

            <intent-filter android:priority="-1">
                <action android:name="android.provider.action.QUICK_CONTACT"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <!-- File management stubs -->
        <activity
            android:name=".Stubs$FileManagerStub"
            android:label="@string/stub_name"
            android:excludeFromRecents="true"
            android:exported="true">
            <!-- For VIEW actions, ComponentResolver always adjustPriority to 0. -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.document/root" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.document/directory" />
            </intent-filter>
            <!-- .ViewDownloadsActivity
                 Set android:priority="101" to avoid other apps to take the priority,
                 nor conflicting with DocumentsUI's 0. -->
            <intent-filter android:priority="101">
                <action android:name="android.intent.action.VIEW_DOWNLOADS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

    </application>
</manifest>
