diff --git a/extensions/shared/src/main/java/app/revanced/extension/shared/patches/GmsCoreSupport.java b/extensions/shared/src/main/java/app/revanced/extension/shared/patches/GmsCoreSupport.java
index 96a049b87..faf1648ef 100644
--- a/extensions/shared/src/main/java/app/revanced/extension/shared/patches/GmsCoreSupport.java
+++ b/extensions/shared/src/main/java/app/revanced/extension/shared/patches/GmsCoreSupport.java
@@ -59,18 +59,21 @@ public class GmsCoreSupport {
private static void showBatteryOptimizationDialog(Activity context,
String dialogMessageRef,
- String positiveButtonStringRef,
+ String positiveButtonTextRef,
DialogInterface.OnClickListener onPositiveClickListener) {
// Use a delay to allow the activity to finish initializing.
// Otherwise, if device is in dark mode the dialog is shown with wrong color scheme.
- Utils.runOnMainThreadDelayed(() -> new AlertDialog.Builder(context)
- .setIconAttribute(android.R.attr.alertDialogIcon)
- .setTitle(str("gms_core_dialog_title"))
- .setMessage(str(dialogMessageRef))
- .setPositiveButton(str(positiveButtonStringRef), onPositiveClickListener)
- // Allow using back button to skip the action, just in case the check can never be satisfied.
- .setCancelable(true)
- .show(), 100);
+ Utils.runOnMainThreadDelayed(() ->
+ // Do not set cancelable to false, to allow using back button to skip the action,
+ // just in case the battery change can never be satisfied.
+ new AlertDialog.Builder(context)
+ .setIconAttribute(android.R.attr.alertDialogIcon)
+ .setTitle(str("gms_core_dialog_title"))
+ .setMessage(str(dialogMessageRef))
+ .setPositiveButton(str(positiveButtonTextRef), onPositiveClickListener)
+ .show(),
+ 100
+ );
}
/**
diff --git a/patches/src/main/resources/music/settings/host/values/strings.xml b/patches/src/main/resources/music/settings/host/values/strings.xml
index f9a2a969e..797cd1aa1 100644
--- a/patches/src/main/resources/music/settings/host/values/strings.xml
+++ b/patches/src/main/resources/music/settings/host/values/strings.xml
@@ -443,7 +443,9 @@ This is required for the app to work."
Open website
"GmsCore battery optimizations must be disabled to prevent issues.
-Tap on the continue button and disable battery optimizations."
+Disabling battery optimizations for GmsCore will not negatively affect battery usage.
+
+Tap the continue button and allow optimization changes."
Continue
Spoof client
diff --git a/patches/src/main/resources/youtube/settings/host/values/strings.xml b/patches/src/main/resources/youtube/settings/host/values/strings.xml
index d40077f58..485e0c2e8 100644
--- a/patches/src/main/resources/youtube/settings/host/values/strings.xml
+++ b/patches/src/main/resources/youtube/settings/host/values/strings.xml
@@ -1852,7 +1852,9 @@ This is required for the app to work."
Open website
"GmsCore battery optimizations must be disabled to prevent issues.
-Tap on the continue button and disable battery optimizations."
+Disabling battery optimizations for GmsCore will not negatively affect battery usage.
+
+Tap the continue button and allow optimization changes."
Continue
Sanitize sharing links