Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,16 @@ class BatteryPlusPlugin : MethodCallHandler, EventChannel.StreamHandler, Flutter
}

private fun isSamsungPowerSaveModeActive(): Boolean {
val mode = Settings.System.getString(
applicationContext!!.contentResolver,
POWER_SAVE_MODE_SAMSUNG_NAME
)
// psm_switch check is only available before Android 12 (S)
val mode = if (VERSION.SDK_INT < VERSION_CODES.S) {
Settings.System.getString(
applicationContext!!.contentResolver,
POWER_SAVE_MODE_SAMSUNG_NAME
)
} else {
null
}

return if (mode == null) {
checkPowerServiceSaveMode()
} else {
Expand Down
Loading