<?xml version="1.0" encoding="utf-8"?>
<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.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.CAMERA" />

    <!-- So a Custom Tab (Apple web sign-in) can resolve a browser on Android 11+. -->
    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />
        </intent>
    </queries>

    <application
        android:localeConfig="@xml/locales_config"
        android:name=".RiderApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.BeebBeeb"
        android:usesCleartextTraffic="true"
        tools:replace="android:theme">

        <!-- Injected from local.properties / MAPS_API_KEY at build time  never committed.
             Empty is supported: the home screen falls back to the nearby list. -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="${MAPS_API_KEY}" />

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:label="@string/app_name"
            android:theme="@style/Theme.BeebBeeb">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <!-- Apple web sign-in redirects back here: beebbeeb://apple-callback?id_token=... -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="beebbeeb" android:host="apple-callback" />
            </intent-filter>
        </activity>

        <!-- MyFatoorah's payment activity inflates Material views (AppBarLayout), so it needs an
             AppCompat/Material theme  our Compose Theme.BeebBeeb (forced on the application above)
             isn't one. Give just this SDK activity a Material theme; merged onto the SDK's own entry. -->
        <activity
            android:name="com.myfatoorah.sdk.views.MFSDKMainActivity"
            android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar"
            tools:node="merge" />

        <!-- Hands the end-of-ride photo file to the system camera app. -->
        <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>
    </application>

</manifest>
