mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1694179 - Add workaround for getNetworkLinkType on Android 11. r=esawin
I have a better fix but let's land this in the meanwhile as this crashes at startup on any Android 11 device. Differential Revision: https://phabricator.services.mozilla.com/D106547
This commit is contained in:
parent
f1229ce794
commit
79b1179eb9
@ -1197,7 +1197,16 @@ public class GeckoAppShell {
|
||||
return LINK_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
switch (tm.getNetworkType()) {
|
||||
final int networkType;
|
||||
|
||||
try {
|
||||
// Bug 1694179 workaround, on Android 11 this throws
|
||||
networkType = tm.getNetworkType();
|
||||
} catch (final Exception ex) {
|
||||
return LINK_TYPE_4G;
|
||||
}
|
||||
|
||||
switch (networkType) {
|
||||
case TelephonyManager.NETWORK_TYPE_IDEN:
|
||||
case TelephonyManager.NETWORK_TYPE_CDMA:
|
||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||
|
Loading…
Reference in New Issue
Block a user