Skip to content

Commit

Permalink
improve how warning shows
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Jan 6, 2025
1 parent 89ab3fc commit 6fdd75a
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,9 @@ class TaskFormActivity : BaseActivity() {
}

private fun checkIfShowNotifLayout() {

val alarmManager = this.getSystemService(Context.ALARM_SERVICE) as? AlarmManager
var warnAboutInexact = false
if (!pushNotificationManager.notificationPermissionEnabled() && Build.VERSION.SDK_INT >= 33) {
binding.notificationsDisabledLayout.visibility = View.VISIBLE
binding.remindersContainer.shouldShowNotifPermission = true
Expand All @@ -894,13 +897,11 @@ class TaskFormActivity : BaseActivity() {
} else {
binding.remindersContainer.shouldShowNotifPermission = false
binding.notificationsDisabledLayout.visibility = View.GONE
}

val alarmManager = this.getSystemService(Context.ALARM_SERVICE) as? AlarmManager
var warnAboutInexact = false
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (alarmManager?.canScheduleExactAlarms() == false) {
warnAboutInexact = true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (alarmManager?.canScheduleExactAlarms() == false) {
warnAboutInexact = true
}
}
}
if (warnAboutInexact) {
Expand Down

0 comments on commit 6fdd75a

Please sign in to comment.