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

    <!-- OpenGL ES 2.0 -->
    <uses-feature android:glEsVersion="0x00020000" />

    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    <uses-feature android:name="android.hardware.bluetooth" android:required="false" />
    <uses-feature android:name="android.hardware.gamepad" android:required="false" />
    <uses-feature android:name="android.hardware.usb.host" android:required="false" />
    <!-- External mouse input events -->
    <uses-feature android:name="android.hardware.type.pc" android:required="false" />

    <!-- Immersive OpenXR app now (see android/app/src/main/cpp/xr_session.c),
         not a 2D Home panel - vr.headtracking is what actually declares that
         to Horizon OS. -->
    <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />

    <!-- Plain, unrestricted /sdcard access for the res/data,res/sound the
         user drops in and the shaders/soundfont this app extracts there on
         first run - see res/GET_ASSETS_QUEST.txt and QuestShockActivity.
         requestLegacyExternalStorage below (paired with targetSdkVersion 29
         in build.gradle) is what keeps this working instead of Android 11+
         scoped storage. -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:allowBackup="true"
        android:requestLegacyExternalStorage="true"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:hardwareAccelerated="true" >

        <!-- Tells Horizon OS this activity wants the compositor for itself
             (immersive VR), not the Home 2D-panel path - required for an
             OpenXR session to actually start. -->
        <meta-data android:name="com.oculus.vr.focusaware" android:value="true" />

        <activity android:name="de.ladkau.questshock.QuestShockActivity"
            android:label="@string/app_name"
            android:alwaysRetainTaskState="true"
            android:launchMode="singleInstance"
            android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
            android:preferMinimalPostProcessing="true"
            android:screenOrientation="landscape"
            android:exported="true"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <!-- The vendor-neutral, Khronos-defined way to declare an
                     immersive OpenXR entry point (vs. e.g. Meta's own
                     com.oculus.intent.category.VR) - see this project's
                     "favor OpenXR" rule in the README. If Horizon OS still
                     launches this as a flat panel on-device, the next thing
                     to try is adding a com.oculus.supportedDevices meta-data
                     listing the target Quest models - not confirmed
                     necessary from static analysis alone. -->
                <category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
            </intent-filter>
        </activity>
    </application>

</manifest>
