<?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:versionCode="93"
    android:versionName="1.55"
    android:installLocation="auto"
    tools:ignore="GoogleAppIndexingWarning">
    <!-- ignore GoogleAppIndexingWarning as we don't want to implement that -->

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

    <uses-permission android:name="android.permission.BLUETOOTH"
        android:maxSdkVersion="30"
        />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
        android:maxSdkVersion="30"
        />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN"
        android:usesPermissionFlags="neverForLocation"
        tools:targetApi="s" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="28"
        tools:ignore="ScopedStorage" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.microphone" />
    <uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:name=".OpenCameraApplication"
        android:theme="@style/AppTheme"
        android:largeHeap="true"
        >
        <!-- should not change the android:name, including moving to a subpackage - see http://android-developers.blogspot.co.uk/2011/06/things-that-cannot-change.html -->
        <activity
            android:name="net.sourceforge.opencamera.MainActivity"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:clearTaskOnLaunch="true"
            android:exported="true"
            >
            <!-- clearTaskOnLaunch set to true, so if user goes to gallery then returns to home, we return to the camera rather than remaining in gallery if user relaunches Open Camera -->
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.media.action.IMAGE_CAPTURE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.media.action.IMAGE_CAPTURE_SECURE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.media.action.STILL_IMAGE_CAMERA" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.media.action.STILL_IMAGE_CAMERA_SECURE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.media.action.VIDEO_CAMERA" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.media.action.VIDEO_CAPTURE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
        </activity>
        <activity
            android:name="net.sourceforge.opencamera.remotecontrol.DeviceScanner"
            android:label="@string/scan_ble"
            android:exported="false"
        >
        </activity>

        <!-- should not change the android:name, including moving to a subpackage - see http://android-developers.blogspot.co.uk/2011/06/things-that-cannot-change.html -->
        <activity
            android:name="TakePhoto"
            android:label="@string/take_photo"
            android:icon="@drawable/ic_launcher_take_photo"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:taskAffinity=""
            android:excludeFromRecents="true"
            android:exported="false"
            >
        </activity>
        <!-- should not change the android:name, including moving to a subpackage - see http://android-developers.blogspot.co.uk/2011/06/things-that-cannot-change.html -->
        <receiver
            android:icon="@drawable/ic_launcher_take_photo"
            android:label="@string/take_photo"
            android:name="MyWidgetProviderTakePhoto"
            android:exported="true">
            <intent-filter >
                 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>
            <meta-data
               android:name="android.appwidget.provider"
               android:resource="@xml/widget_info_take_photo" />
        </receiver>
        <!-- should not change the android:name, including moving to a subpackage - see http://android-developers.blogspot.co.uk/2011/06/things-that-cannot-change.html -->
        <service
            android:name="net.sourceforge.opencamera.MyTileService"
            android:icon="@drawable/ic_photo_camera_white_48dp"
            android:label="@string/camera"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
            android:exported="true"
            tools:targetApi="n">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>
        <!-- should not change the android:name, including moving to a subpackage - see http://android-developers.blogspot.co.uk/2011/06/things-that-cannot-change.html -->
        <service
            android:name="net.sourceforge.opencamera.MyTileServiceVideo"
            android:icon="@drawable/ic_videocam_white_48dp"
            android:label="@string/record_video"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
            android:exported="true"
            tools:targetApi="n">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>
        <!-- should not change the android:name, including moving to a subpackage - see http://android-developers.blogspot.co.uk/2011/06/things-that-cannot-change.html -->
        <service
            android:name="net.sourceforge.opencamera.MyTileServiceFrontCamera"
            android:icon="@drawable/ic_face_white_48dp"
            android:label="@string/selfie"
            android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
            android:exported="true"
            tools:targetApi="n">
            <intent-filter>
                <action android:name="android.service.quicksettings.action.QS_TILE" />
            </intent-filter>
        </service>
        <service android:name="net.sourceforge.opencamera.remotecontrol.BluetoothLeService"
            android:enabled="true"
            android:exported="false"
            />
    </application>
    <!-- needed for targetting Android 11 - see https://developer.android.com/about/versions/11/behavior-changes-11 -->
    <queries>
        <intent>
            <action android:name="android.intent.action.TTS_SERVICE" />
        </intent>
    </queries>
</manifest>
