Skip to content

Commit

Permalink
fix: Fix issue related to openIgnoreBatteryOptimizationSettings #275
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-hwang committed Sep 6, 2024
1 parent e1535ff commit e1d70d4
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ class PluginUtils {
/** Open the settings page where you can set ignore battery optimization. */
fun openIgnoreBatteryOptimizationSettings(activity: Activity, requestCode: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val intent = Intent(
Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS,
Uri.parse("package:" + activity.packageName)
)
val intent = Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS)
activity.startActivityForResult(intent, requestCode)
} else {
throw NotSupportedException("only supports Android 6.0+")
Expand Down

0 comments on commit e1d70d4

Please sign in to comment.