diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java
index 86a8047a9..4d5b0b6d5 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/actionbutton/DownloadActionButton.java
@@ -52,12 +52,17 @@ public class DownloadActionButton extends ItemActionButton {
} else {
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context)
.setTitle(R.string.confirm_mobile_download_dialog_title)
- .setMessage(R.string.confirm_mobile_download_dialog_message)
.setPositiveButton(R.string.confirm_mobile_download_dialog_download_later,
(d, w) -> DownloadServiceInterface.get().downloadNow(context, item, false))
.setNeutralButton(R.string.confirm_mobile_download_dialog_allow_this_time,
(d, w) -> DownloadServiceInterface.get().downloadNow(context, item, true))
.setNegativeButton(R.string.cancel_label, null);
+ if (NetworkUtils.isNetworkRestricted() && NetworkUtils.isVpnOverWifi()) {
+ builder.setMessage(R.string.confirm_mobile_download_dialog_message_vpn);
+ } else {
+ builder.setMessage(R.string.confirm_mobile_download_dialog_message);
+ }
+
builder.show();
}
}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java
index 8be8a113b..dfdc6c32a 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java
@@ -78,20 +78,20 @@ public class NetworkUtils {
private static boolean isNetworkMetered() {
ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
-
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
- NetworkCapabilities capabilities = connManager.getNetworkCapabilities(
- connManager.getActiveNetwork());
-
- if (capabilities != null
- && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)
- && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) {
- return false;
- }
- }
return connManager.isActiveNetworkMetered();
}
+ public static boolean isVpnOverWifi() {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
+ return false;
+ }
+ ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkCapabilities capabilities = connManager.getNetworkCapabilities(connManager.getActiveNetwork());
+ return capabilities != null
+ && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)
+ && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN);
+ }
+
private static boolean isNetworkCellular() {
ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (Build.VERSION.SDK_INT >= 23) {
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/FeedUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/FeedUpdateManager.java
index b09e58fad..4fd75a615 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/download/FeedUpdateManager.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/FeedUpdateManager.java
@@ -98,7 +98,6 @@ public class FeedUpdateManager {
private static void confirmMobileRefresh(final Context context, @Nullable Feed feed) {
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context)
.setTitle(R.string.feed_refresh_title)
- .setMessage(R.string.confirm_mobile_feed_refresh_dialog_message)
.setPositiveButton(R.string.confirm_mobile_streaming_button_once,
(dialog, which) -> runOnce(context, feed))
.setNeutralButton(R.string.confirm_mobile_streaming_button_always, (dialog, which) -> {
@@ -106,6 +105,11 @@ public class FeedUpdateManager {
runOnce(context, feed);
})
.setNegativeButton(R.string.no, null);
+ if (NetworkUtils.isNetworkRestricted() && NetworkUtils.isVpnOverWifi()) {
+ builder.setMessage(R.string.confirm_mobile_feed_refresh_dialog_message_vpn);
+ } else {
+ builder.setMessage(R.string.confirm_mobile_feed_refresh_dialog_message);
+ }
builder.show();
}
diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml
index 6bdb836dd..3a54246da 100644
--- a/ui/i18n/src/main/res/values/strings.xml
+++ b/ui/i18n/src/main/res/values/strings.xml
@@ -201,6 +201,7 @@
Add tag
Rename tag
Refreshing podcasts over mobile data connection is disabled in the settings.\n\nDo you want to refresh anyway?
+ Your VPN app pretends to be a mobile network (metered connection). Refreshing podcasts over mobile data connection is disabled in the settings.\n\nDo you want to refresh anyway? If you want this problem to be fixed, contact the creators of your VPN app.
Download
@@ -302,6 +303,7 @@
Authentication required
Confirm mobile download
Downloading over mobile data connection is disabled in the settings. AntennaPod can download the episode later automatically when Wi-Fi is available.
+ Your VPN app pretends to be a mobile network (metered connection). Downloading over mobile data connection is disabled in the settings. If you want this problem to be fixed, contact the creators of your VPN app.
Download later
Download anyway
Confirm mobile streaming