Fix category title in the notification when limits are disabled

This commit is contained in:
Jonas Lochmann 2022-03-28 02:00:00 +02:00
parent 8d8a3da564
commit 2824d18db6
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36

View file

@ -618,9 +618,12 @@ class BackgroundTaskLogic(val appLogic: AppLogic) {
): AppStatusMessage { ): AppStatusMessage {
val handling = categoryHandlingCache.get(categoryId) val handling = categoryHandlingCache.get(categoryId)
val titlePrefix = getCategoryTitle(categoryId) + " - "
return if (handling.areLimitsTemporarilyDisabled) { return if (handling.areLimitsTemporarilyDisabled) {
buildStatusMessageWithCurrentAppTitle( buildStatusMessageWithCurrentAppTitle(
text = appLogic.context.getString(R.string.background_logic_limits_disabled), text = appLogic.context.getString(R.string.background_logic_limits_disabled),
titlePrefix = titlePrefix,
titleSuffix = suffix, titleSuffix = suffix,
appPackageName = appPackageName, appPackageName = appPackageName,
appActivityToShow = appActivityToShow appActivityToShow = appActivityToShow
@ -628,7 +631,7 @@ class BackgroundTaskLogic(val appLogic: AppLogic) {
} else if (handling.remainingTime == null) { } else if (handling.remainingTime == null) {
buildStatusMessageWithCurrentAppTitle( buildStatusMessageWithCurrentAppTitle(
text = appLogic.context.getString(R.string.background_logic_no_timelimit), text = appLogic.context.getString(R.string.background_logic_no_timelimit),
titlePrefix = getCategoryTitle(categoryId) + " - ", titlePrefix = titlePrefix,
titleSuffix = suffix, titleSuffix = suffix,
appPackageName = appPackageName, appPackageName = appPackageName,
appActivityToShow = appActivityToShow appActivityToShow = appActivityToShow
@ -649,7 +652,7 @@ class BackgroundTaskLogic(val appLogic: AppLogic) {
TimeTextUtil.pauseIn(remainingSessionDuration.toInt(), appLogic.context) TimeTextUtil.pauseIn(remainingSessionDuration.toInt(), appLogic.context)
else else
TimeTextUtil.remaining(realRemainingTimeDefault.toInt() ?: 0, appLogic.context), TimeTextUtil.remaining(realRemainingTimeDefault.toInt() ?: 0, appLogic.context),
titlePrefix = getCategoryTitle(categoryId) + " - ", titlePrefix = titlePrefix,
titleSuffix = suffix, titleSuffix = suffix,
appPackageName = appPackageName, appPackageName = appPackageName,
appActivityToShow = appActivityToShow appActivityToShow = appActivityToShow