<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Internet permission (usually not needed explicitly for Flutter, but safe to include) -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- Fine location (already present) -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

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

    <!-- Read/write external storage (for accessing photos) -->
    <!-- On Android 10+ (API 29+), scoped storage reduces need for WRITE_EXTERNAL_STORAGE -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="32" />
    <!-- Optional: only needed if writing images (e.g., saving captured photos) on older Android -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="28" />

    <application
        android:label="intaleq_admin"
        android:name="${applicationName}"
        android:allowBackup="false"
        android:fullBackupContent="false"
        android:networkSecurityConfig="@xml/network_security_config"
        android:usesCleartextTraffic="false"
        android:icon="@mipmap/ic_launcher">

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:taskAffinity=""
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <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:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:exported="false"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>

    <!-- Package visibility: allow interaction with camera & gallery apps on Android 11+ -->
    <queries>
        <!-- For text processing (already present) -->
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT" />
            <data android:mimeType="text/plain" />
        </intent>

        <!-- Allow launching camera apps -->
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>

        <!-- Allow launching gallery/photo picker apps -->
        <intent>
            <action android:name="android.intent.action.GET_CONTENT" />
            <data android:mimeType="image/*" />
        </intent>

        <!-- Optional: for opening image viewers or file managers -->
        <intent>
            <action android:name="android.intent.action.OPEN_DOCUMENT" />
            <data android:mimeType="image/*" />
        </intent>
    </queries>

</manifest>