mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
use nullable context again
This commit is contained in:
parent
3be0c2f293
commit
86165a23c8
3 changed files with 3 additions and 4 deletions
|
@ -645,8 +645,7 @@ open class ResultFragmentPhone : FullScreenPlayer() {
|
|||
),
|
||||
null
|
||||
) { click ->
|
||||
runCatching { context ?: requireContext() }.getOrNull()
|
||||
?.let { openBatteryOptimizationSettings(it) }
|
||||
context?.let { openBatteryOptimizationSettings(it) }
|
||||
|
||||
when (click.action) {
|
||||
DOWNLOAD_ACTION_DOWNLOAD -> {
|
||||
|
|
|
@ -205,7 +205,7 @@ class SettingsGeneral : PreferenceFragmentCompat() {
|
|||
}
|
||||
|
||||
getPref(R.string.battery_optimisation_key)?.setOnPreferenceClickListener {
|
||||
val ctx = context ?: requireContext()
|
||||
val ctx = context ?: return@setOnPreferenceClickListener false
|
||||
|
||||
if (isAppRestricted(ctx)) {
|
||||
intentOpenAppInfo(ctx)
|
||||
|
|
|
@ -73,7 +73,7 @@ object BatteryOptimizationChecker {
|
|||
.setData(Uri.fromParts("package", packageName, null))
|
||||
context.startActivity(intent, Bundle())
|
||||
} catch (t: Throwable) {
|
||||
Log.e(TAG, "Unable to invoke Intent for - CS3/App Info")
|
||||
Log.e(TAG, "Unable to invoke intent for - CS3/App Info", t)
|
||||
showToast(R.string.app_info_intent_error)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue