Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d4b561e authored by Philipp Heckel's avatar Philipp Heckel
Browse files

Back to special use

parent 5917c96d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ android {
        minSdkVersion 21
        targetSdkVersion 35

        versionCode 37
        versionName "1.17.4"
        versionCode 38
        versionName "1.17.5"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

+6 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
    <!-- Permissions -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <!-- For instant delivery foregrounds service -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING"/> <!-- For instant delivery foregrounds service on SDK >= 34 -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/> <!-- For instant delivery foregrounds service on SDK >= 34 -->
    <uses-permission android:name="android.permission.WAKE_LOCK"/> <!-- To keep foreground service awake; soon not needed anymore -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <!-- To restart service on reboot -->
    <uses-permission android:name="android.permission.VIBRATE"/> <!-- Incoming notifications should be able to vibrate the phone -->
@@ -97,7 +97,11 @@
        <!-- Subscriber foreground service for hosts other than ntfy.sh -->
        <service
            android:name=".service.SubscriberService"
            android:foregroundServiceType="remoteMessaging"/>
            android:foregroundServiceType="specialUse">
            <property
                android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
                android:value="This is the main feature of this application. The foreground notification displays the connectivity status to the configurable remote server and the service notifies the user when a new message has been published on the remote server." />
        </service>

        <!-- Subscriber service restart on reboot -->
        <receiver
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ class SubscriberService : Service() {
        serviceNotification = createNotification(title, text)

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
            startForeground(NOTIFICATION_SERVICE_ID, serviceNotification!!, ServiceInfo.FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING)
            startForeground(NOTIFICATION_SERVICE_ID, serviceNotification!!, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
        } else {
            startForeground(NOTIFICATION_SERVICE_ID, serviceNotification)
        }