Skip to content

Commit bb6400f

Browse files
authored
Merge pull request #377 from DevKor-github/codex/fix-android-alarm
[codex] fix Android native alarm flow
2 parents 3983c83 + 8a95af5 commit bb6400f

29 files changed

Lines changed: 2702 additions & 173 deletions

android/app/build.gradle

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
plugins {
22
id "com.android.application"
3-
// START: FlutterFire Configuration
4-
id 'com.google.gms.google-services'
5-
// END: FlutterFire Configuration
63
id "kotlin-android"
74
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
85
id "dev.flutter.flutter-gradle-plugin"
96
}
107

8+
def googleServicesConfigFiles = [
9+
file("google-services.json"),
10+
file("src/${gradle.startParameter.taskNames.any { it.toLowerCase().contains('release') } ? 'release' : 'debug'}/google-services.json"),
11+
file("src/google-services.json"),
12+
]
13+
14+
if (googleServicesConfigFiles.any { it.exists() }) {
15+
apply plugin: "com.google.gms.google-services"
16+
} else {
17+
logger.lifecycle("google-services.json not found; skipping Google Services plugin for this local build.")
18+
}
19+
1120
android {
1221
namespace = "club.devkor.ontime"
1322
compileSdk = flutter.compileSdkVersion

android/app/src/main/AndroidManifest.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<!-- Android 13(API 33) 이상 알림 권한 -->
33
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
44
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
5+
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
56
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
7+
<uses-permission android:name="android.permission.VIBRATE"/>
68

79
<application
810
android:label="OnTime"
@@ -31,6 +33,17 @@
3133
</intent-filter>
3234

3335
</activity>
36+
<activity
37+
android:name=".AlarmRingingActivity"
38+
android:exported="false"
39+
android:launchMode="singleTask"
40+
android:taskAffinity="club.devkor.ontime.alarm"
41+
android:theme="@style/NormalTheme"
42+
android:showWhenLocked="true"
43+
android:turnScreenOn="true"
44+
android:excludeFromRecents="true"
45+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
46+
android:hardwareAccelerated="true" />
3447
<!-- Don't delete the meta-data below.
3548
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
3649
<meta-data
@@ -42,8 +55,13 @@
4255
android:exported="false">
4356
<intent-filter>
4457
<action android:name="android.intent.action.BOOT_COMPLETED"/>
58+
<action android:name="android.app.action.SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED"/>
4559
</intent-filter>
4660
</receiver>
61+
<receiver
62+
android:name=".NativeAlarmReceiver"
63+
android:enabled="true"
64+
android:exported="false" />
4765
</application>
4866
<!-- Required to query activities that can process text, see:
4967
https://developer.android.com/training/package-visibility and

0 commit comments

Comments
 (0)