Skip to content
Snippets Groups Projects
Commit 69c7ea1c authored by Adrien Béraud's avatar Adrien Béraud
Browse files

network: keep account alive with push notifications

Change-Id: I8acedaee131b95c09bdd6b6d9bf0a7fe532b34f2
parent 5f51c724
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,9 @@ public final class NetworkUtils { ...@@ -40,7 +40,9 @@ public final class NetworkUtils {
return info != null && info.isConnected() && (info.getType() != ConnectivityManager.TYPE_MOBILE || allowMobile); return info != null && info.isConnected() && (info.getType() != ConnectivityManager.TYPE_MOBILE || allowMobile);
} }
public static boolean isPushAllowed(Context context, boolean allowMobile) { public static boolean isPushAllowed(Context context, boolean allowMobile) {
if (allowMobile)
return true;
NetworkInfo info = NetworkUtils.getNetworkInfo(context); NetworkInfo info = NetworkUtils.getNetworkInfo(context);
return info != null && (info.getType() != ConnectivityManager.TYPE_MOBILE || allowMobile); return info != null && info.getType() != ConnectivityManager.TYPE_MOBILE;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment