Always show status notification

This commit is contained in:
Jonas L 2019-03-25 00:00:00 +00:00
parent 37108854f1
commit e38c5d78d4

View file

@ -160,13 +160,10 @@ class BackgroundTaskLogic(val appLogic: AppLogic) {
appLogic.defaultUserLogic.reportScreenOn(appLogic.platformIntegration.isScreenOn()) appLogic.defaultUserLogic.reportScreenOn(appLogic.platformIntegration.isScreenOn())
appLogic.platformIntegration.setAppStatusMessage( appLogic.platformIntegration.setAppStatusMessage(
if (IsAppInForeground.isRunning()) AppStatusMessage(
null title = appLogic.context.getString(R.string.background_logic_timeout_title),
else text = appLogic.context.getString(R.string.background_logic_timeout_text)
AppStatusMessage( )
title = appLogic.context.getString(R.string.background_logic_timeout_title),
text = appLogic.context.getString(R.string.background_logic_timeout_text)
)
) )
liveDataCaches.reportLoopDone() liveDataCaches.reportLoopDone()
@ -232,11 +229,10 @@ class BackgroundTaskLogic(val appLogic: AppLogic) {
val foregroundAppPackageName = appLogic.platformIntegration.getForegroundAppPackageName() val foregroundAppPackageName = appLogic.platformIntegration.getForegroundAppPackageName()
// the following is not executed if the permission is missing // the following is not executed if the permission is missing
if (foregroundAppPackageName == BuildConfig.APPLICATION_ID) { if (
// this app itself runs now -> no need for an status message (foregroundAppPackageName == BuildConfig.APPLICATION_ID) ||
usedTimeUpdateHelper?.commit(appLogic) (foregroundAppPackageName != null && AndroidIntegrationApps.ignoredApps.contains(foregroundAppPackageName))
appLogic.platformIntegration.setAppStatusMessage(null) ) {
} else if (foregroundAppPackageName != null && AndroidIntegrationApps.ignoredApps.contains(foregroundAppPackageName)) {
usedTimeUpdateHelper?.commit(appLogic) usedTimeUpdateHelper?.commit(appLogic)
appLogic.platformIntegration.setAppStatusMessage(AppStatusMessage( appLogic.platformIntegration.setAppStatusMessage(AppStatusMessage(
appTitleCache.query(foregroundAppPackageName), appTitleCache.query(foregroundAppPackageName),