Commit d790182a authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Show a Toast when the system doesn't allow to show the battery optimization list

parent 36c94124
...@@ -55,7 +55,11 @@ class BatteryOptimizationInfoDialog(context: Context) : ...@@ -55,7 +55,11 @@ class BatteryOptimizationInfoDialog(context: Context) :
context.getString(R.string.menu_settings) context.getString(R.string.menu_settings)
) { dialog, _ -> ) { dialog, _ ->
dialog.dismiss() dialog.dismiss()
context.startActivity(settingsIntent) try {
context.startActivity(settingsIntent)
} catch (e: SecurityException) {
Toast.makeText(context, R.string.error_cannot_open_settings, Toast.LENGTH_LONG).show()
}
} }
} else { } else {
setButton( setButton(
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<string name="error_invalid_pin">Please provide your PIN.</string> <string name="error_invalid_pin">Please provide your PIN.</string>
<string name="error_invalid_servername">Please provide a name.</string> <string name="error_invalid_servername">Please provide a name.</string>
<string name="error_webview_missing">WebView package not found, is it currently updating or removed?</string> <string name="error_webview_missing">WebView package not found, is it currently updating or removed?</string>
<string name="error_cannot_open_settings">Cannot open system settings.</string>
<string name="main_dnssurveillance_infotext">Be aware that the DNS server you are connected to is able to record which sites you are visiting. Check the respective privacy statements for more information.</string> <string name="main_dnssurveillance_infotext">Be aware that the DNS server you are connected to is able to record which sites you are visiting. Check the respective privacy statements for more information.</string>
<string name="main_dnssurveillance_privacystatement">Privacy statement of %1s</string> <string name="main_dnssurveillance_privacystatement">Privacy statement of %1s</string>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment