From b66136ab57275f12bb32e60c773ba7e4ea453dd2 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 18 Sep 2026 09:13:25 +0000 Subject: [PATCH] chore(work): drop unused loop-export complete notification Remove buildCompleteNotification function, its test, and two unused string resources that had zero callers in production or test code. Worker only uses buildProgressNotification and createForegroundInfo. Deleted: - BoomerangRenderNotifications.buildCompleteNotification() - BoomerangRenderNotificationsRobolectricTest.buildCompleteNotification_usesImmutablePendingIntent() - notification_loop_export_complete_title string resource - notification_loop_export_complete_text string resource No behavior change. Co-authored-by: Steven Gates --- .../work/BoomerangRenderNotifications.kt | 20 ------------------- app/src/main/res/values/strings.xml | 2 -- ...erangRenderNotificationsRobolectricTest.kt | 9 --------- 3 files changed, 31 deletions(-) diff --git a/app/src/main/java/io/github/stozo04/openloop/work/BoomerangRenderNotifications.kt b/app/src/main/java/io/github/stozo04/openloop/work/BoomerangRenderNotifications.kt index b6e2e0d4..03388dfb 100644 --- a/app/src/main/java/io/github/stozo04/openloop/work/BoomerangRenderNotifications.kt +++ b/app/src/main/java/io/github/stozo04/openloop/work/BoomerangRenderNotifications.kt @@ -60,26 +60,6 @@ object BoomerangRenderNotifications { .build() } - fun buildCompleteNotification(context: Context): Notification { - ensureChannel(context) - val contentIntent = PendingIntent.getActivity( - context, - 1, - Intent(context, MainActivity::class.java).apply { - flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP - }, - PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE, - ) - return NotificationCompat.Builder(context, CHANNEL_ID) - .setSmallIcon(android.R.drawable.stat_sys_download) - .setContentTitle(context.getString(R.string.notification_loop_export_complete_title)) - .setContentText(context.getString(R.string.notification_loop_export_complete_text)) - .setContentIntent(contentIntent) - .setAutoCancel(true) - .setPriority(NotificationCompat.PRIORITY_LOW) - .build() - } - fun createForegroundInfo(context: Context, progressPercent: Int): ForegroundInfo { val notification = buildProgressNotification(context, progressPercent) return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c89a9668..759711e1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -45,8 +45,6 @@ Progress while your loop is being created Creating your loop… %1$d%% complete - Loop ready - Tap to open OpenLoop diff --git a/app/src/test/java/io/github/stozo04/openloop/work/BoomerangRenderNotificationsRobolectricTest.kt b/app/src/test/java/io/github/stozo04/openloop/work/BoomerangRenderNotificationsRobolectricTest.kt index ab7da869..1b6dc33d 100644 --- a/app/src/test/java/io/github/stozo04/openloop/work/BoomerangRenderNotificationsRobolectricTest.kt +++ b/app/src/test/java/io/github/stozo04/openloop/work/BoomerangRenderNotificationsRobolectricTest.kt @@ -104,13 +104,4 @@ class BoomerangRenderNotificationsRobolectricTest { val flags = Shadows.shadowOf(pendingIntent).flags assertTrue(flags and PendingIntent.FLAG_IMMUTABLE != 0) } - - @Test - fun buildCompleteNotification_usesImmutablePendingIntent() { - val notification = BoomerangRenderNotifications.buildCompleteNotification(context) - val pendingIntent = requireNotNull(notification.contentIntent) - - val flags = Shadows.shadowOf(pendingIntent).flags - assertTrue(flags and PendingIntent.FLAG_IMMUTABLE != 0) - } }