<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.streamflix.tv"
    android:versionCode="1"
    android:versionName="1.0.0" >

    <uses-sdk
        android:minSdkVersion="23"
        android:targetSdkVersion="36" />

    <!-- TV-specific features -->
    <uses-feature
        android:name="android.software.leanback"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />

    <!-- Permissions -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <permission
        android:name="com.streamflix.tv.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.streamflix.tv.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" />

    <application
        android:allowBackup="true"
        android:appComponentFactory="androidx.core.app.CoreComponentFactory"
        android:banner="@drawable/app_banner"
        android:debuggable="true"
        android:extractNativeLibs="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:testOnly="true"
        android:theme="@style/Theme.StreamFlixTV"
        android:usesCleartextTraffic="true" >

        <!-- Splash Screen -->
        <activity
            android:name="com.streamflix.tv.SplashActivity"
            android:exported="true"
            android:screenOrientation="landscape"
            android:theme="@style/Theme.StreamFlixTV" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- Main Browse Activity -->
        <activity
            android:name="com.streamflix.tv.MainActivity"
            android:exported="false"
            android:screenOrientation="landscape" />

        <!-- Details Activity -->
        <activity
            android:name="com.streamflix.tv.ui.details.DetailsActivity"
            android:exported="false"
            android:screenOrientation="landscape"
            android:theme="@style/Theme.StreamFlixTV.Details" />

        <!-- Playback Activity -->
        <activity
            android:name="com.streamflix.tv.ui.playback.PlaybackActivity"
            android:exported="false"
            android:screenOrientation="landscape"
            android:theme="@style/Theme.StreamFlixTV.Playback" />

        <!-- Search Activity -->
        <activity
            android:name="com.streamflix.tv.ui.search.SearchActivity"
            android:exported="true"
            android:screenOrientation="landscape" >
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>
        </activity>

        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="com.streamflix.tv.androidx-startup"
            android:exported="false" >
            <meta-data
                android:name="androidx.emoji2.text.EmojiCompatInitializer"
                android:value="androidx.startup" />
            <meta-data
                android:name="androidx.lifecycle.ProcessLifecycleInitializer"
                android:value="androidx.startup" />
            <meta-data
                android:name="okhttp3.internal.platform.PlatformInitializer"
                android:value="androidx.startup" />
            <meta-data
                android:name="androidx.profileinstaller.ProfileInstallerInitializer"
                android:value="androidx.startup" />
        </provider>

        <receiver
            android:name="androidx.profileinstaller.ProfileInstallReceiver"
            android:directBootAware="false"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.DUMP" >
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.INSTALL_PROFILE" />
            </intent-filter>
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.SKIP_FILE" />
            </intent-filter>
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.SAVE_PROFILE" />
            </intent-filter>
            <intent-filter>
                <action android:name="androidx.profileinstaller.action.BENCHMARK_OPERATION" />
            </intent-filter>
        </receiver>
    </application>

</manifest>