tauri-plugin-background-service 1.0.1

Background service lifecycle plugin for Tauri v2 — run long-lived tasks on Android, iOS, and desktop
Documentation
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
    <!-- spec 08 C6 (Step 15): typed call FGS + native ringing. The typed
         permissions and foregroundServiceType values land on API 34+; on older
         platforms they are ignored (the call still works, just untyped). -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <!-- POST_NOTIFICATIONS: the foreground service's persistent notification
         must be allowed to post (Android 13+); the FGS itself is exempt, but
         user-facing notifications (recovery, timeout, message, ring) are not. -->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <!-- AND-09: REQUEST_IGNORE_BATTERY_OPTIMIZATIONS is intentionally NOT
         declared by this library. It is Play-policy-restricted, so it must be
         opted in by the HOST application in its own manifest. The Tauri
         `requestBatteryExemption` command still launches the system
         ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS dialog; the host-declared
         permission is what authorizes that dialog (without it the dialog throws
         SecurityException at runtime). See docs/android.md
         "Battery optimization exemption". -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application>
        <receiver
            android:name=".BootReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            </intent-filter>
        </receiver>

        <!-- spec 08 / M-NATIVE-1 (Step 9): native ring Answer/Decline → Rust
             control plane. The notification action PendingIntents are
             getBroadcast intents targeting this receiver; it runs while the
             device is locked / the webview is closed and drives
             answer_call/reject_call in the in-process headless Core. Not
             exported — only the app's own notification PendingIntents fire it. -->
        <receiver
            android:name=".CallActionReceiver"
            android:enabled="true"
            android:exported="false" />

        <!-- Message notification actions: inline Reply and Mark as read route
             through a broadcast receiver so they can reach the headless Rust
             Core without opening the webview. -->
        <receiver
            android:name=".MessageNotificationActionReceiver"
            android:enabled="true"
            android:exported="false" />

        <service
            android:name=".LifecycleService"
            android:foregroundServiceType="dataSync|remoteMessaging|specialUse|phoneCall|microphone"
            android:exported="false"
            android:stopWithTask="false">
            <property
                android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                android:value="Background service for continuous task execution" />
        </service>

        <!-- spec 08 C6 (Step 15): self-managed Telecom ConnectionService so the
             OS call UI, audio focus, and Bluetooth routing follow the system
             call path while the webview is closed. Requires MANAGE_OWN_CALLS. -->
        <service
            android:name=".BackgroundCallConnectionService"
            android:exported="false"
            android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE">
            <intent-filter>
                <action android:name="android.telecom.ConnectionService" />
            </intent-filter>
        </service>
    </application>

</manifest>