<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:installLocation="auto"
    android:versionCode="7600000"
    android:versionName="76">

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <uses-permission
        android:name="android.permission.INTERNET" 
        android:description="@string/perm_internet_desc"
    />
    <uses-permission
        android:name="android.permission.ACCESS_NETWORK_STATE"
        android:description="@string/perm_access_network_state_desc"
    />
    <uses-permission
        android:name="android.permission.RECEIVE_BOOT_COMPLETED"
        android:description="@string/perm_boot_desc"
    />
    <uses-permission
        android:name="android.permission.VIBRATE"
        android:description="@string/vibrate_desc"
    />
    <uses-permission
        android:name="android.permission.WAKE_LOCK"
        android:description="@string/wake_lock_desc"
    />
    <uses-permission
        android:name="android.permission.POST_NOTIFICATIONS"
        android:minSdkVersion="33"
        android:description="@string/notification_permission_desc"
    />
    <uses-permission
        android:name="android.permission.FOREGROUND_SERVICE"
        android:description="@string/foreground_service_desc"
    />
    <uses-permission
        android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"
        android:description="@string/foreground_service_data_sync_desc"
    />

    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="false" />

    <queries>
        <intent>
            <action android:name="android.intent.action.TTS_SERVICE" />
        </intent>
    </queries>

    <application
        android:name="app.crossword.yourealwaysbe.forkyz.ForkyzApplication"
        android:backupAgent="app.crossword.yourealwaysbe.forkyz.BackupAgent"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:restoreAnyVersion="true"
        android:largeHeap="true"
        android:allowBackup="true"
        android:fullBackupContent="@xml/backup_rules"
        tools:ignore="UnusedAttribute"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:supportsRtl="true"
        android:enableOnBackInvokedCallback="true"
    >
        <activity
            android:name="app.crossword.yourealwaysbe.forkyz.ForkyzActivity"
            android:configChanges="orientation"
            android:theme="@style/Theme.Forkyz"
            tools:ignore="AppLinkUrlError"
            android:exported="true"
        >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.SEND" />
                <action android:name="android.intent.action.SEND_MULTIPLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="application/x-crossword" />
                <data android:mimeType="application/octet-stream" />
                <data android:mimeType="text/html" />
                <data android:mimeType="text/plain" />
                <data android:mimeType="text/xml" />
                <data android:mimeType="application/zip" />
                <data android:mimeType="application/json" />
            </intent-filter>
        </activity>
        <service
            android:name="app.crossword.yourealwaysbe.forkyz.util.PuzzleSaveService"
            android:foregroundServiceType="shortService"
            android:exported="false"
        />
        <service
            android:name="app.crossword.yourealwaysbe.forkyz.util.PuzzleExportService"
            android:foregroundServiceType="dataSync"
            android:exported="false"
        />
        <provider
            android:name="app.crossword.yourealwaysbe.forkyz.util.files.FileProviderShared"
            android:authorities="${applicationId}.files"
            android:exported="false"
            android:grantUriPermissions="true"
        >
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/share_paths"
            />
        </provider>
        <!-- Work manager setup
            https://insert-koin.io/docs/reference/koin-android/workmanager -->
        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="${applicationId}.androidx-startup"
            android:exported="false"
            tools:node="merge">
            <meta-data
                android:name="androidx.work.WorkManagerInitializer"
                android:value="androidx.startup"
                tools:node="remove" />
        </provider>
    </application>
</manifest>
