Compare commits
1 Commits
android-6-
...
android-6
| Author | SHA1 | Date | |
|---|---|---|---|
| 4565e43479 |
@@ -94,6 +94,7 @@ The project includes an automated build script that handles both TypeScript and
|
||||
|
||||
```bash
|
||||
# Build all platforms
|
||||
# Requires npm & gradle (with Java)
|
||||
./scripts/build-native.sh
|
||||
|
||||
# Build specific platform
|
||||
|
||||
@@ -37,6 +37,7 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
coreLibraryDesugaringEnabled true
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
@@ -116,6 +117,8 @@ dependencies {
|
||||
implementation "com.google.code.gson:gson:2.10.1"
|
||||
implementation "androidx.core:core:1.12.0"
|
||||
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
||||
|
||||
// Room annotation processor - use kapt for Kotlin, annotationProcessor for Java
|
||||
kapt "androidx.room:room-compiler:2.6.1"
|
||||
annotationProcessor "androidx.room:room-compiler:2.6.1"
|
||||
|
||||
@@ -1162,12 +1162,12 @@ open class DailyNotificationPlugin : Plugin() {
|
||||
} else {
|
||||
call.reject("Daily notification scheduling failed")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
Log.e(TAG, "Failed to schedule daily notification", e)
|
||||
call.reject("Daily notification scheduling failed: ${e.message}")
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
Log.e(TAG, "Schedule daily notification error", e)
|
||||
call.reject("Daily notification error: ${e.message}")
|
||||
}
|
||||
@@ -2711,7 +2711,7 @@ object ScheduleHelper {
|
||||
config.title ?: "Daily Notification",
|
||||
config.body ?: "",
|
||||
nextRunTime,
|
||||
java.util.TimeZone.getDefault().id
|
||||
java.time.ZoneId.systemDefault().id
|
||||
)
|
||||
entity.soundEnabled = config.sound ?: true
|
||||
entity.vibrationEnabled = config.vibration ?: true
|
||||
@@ -2729,7 +2729,7 @@ object ScheduleHelper {
|
||||
}
|
||||
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
Log.e("ScheduleHelper", "Failed to schedule daily notification", e)
|
||||
false
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ class NotifyReceiver : BroadcastReceiver() {
|
||||
roomStorage.saveNotificationContent(entity).get()
|
||||
Log.d(TAG, "Stored notification content in database: id=$notificationId (for recovery tracking)")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
Log.w(TAG, "Failed to store notification content in database, continuing with alarm scheduling", e)
|
||||
}
|
||||
|
||||
@@ -400,14 +400,18 @@ class NotifyReceiver : BroadcastReceiver() {
|
||||
|
||||
Log.i(TAG, "Exact alarm scheduled (setExact): triggerAt=$triggerAtMillis, requestCode=$requestCode")
|
||||
}
|
||||
} catch (e: SecurityException) {
|
||||
} catch (e: Throwable) {
|
||||
Log.w(TAG, "Cannot schedule exact alarm, falling back to inexact", e)
|
||||
alarmManager.set(
|
||||
AlarmManager.RTC_WAKEUP,
|
||||
triggerAtMillis,
|
||||
pendingIntent
|
||||
)
|
||||
Log.i(TAG, "Inexact alarm scheduled (fallback): triggerAt=$triggerAtMillis, requestCode=$requestCode")
|
||||
try {
|
||||
alarmManager.set(
|
||||
AlarmManager.RTC_WAKEUP,
|
||||
triggerAtMillis,
|
||||
pendingIntent
|
||||
)
|
||||
Log.i(TAG, "Inexact alarm scheduled (fallback): triggerAt=$triggerAtMillis, requestCode=$requestCode")
|
||||
} catch (fallbackError: Throwable) {
|
||||
Log.e(TAG, "Fallback alarm scheduling also failed", fallbackError)
|
||||
}
|
||||
}
|
||||
|
||||
// Update database schedule with new nextRunAt so getNotificationStatus() returns correct value
|
||||
@@ -462,8 +466,7 @@ class NotifyReceiver : BroadcastReceiver() {
|
||||
Log.d(SCHEDULE_TAG, "Created new schedule in database: id=$stableScheduleId, nextRunAt=$triggerAtMillis")
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// Log but don't fail - alarm is already scheduled, DB update is best-effort
|
||||
} catch (e: Throwable) {
|
||||
Log.w(SCHEDULE_TAG, "Failed to update schedule in database: $stableScheduleId (alarm still scheduled)", e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ emulator -avd AVD_NAME
|
||||
adb devices
|
||||
|
||||
# Now install on the emulator
|
||||
# ... which can take a looooooong time
|
||||
adb install -r ./app/build/outputs/apk/debug/app-debug.apk
|
||||
|
||||
# Now start the app
|
||||
|
||||
@@ -17,6 +17,7 @@ android {
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
coreLibraryDesugaringEnabled true
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
@@ -62,6 +63,7 @@ dependencies {
|
||||
implementation 'androidx.lifecycle:lifecycle-service:2.7.0'
|
||||
implementation 'com.google.code.gson:gson:2.10.1'
|
||||
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
||||
testImplementation "junit:junit:$junitVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
||||
|
||||
Reference in New Issue
Block a user