<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sudox.nightd"
    android:versionCode="3"
    android:versionName="1.2">

    <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="35" />

    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <uses-feature android:name="android.software.leanback" android:required="false" />
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />

    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="nightd"
        android:banner="@drawable/banner"
        android:theme="@style/NightdTheme">

        <service
            android:name=".NightdService"
            android:exported="true"
            android:foregroundServiceType="specialUse">
            <property
                android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                android:value="screen_overlay"/>
            <intent-filter>
                <action android:name="com.sudox.nightd.TOGGLE" />
                <action android:name="com.sudox.nightd.ON" />
                <action android:name="com.sudox.nightd.OFF" />
                <action android:name="com.sudox.nightd.DIM" />
                <action android:name="com.sudox.nightd.BLACK" />
            </intent-filter>
        </service>

        <receiver
            android:name=".NightdReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="com.sudox.nightd.TOGGLE" />
                <action android:name="com.sudox.nightd.ON" />
                <action android:name="com.sudox.nightd.OFF" />
                <action android:name="com.sudox.nightd.DIM" />
                <action android:name="com.sudox.nightd.BLACK" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".NightdActivity"
            android:exported="true"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.Translucent.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            </intent-filter>
        </activity>

        <receiver
            android:name=".BootReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

    </application>

</manifest>
