bug 944043 - security exception on start up for GeckoView app r=mfinkle

This commit is contained in:
Brad Lassey
2013-11-27 18:37:44 -05:00
parent d03b22aa32
commit d86351a16b
2 changed files with 16 additions and 4 deletions

View File

@@ -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;
}