<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />

    <!-- This is needed because the android.permission.CAMERA above automatically
    adds a requirements for camera hardware and we don't want add those restrictions -->
    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false" />


    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    <uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="32" />
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="28"  />

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>

    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

    <!-- Needed for uploading media files on devices with Android 13 and later. -->
    <uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />

    <application
        android:label="flutter_mozilla_components_example"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:usesCleartextTraffic="true">
        <activity android:name="eu.weblibre.flutter_mozilla_components.activities.NotificationActivity" android:theme="@style/Theme.AppCompat.Translucent" />
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:taskAffinity=""
            android:theme="@style/LaunchTheme"
            android:supportsPictureInPicture="true"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <activity
            android:theme="@style/Theme.AppCompat.Light"
            android:name="eu.weblibre.flutter_mozilla_components.addons.AddonsActivity"
            android:label="@string/mozac_feature_addons_addons"
            android:exported="false"
            android:parentActivityName=".MainActivity" />

        <activity
            android:theme="@style/Theme.AppCompat.Light"
            android:name="eu.weblibre.flutter_mozilla_components.addons.AddonDetailsActivity"
            android:exported="false"
            android:label="@string/mozac_feature_addons_addons" />

        <activity android:name="eu.weblibre.flutter_mozilla_components.addons.InstalledAddonDetailsActivity"
            android:label="@string/mozac_feature_addons_addons"
            android:parentActivityName="eu.weblibre.flutter_mozilla_components.addons.AddonsActivity"
            android:exported="false"
            android:theme="@style/Theme.AppCompat.Light" />

        <activity
            android:name="eu.weblibre.flutter_mozilla_components.addons.PermissionsDetailsActivity"
            android:label="@string/mozac_feature_addons_addons"
            android:exported="false"
            android:theme="@style/Theme.AppCompat.Light" />

        <activity
            android:name="eu.weblibre.flutter_mozilla_components.addons.AddonSettingsActivity"
            android:label="@string/mozac_feature_addons_addons"
            android:exported="false"
            android:theme="@style/Theme.AppCompat.Light" />

        <activity
            android:name="eu.weblibre.flutter_mozilla_components.addons.WebExtensionActionPopupActivity"
            android:label="@string/mozac_feature_addons_addons"
            android:theme="@style/Theme.AppCompat.Light"/>

        <service
            android:name="eu.weblibre.flutter_mozilla_components.services.DownloadService"
            android:foregroundServiceType="dataSync" />

        <service android:name="eu.weblibre.flutter_mozilla_components.services.MediaSessionService"
            android:foregroundServiceType="mediaPlayback"
            android:exported="false" />

        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
    <!-- Required to query activities that can process text, see:
         https://developer.android.com/training/package-visibility and
         https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

         In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
    <queries>
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT"/>
            <data android:mimeType="text/plain"/>
        </intent>
    </queries>
</manifest>
