Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
chore: remove foreground service notification
Browse files Browse the repository at this point in the history
  • Loading branch information
marcouberti committed Sep 15, 2020
1 parent b8f461c commit 4ac094b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class AppNotificationManager(val context: Context) : KoinComponent {
return NotificationCompat.Builder(context, FOREGROUND_SERVICE_CHANNEL_ID)
.setContentTitle(context.getString(R.string.app_name))
.setTicker(context.getString(R.string.app_name))
.setContentText(context.getString(R.string.home_view_service_active_title))
.setContentText(context.getString(R.string.exposure_check_in_progress))
.setSmallIcon(R.drawable.ic_notification_app)
.setOnlyAlertOnce(true)
.setColor(ContextCompat.getColor(context, R.color.colorPrimary))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package it.ministerodellasalute.immuni.workers

import android.content.Context
import androidx.work.CoroutineWorker
import androidx.work.ForegroundInfo
import androidx.work.WorkerParameters
import it.ministerodellasalute.immuni.BuildConfig
import it.ministerodellasalute.immuni.R
Expand Down Expand Up @@ -73,19 +72,8 @@ class RequestDiagnosisKeysWorker(
private val settingsManager: ConfigurationSettingsManager by inject()
private val notificationManager: AppNotificationManager by inject()

private val NOTIFICATION_FETCH_ID = 10001

override suspend fun doWork(): Result {

// Make the worker run in a Foreground Service to reduce the chance of falling into the rare bucket
// https://developer.android.com/topic/performance/appstandby#rare-bucket
setForeground(
ForegroundInfo(
NOTIFICATION_FETCH_ID,
notificationManager.fetchKeysForegroundNotification()
)
)

// DEBUG notification
if (applicationContext.resources.getBoolean(R.bool.development_device)) {
notificationManager.triggerDebugNotification("Check Exposition Worker.")
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,5 @@ Operating system: iOS 13.5.1; Model: iPhone XS; Exposure notifications: Active;
<string name="support_info_item_lastencheck_none">None</string>
<string name="support_info_item_lastencheck_date" formatted="false">%@ at %@</string>
<string name="support_info_item_lastencheck_date_android">%1$s at %2$s</string>
<string name="exposure_check_in_progress">Exposure check in progress</string>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
// App version digits
versionMajor = 1
versionMinor = 4
versionPatch = 0
versionPatch = 1

// Version name follows the <major>.<minor>.<patch> convention
computeVersionName = { ->
Expand Down

0 comments on commit 4ac094b

Please sign in to comment.