Skip to content

Commit

Permalink
log tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ahudson20 committed Apr 28, 2024
1 parent 8f2fa79 commit 413fcc1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/com/app/whakaara/activities/WidgetConfig.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.app.whakaara.activities

import android.app.Activity
import android.appwidget.AppWidgetManager
import android.content.Intent
import android.os.Bundle
Expand Down Expand Up @@ -148,7 +147,7 @@ class WidgetConfig : ComponentActivity() {
val resultValue = Intent().apply {
putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
}
setResult(Activity.RESULT_OK, resultValue)
setResult(RESULT_OK, resultValue)
finish()
}
) {
Expand All @@ -172,7 +171,7 @@ class WidgetConfig : ComponentActivity() {
glanceAppWidget.update(this@WidgetConfig, glanceId)
}
setResult(
Activity.RESULT_OK,
RESULT_OK,
Intent().apply {
putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.app.whakaara.utils.DateUtils
import com.app.whakaara.utils.PendingIntentUtils
import com.app.whakaara.utils.constants.DateUtilsConstants.TIMER_INPUT_INITIAL_VALUE
import com.app.whakaara.utils.constants.DateUtilsConstants.TIMER_STARTING_FORMAT
import com.app.whakaara.utils.constants.GeneralConstants.RESET_TIMER_DATASTORE_TAG
import com.app.whakaara.utils.constants.GeneralConstants.STARTING_CIRCULAR_PROGRESS
import com.app.whakaara.utils.constants.GeneralConstants.ZERO_MILLIS
import com.app.whakaara.utils.constants.NotificationUtilsConstants
Expand Down Expand Up @@ -397,7 +398,7 @@ class TimerManagerWrapper @Inject constructor(
} catch (e: CancellationException) {
throw e
} catch (t: Throwable) {
Log.e("resetTimerStateDataStoreTAG", "resetTimerStateDataStore execution failed", t)
Log.e(RESET_TIMER_DATASTORE_TAG, "resetTimerStateDataStore execution failed", t)
} finally {
// Nothing can be in the `finally` block after this, as this throws a
// `CancellationException`
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/app/whakaara/receiver/GoAsync.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.app.whakaara.receiver

import android.content.BroadcastReceiver
import android.util.Log
import com.app.whakaara.utils.constants.GeneralConstants.GO_ASYNC_TAG
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
Expand All @@ -25,7 +26,7 @@ fun BroadcastReceiver.goAsync(
} catch (e: CancellationException) {
throw e
} catch (t: Throwable) {
Log.e("goAsyncTAG", "BroadcastReceiver execution failed", t)
Log.e(GO_ASYNC_TAG, "BroadcastReceiver execution failed", t)
} finally {
// Nothing can be in the `finally` block after this, as this throws a
// `CancellationException`
Expand All @@ -38,7 +39,7 @@ fun BroadcastReceiver.goAsync(
} catch (e: IllegalStateException) {
// On some OEM devices, this may throw an error about "Broadcast already finished".
// See b/257513022.
Log.e("goAsyncTAG", "Error thrown when trying to finish broadcast", e)
Log.e(GO_ASYNC_TAG, "Error thrown when trying to finish broadcast", e)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ object GeneralConstants {
val DAYS_OF_WEEK = listOf("M", "T", "W", "T", "F", "S", "S")

const val MAX_NUMBER_OF_LAPS = 100

const val RESET_TIMER_DATASTORE_TAG = "resetTimerStateDataStoreTAG"
const val GO_ASYNC_TAG = "goAsyncTAG"
}

0 comments on commit 413fcc1

Please sign in to comment.