<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />

    <application
        android:name=".AndroidCastApplication"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher_foreground"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.AndroidCast"
        android:usesCleartextTraffic="true">

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboardHidden|density">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".sender.SenderActivity"
            android:exported="false"
            android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboardHidden|density" />

        <activity
            android:name=".CastSettingsActivity"
            android:exported="false"
            android:label="@string/cast_settings_title"
            android:parentActivityName=".MainActivity"
            android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" />

        <activity
            android:name=".LicensesActivity"
            android:exported="false"
            android:label="@string/licenses_title"
            android:parentActivityName=".MainActivity" />

        <activity
            android:name=".DeveloperSettingsActivity"
            android:exported="false"
            android:label="@string/developer_settings_title"
            android:parentActivityName=".MainActivity" />

        <activity
            android:name=".stats.ui.SessionStatsAnalyzerActivity"
            android:exported="false"
            android:label="@string/session_stats_title"
            android:parentActivityName=".DeveloperSettingsActivity" />

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>

        <activity
            android:name=".receiver.ReceiverPlaybackActivity"
            android:exported="false"
            android:launchMode="singleTop"
            android:resizeableActivity="true"
            android:supportsPictureInPicture="true"
            android:theme="@style/Theme.AndroidCast.Fullscreen"
            android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboardHidden|density" />

        <service
            android:name=".ota.OtaUpdateService"
            android:exported="false"
            android:foregroundServiceType="dataSync" />

        <service
            android:name=".crash.CrashWatcherService"
            android:exported="false"
            android:process=":crashwatcher" />

        <service
            android:name=".network.selftest.NetworkSelfTestService"
            android:exported="false"
            android:process=":netselftest" />

        <service
            android:name=".sender.ScreenCastService"
            android:exported="false"
            android:stopWithTask="false"
            android:foregroundServiceType="mediaProjection|microphone" />

        <service
            android:name=".sender.SenderPreviewService"
            android:exported="false"
            android:foregroundServiceType="mediaProjection" />

        <service
            android:name=".receiver.ReceiverCastService"
            android:exported="false"
            android:stopWithTask="true"
            android:foregroundServiceType="mediaPlayback" />

        <service
            android:name=".TrayForegroundService"
            android:exported="false"
            android:foregroundServiceType="specialUse">
            <property
                android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                android:value="Persistent status bar icon for Android Cast" />
        </service>

        <service
            android:name=".remoteaccess.RemoteAccessService"
            android:exported="false"
            android:foregroundServiceType="connectedDevice" />

        <service
            android:name=".remoteaccess.RemoteAccessVpnService"
            android:exported="false"
            android:permission="android.permission.BIND_VPN_SERVICE"
            android:foregroundServiceType="connectedDevice">
            <intent-filter>
                <action android:name="android.net.VpnService" />
            </intent-filter>
        </service>

        <receiver
            android:name=".TrayNotificationReceiver"
            android:exported="false" />
    </application>
</manifest>
