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
|
null
|
||||||
) { click ->
|
) { click ->
|
||||||
runCatching { context ?: requireContext() }.getOrNull()
|
context?.let { openBatteryOptimizationSettings(it) }
|
||||||
?.let { openBatteryOptimizationSettings(it) }
|
|
||||||
|
|
||||||
when (click.action) {
|
when (click.action) {
|
||||||
DOWNLOAD_ACTION_DOWNLOAD -> {
|
DOWNLOAD_ACTION_DOWNLOAD -> {
|
||||||
|
|
|
@ -205,7 +205,7 @@ class SettingsGeneral : PreferenceFragmentCompat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
getPref(R.string.battery_optimisation_key)?.setOnPreferenceClickListener {
|
getPref(R.string.battery_optimisation_key)?.setOnPreferenceClickListener {
|
||||||
val ctx = context ?: requireContext()
|
val ctx = context ?: return@setOnPreferenceClickListener false
|
||||||
|
|
||||||
if (isAppRestricted(ctx)) {
|
if (isAppRestricted(ctx)) {
|
||||||
intentOpenAppInfo(ctx)
|
intentOpenAppInfo(ctx)
|
||||||
|
|
|
@ -73,7 +73,7 @@ object BatteryOptimizationChecker {
|
||||||
.setData(Uri.fromParts("package", packageName, null))
|
.setData(Uri.fromParts("package", packageName, null))
|
||||||
context.startActivity(intent, Bundle())
|
context.startActivity(intent, Bundle())
|
||||||
} catch (t: Throwable) {
|
} 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)
|
showToast(R.string.app_info_intent_error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue