mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 10:50:35 +00:00
bug 944043 - security exception on start up for GeckoView app r=mfinkle
This commit is contained in:
parent
5ba16c0086
commit
1e976cbe99
@ -1515,9 +1515,13 @@ public class GeckoAppShell
|
||||
public static boolean isNetworkLinkUp() {
|
||||
ConnectivityManager cm = (ConnectivityManager)
|
||||
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo info = cm.getActiveNetworkInfo();
|
||||
if (info == null || !info.isConnected())
|
||||
try {
|
||||
NetworkInfo info = cm.getActiveNetworkInfo();
|
||||
if (info == null || !info.isConnected())
|
||||
return false;
|
||||
} catch (SecurityException se) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1525,8 +1529,12 @@ public class GeckoAppShell
|
||||
public static boolean isNetworkLinkKnown() {
|
||||
ConnectivityManager cm = (ConnectivityManager)
|
||||
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
if (cm.getActiveNetworkInfo() == null)
|
||||
try {
|
||||
if (cm.getActiveNetworkInfo() == null)
|
||||
return false;
|
||||
} catch (SecurityException se) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,11 @@ public class GeckoNetworkManager extends BroadcastReceiver {
|
||||
return NetworkType.NETWORK_NONE;
|
||||
}
|
||||
|
||||
NetworkInfo ni = cm.getActiveNetworkInfo();
|
||||
NetworkInfo ni = null;
|
||||
try {
|
||||
ni = cm.getActiveNetworkInfo();
|
||||
} catch (SecurityException se) {} // if we don't have the permission, fall through to null check
|
||||
|
||||
if (ni == null) {
|
||||
return NetworkType.NETWORK_NONE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user