From 6c2dec6cd33aa31972fb95bbd45dfdf2165cc60e Mon Sep 17 00:00:00 2001 From: sanjeok77-tech Date: Mon, 23 Feb 2026 12:19:29 +0900 Subject: [PATCH] Fix: AlarmManager cancel - add action to Intent for proper alarm cancellation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add action to cancelAlarmInternal - Add action to cancelAllPendingIntentsForUniqueId - Fix deleted alarms still ringing (주, 석, 야, 기타) - Bump version to v1.2.2 --- app/src/main/java/com/example/shiftalarm/AlarmUtils.kt | 8 ++++++-- version.json | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/example/shiftalarm/AlarmUtils.kt b/app/src/main/java/com/example/shiftalarm/AlarmUtils.kt index be6d2a3..ee4c71d 100644 --- a/app/src/main/java/com/example/shiftalarm/AlarmUtils.kt +++ b/app/src/main/java/com/example/shiftalarm/AlarmUtils.kt @@ -137,7 +137,9 @@ private fun cancelAllPendingIntentsForUniqueId(context: Context, uniqueId: Int) for (day in 1..31) { try { val alarmId = 200000000 + year * 1000000 + month * 10000 + day * 100 + baseId - val intent = Intent(context, AlarmReceiver::class.java) + val intent = Intent(context, AlarmReceiver::class.java).apply { + action = "com.example.shiftalarm.ALARM_TRIGGER" + } val pendingIntent = PendingIntent.getBroadcast( context, alarmId, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE @@ -200,7 +202,9 @@ private fun cancelTestAlarm(context: Context) { private fun cancelAlarmInternal(context: Context, alarmId: Int) { val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager - val intent = Intent(context, AlarmReceiver::class.java) + val intent = Intent(context, AlarmReceiver::class.java).apply { + action = "com.example.shiftalarm.ALARM_TRIGGER" + } val pendingIntent = PendingIntent.getBroadcast( context, alarmId, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE diff --git a/version.json b/version.json index 2b0543c..f134ca5 100644 --- a/version.json +++ b/version.json @@ -1,7 +1,7 @@ { - "versionCode": 1121, - "versionName": "1.2.1", - "apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.2.1/app.apk", - "changelog": "v1.2.1: 내부 버전 매칭 수정", + "versionCode": 1122, + "versionName": "1.2.2", + "apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.2.2/app.apk", + "changelog": "v1.2.2: 삭제한 알람이 울리는 버그 수정 - AlarmManager 취소 시 action 누락 문제 해결", "forceUpdate": false }