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

Commit aeebf52a authored by Guillaume Jacquart's avatar Guillaume Jacquart
Browse files

fix:3399: make trackersService a background service (again), remove notification

parent bd35109b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ class NotificationsPresenter(
            }
        }.launchIn(appScope)

        trackersStatisticsUseCase.lastCall.map(::showLastTrackerCall).launchIn(appScope)
        // trackersStatisticsUseCase.lastCall.map(::showLastTrackerCall).launchIn(appScope)
    }

    private fun createNotificationFirstBootChannel() {
+0 −16
Original line number Diff line number Diff line
@@ -17,14 +17,9 @@
 */
package foundation.e.advancedprivacy.trackers.service

import android.app.NotificationManager
import android.app.Service
import android.content.Intent
import android.content.pm.ServiceInfo
import android.os.IBinder
import androidx.core.app.ServiceCompat
import foundation.e.advancedprivacy.core.utils.notificationBuilder
import foundation.e.advancedprivacy.domain.entities.NOTIFICATION_TRACKER_FLAG
import foundation.e.advancedprivacy.domain.entities.NotificationContent
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -51,17 +46,6 @@ class TrackersService : Service() {
    }

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        ServiceCompat.startForeground(
            this,
            NOTIFICATION_TRACKER_FLAG,
            notificationBuilder(
                context = this,
                content = notificationTrackerFlag
            ).setPriority(NotificationManager.IMPORTANCE_MIN)
                .build(),
            ServiceInfo.FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED
        )

        when (intent?.action) {
            ACTION_START -> {
                if (writeLogJob?.isActive != true ||
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ class TrackersSupervisorEos(private val context: Context) : TrackersSupervisor {
    private fun startService(): Boolean {
        val intent = Intent(context, TrackersService::class.java)
        intent.action = ACTION_START
        return context.startForegroundService(intent) != null
        return context.startService(intent) != null
    }

    override fun stop(): Boolean {