Unlock screen from onResume in snooze activity

Fixes #787.
pull/840/head
Quentin Hibon 5 years ago
parent fc26d7967f
commit 89d5993047

@ -148,6 +148,7 @@
<activity
android:name=".notifications.SnoozeDelayPickerActivity"
android:taskAffinity=""
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />

@ -61,7 +61,6 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
.setItems(R.array.snooze_picker_names, null)
.create()
dialog!!.listView.onItemClickListener = this
dialog!!.setOnDismissListener { finish() }
dialog!!.show()
SystemUtils.unlockScreen(this)
}
@ -94,8 +93,14 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
overridePendingTransition(0, 0)
}
override fun onResume() {
SystemUtils.unlockScreen(this)
super.onResume()
if (dialog != null) dialog!!.show()
}
override fun onPause() {
if (dialog != null) dialog!!.dismiss()
super.onPause()
if (dialog != null) dialog!!.dismiss()
}
}

Loading…
Cancel
Save