mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 918645 - rash in java.lang.SecurityException: WifiService: Neither user 10061 nor current process has android.permission.ACCESS_WIFI_STATE. at android.os.Parcel.readException(Parcel.java r=mcmanus
--HG-- extra : rebase_source : fb48217a5654ceba1ec0361466af5698d2f2e3c5
This commit is contained in:
parent
0fcc4a14b4
commit
444daf2f5c
@ -148,14 +148,21 @@ public class GeckoNetworkManager extends BroadcastReceiver {
|
||||
if (mNetworkType != NetworkType.NETWORK_WIFI) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
WifiManager mgr = (WifiManager)sInstance.mApplicationContext.getSystemService(Context.WIFI_SERVICE);
|
||||
DhcpInfo d = mgr.getDhcpInfo();
|
||||
if (d == null) {
|
||||
try {
|
||||
WifiManager mgr = (WifiManager)sInstance.mApplicationContext.getSystemService(Context.WIFI_SERVICE);
|
||||
DhcpInfo d = mgr.getDhcpInfo();
|
||||
if (d == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return d.gateway;
|
||||
|
||||
} catch (Exception ex) {
|
||||
// getDhcpInfo() is not documented to require any permissions, but on some devices
|
||||
// requires android.permission.ACCESS_WIFI_STATE. Just catching the generic exeption
|
||||
// here and returning 0. Not logging because this could be noisy
|
||||
return 0;
|
||||
}
|
||||
|
||||
return d.gateway;
|
||||
}
|
||||
|
||||
private void updateNetworkType() {
|
||||
|
Loading…
Reference in New Issue
Block a user