Skip to content

Conversation

@DongChyeon
Copy link
Member

@DongChyeon DongChyeon commented Oct 27, 2025

Related issue 🛠

closed #264

어떤 변경사항이 있었나요?

  • 🐞 BugFix Something isn't working
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (Junit, etc.)

CheckPoint ✅

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 컨벤션에 맞게 작성했습니다. (필수)
  • merge할 브랜치의 위치를 확인해 주세요(main❌/develop⭕) (필수)
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다. (필수)
  • BugFix의 경우, 버그의 원인을 파악하였습니다. (선택)

Work Description ✏️

adcdf.mov
  • setExactAndAllowIdle()setAlarmClock()으로 대체
  • 알람 구역에 있는 알람 클릭 시 홈 화면 이동

Uncompleted Tasks 😅

N/A

To Reviewers 📢

setExactAndAllowIdle을 써도 알람이 제 시각에 안와요
안드로이드 공식 문서 - 정확한 알람을 설정하는 방법

Summary by CodeRabbit

  • 버그 수정
    • 알람 스케줄링 방식이 개선되어 알람 작동 신뢰성이 향상되었습니다.
    • 알람 작동 시 앱의 메인 화면이 안정적으로 열리도록 동작이 보강되었습니다.
    • 반복/비반복 알람 및 주간 재스케줄링 시 일관된 동작이 적용되었습니다.

@DongChyeon DongChyeon self-assigned this Oct 27, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Walkthrough

AndroidAlarmScheduler.kt에서 기존의 setExactAndAllowWhileIdle() 호출을 제거하고, 세 메서드(setRepeatingAlarm, setNonRepeatingAlarm, rescheduleUpcomingWeeklyAlarm)에서 AlarmManager.setAlarmClock()AlarmManager.AlarmClockInfo(triggerMillis, showMainPendingIntent)를 사용하도록 스케줄링 방식이 변경되었습니다. MainActivity를 여는 불변 PendingIntent 생성 함수가 추가되었습니다.

Changes

