mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-11-19 10:39:24 +01:00
Handle NetworkInfo being null
This commit is contained in:
parent
f94d140dea
commit
7bbdcac990
@ -100,6 +100,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
|
||||
}
|
||||
|
||||
public String getNetworkPrefForInfo(NetworkInfo info) {
|
||||
if (info == null) return PREF_NETWORK_OTHER;
|
||||
if (info.isRoaming()) return PREF_NETWORK_ROAMING;
|
||||
switch (info.getType()) {
|
||||
case ConnectivityManager.TYPE_MOBILE:
|
||||
@ -190,7 +191,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
|
||||
}
|
||||
|
||||
public boolean isEnabledFor(NetworkInfo info) {
|
||||
return isEnabled() && getHeartbeatMsFor(info) >= 0;
|
||||
return isEnabled() && info != null && getHeartbeatMsFor(info) >= 0;
|
||||
}
|
||||
|
||||
public boolean isGcmLogEnabled() {
|
||||
|
Loading…
Reference in New Issue
Block a user