<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <!--foreground service special use for non VPN service tunnels, android 14-->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
    <!--foreground service special use for VPN service tunnels, android 14-->
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" />

    <!--foreground service permissions-->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <application>
        <service
                android:name=".service.VpnCompanionService"
                android:enabled="true"
                android:exported="false"
                android:foregroundServiceType="specialUse">
        <property
                android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                android:value="Provides a persistent foreground notification and process lifecycle for the VPN client. Keeps the app alive for Always-On VPN while showing connection status. Essential because the actual VpnService must not be a foreground service to avoid interfering with Android Auto Wireless connectivity." />
        </service>
        <service
                android:name=".service.VpnService"
                android:exported="false"
                android:persistent="true"
                android:permission="android.permission.BIND_VPN_SERVICE">
            <intent-filter>
                <action android:name="android.net.VpnService" />
            </intent-filter>
        </service>
        <service
                android:name=".service.TunnelService"
                android:enabled="true"
                android:exported="false"
                android:foregroundServiceType="specialUse"
                android:persistent="true"
                android:stopWithTask="false">
            <property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                      android:value="This service sustains non-VpnService virtual tunnels (using gVisor/netstack for
                      isolated networking), keeping connections alive for continuous secure data routing.
                      Persistent foreground operation is essential to handle
                      low-level tunnel maintenance and avoid interruptions, beyond the capabilities of other
                      service types or background work."/>
        </service>
    </application>

</manifest>