Remove accidentally copied code

This commit is contained in:
Valeri Gokadze 2024-12-04 22:52:27 +04:00
parent ee987b84fe
commit 24e9d6c5bf
2 changed files with 2 additions and 30 deletions

View file

@ -131,29 +131,6 @@ class SleepTimerDialog : DialogFragment() {
SystemClock.elapsedRealtime() + minutes * 60 * 1000
PreferenceUtil.nextSleepTimerElapsedRealTime = nextSleepTimerElapsedTime.toInt()
val am = requireContext().getSystemService<AlarmManager>()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (am?.canScheduleExactAlarms() == false) {
Intent().also { intent ->
intent.action = Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM
context.startActivity(intent)
}
} else {
am?.setExact(
AlarmManager.ELAPSED_REALTIME_WAKEUP,
nextSleepTimerElapsedTime,
pi
)
Toast.makeText(
requireContext(),
requireContext().resources.getString(
R.string.sleep_timer_set,
minutes
),
Toast.LENGTH_SHORT
).show()
}
}
if (VersionUtils.hasS() && am?.canScheduleExactAlarms() != true) {
Toast.makeText(
@ -221,4 +198,4 @@ class SleepTimerDialog : DialogFragment() {
override fun onFinish() {}
}
}
}