From a0d32a2d13f86ab87c34245c957e192658a45fc0 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 8 May 2020 12:17:52 +0200 Subject: [PATCH] android: Ask user to add our app to the device's power whitelist This is necessary so we can actually schedule events accurately in Doze mode. Otherwise, we'd only get woken in intervals of several minutes (up to 15 according to the docs) after about an hour. --- .../android/app/src/main/AndroidManifest.xml | 3 +- .../android/ui/VpnProfileControlActivity.java | 74 +++++++++++++++++-- .../app/src/main/res/values-de/strings.xml | 2 + .../app/src/main/res/values-pl/strings.xml | 2 + .../app/src/main/res/values-ru/strings.xml | 2 + .../app/src/main/res/values-ua/strings.xml | 2 + .../src/main/res/values-zh-rCN/strings.xml | 2 + .../src/main/res/values-zh-rTW/strings.xml | 2 + .../app/src/main/res/values/strings.xml | 2 + 9 files changed, 85 insertions(+), 6 deletions(-) diff --git a/src/frontends/android/app/src/main/AndroidManifest.xml b/src/frontends/android/app/src/main/AndroidManifest.xml index 2b2ddfcdd..6c61e06f1 100644 --- a/src/frontends/android/app/src/main/AndroidManifest.xml +++ b/src/frontends/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ VPN umschalten diff --git a/src/frontends/android/app/src/main/res/values-pl/strings.xml b/src/frontends/android/app/src/main/res/values-pl/strings.xml index 6f4716ba8..2e1df077e 100644 --- a/src/frontends/android/app/src/main/res/values-pl/strings.xml +++ b/src/frontends/android/app/src/main/res/values-pl/strings.xml @@ -215,6 +215,8 @@ Retry in %1$d seconds Cancel retry + Disable battery optimizations + Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established. Toggle VPN diff --git a/src/frontends/android/app/src/main/res/values-ru/strings.xml b/src/frontends/android/app/src/main/res/values-ru/strings.xml index 5def66df8..23fa95d38 100644 --- a/src/frontends/android/app/src/main/res/values-ru/strings.xml +++ b/src/frontends/android/app/src/main/res/values-ru/strings.xml @@ -212,6 +212,8 @@ Retry in %1$d seconds Cancel retry + Disable battery optimizations + Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established. Toggle VPN diff --git a/src/frontends/android/app/src/main/res/values-ua/strings.xml b/src/frontends/android/app/src/main/res/values-ua/strings.xml index 4920aa238..b4937364e 100644 --- a/src/frontends/android/app/src/main/res/values-ua/strings.xml +++ b/src/frontends/android/app/src/main/res/values-ua/strings.xml @@ -213,6 +213,8 @@ Retry in %1$d seconds Cancel retry + Disable battery optimizations + Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established. Toggle VPN diff --git a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml index 3408f5f55..c1dbefb66 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml @@ -212,6 +212,8 @@ Retry in %1$d seconds Cancel retry + Disable battery optimizations + Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established. Toggle VPN diff --git a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml index e3d7f0361..13e75a43b 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml @@ -212,6 +212,8 @@ Retry in %1$d seconds Cancel retry + Disable battery optimizations + Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established. Toggle VPN diff --git a/src/frontends/android/app/src/main/res/values/strings.xml b/src/frontends/android/app/src/main/res/values/strings.xml index 4d9fd879f..fb74d3f83 100644 --- a/src/frontends/android/app/src/main/res/values/strings.xml +++ b/src/frontends/android/app/src/main/res/values/strings.xml @@ -215,6 +215,8 @@ Retry in %1$d seconds Cancel retry + Disable battery optimizations + Please confirm the next dialog to add the app to the device\'s power whitelist so it can ignore battery optimizations and schedule NAT keep-alives and rekeyings accurately in order to constantly keep reachable while the VPN is established. Toggle VPN