Cohort / File(s) 요약
Alarm scheduler 변경
core/alarm/src/main/java/com/yapp/alarm/AndroidAlarmScheduler.kt
PendingIntent, Intent 임포트 추가. createShowMainActivityPendingIntent() 헬퍼 추가(immutable, MainActivity 대상, `NEW_TASK

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Scheduler as AndroidAlarmScheduler
    participant AM as AlarmManager
    participant Receiver as AlarmBroadcastReceiver
    participant Main as com.yapp.orbit.MainActivity

    Note over Scheduler,AM fill:#f0f4ff,stroke:#c7ddff: 변경된 흐름 (setAlarmClock)
    Scheduler->>AM: setAlarmClock(AlarmClockInfo(triggerMillis, showMainPI), alarmPI)
    AM-->>Scheduler: alarm registered
    Note right of AM: 시스템은 showMainPI를 알람 아이콘/시계용으로 사용하고\nalarmPI로 Receiver를 트리거함
    AM->>Receiver: send alarmPI at triggerMillis
    Receiver-->>Main: optionally launch MainActivity (via showMainPI) / handle alarm logic
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

검토 시 주의사항:

  • createShowMainActivityPendingIntent()의 Intent 플래그 및 PendingIntent 불변성(IMMUTABLE) 검증
  • AlarmClockInfo에 전달되는 triggerMillis가 각 메서드에서 올바르게 계산·전달되는지 확인
  • 기존 알람용 pendingIntent(수신자용)가 setAlarmClock 호출의 두번째 인자로 올바르게 사용되는지 확인
  • Android 권한/매니페스트나 API 레벨 관련 처리(정확알람 권한 등)가 별도로 필요한지 코드 컨텍스트에서 재검토 필요 여부 검토

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed PR 제목 "[REFACTOR] AlarmManager.setAlarmClock 사용하기"는 변경세트의 핵심 내용을 명확하게 반영합니다. 제목은 AlarmManager.setAlarmClock()으로의 전환이라는 주요 변경사항을 간결하게 표현하고 있으며, [REFACTOR] 접두사로 변경의 성격을 명확히 나타냅니다. 팀원이 커밋 히스토리를 스캔할 때 이 변경사항의 의도를 명확하게 이해할 수 있습니다.
Linked Issues Check ✅ Passed Issue #264의 주요 요구사항인 setExactAndAllowWhileIdle() 메서드를 setAlarmClock()으로 교체하는 것이 완벽하게 구현되었습니다. 코드 변경사항에서 setRepeatingAlarm, setNonRepeatingAlarm, rescheduleUpcomingWeeklyAlarm의 세 곳에서 모두 해당 메서드가 교체되었고, AlarmClockInfo를 활용한 적절한 구현이 이루어졌습니다. 이슈의 체크리스트 항목이 완료되었습니다.
Out of Scope Changes Check ✅ Passed 모든 코드 변경사항이 Issue #264의 요구사항 범위 내에 있습니다. PendingIntent와 Intent import 추가, createShowMainActivityPendingIntent() 헬퍼 함수 작성, setAlarmClock() 호출로의 교체, AlarmClockInfo 활용 등의 모든 변경은 setExactAndAllowWhileIdle()에서 setAlarmClock()으로의 마이그레이션을 구현하기 위해 필요한 변경입니다. 범위를 벗어난 불필요한 변경사항은 없습니다.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#264-use-alarmclock-for-alarmmanager

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DongChyeon
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
core/alarm/src/main/java/com/yapp/alarm/AndroidAlarmScheduler.kt (2)

58-64: 동일한 showIntent 사용 패턴이 적용되었습니다.

이 메서드도 setRepeatingAlarm과 동일하게 알람 트리거 PendingIntentshowIntent로 사용하고 있습니다. 앞서 언급한 우려사항이 여기에도 적용됩니다.


71-77: 동일한 showIntent 사용 패턴이 적용되었습니다.

이 메서드도 앞의 두 메서드와 동일한 패턴을 사용합니다. 세 메서드 모두 일관되게 리팩토링되었습니다.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc7ae1c and 0f011eb.

📒 Files selected for processing (1)
  • core/alarm/src/main/java/com/yapp/alarm/AndroidAlarmScheduler.kt (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
core/alarm/src/main/java/com/yapp/alarm/AndroidAlarmScheduler.kt (1)

45-77: setAlarmClock() 사용의 의도를 확인하세요.

권한 요구사항은 만족됩니다—SCHEDULE_EXACT_ALARM 권한이 AndroidManifest.xml에 이미 선언되어 있습니다.

다만 setAlarmClock()의 사용으로 인한 UX 변경을 확인해주세요: 알람이 상태 표시줄에 아이콘으로 표시되고 시스템의 다음 알람 목록에 노출됩니다. 이는 setExactAndAllowWhileIdle()의 동작과 다르며, 의도된 설계 변경인지 확인이 필요합니다.

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.54%. Comparing base (9dd762e) to head (3a7106b).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
.../main/java/com/yapp/alarm/AndroidAlarmScheduler.kt 0.00% 22 Missing ⚠️

❌ Your project status has failed because the head coverage (6.54%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             develop    #265      +/-   ##
============================================
+ Coverage       6.10%   6.54%   +0.43%     
  Complexity        67      67              
============================================
  Files             53      53              
  Lines           4864    4387     -477     
  Branches         712     637      -75     
============================================
- Hits             297     287      -10     
+ Misses          4539    4072     -467     
  Partials          28      28              
Files with missing lines Coverage Δ
.../main/java/com/yapp/alarm/AndroidAlarmScheduler.kt 0.00% <0.00%> (ø)

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DongChyeon DongChyeon merged commit b4e7807 into develop Oct 27, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] AlarmManager.setAlarmClock 사용하기

2 participants