OnePlus3 Nougat: TelephonyManager getNetworkType() returning value 19 instead of 13

282 Views Asked by At

OnePlus3 Nougat only (so far): TelephonyManager getNetworkType() is sometimes (!?) returning the value 19 which is not defined in the doc, according the the situation it should be NETWORK_TYPE_LTE = 13 as the status bar is showing 4G+. Obviously users are down-rating my app again, instead of blaming OnePlus.

Any Idea What is going on with the OnePlus3? Why is the Status Bar working fine? Is that supposed to be official? I'll add this 19 as a hard-coded value for LTE but what if it changes in the future... My app will be wrong for real. And more generally, How can I avoid users to blame me for all the Android/Manufacturer bugs that are introduced in every new release?

Doc: https://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkType()

System Data: VERSION.RELEASE{7.0},VERSION.INCREMENTAL{97},VERSION.SDK{24},BOARD{QC_Reference_Phone},BRAND{OnePlus},DEVICE{OnePlus3},FINGERPRINT{OnePlus/OnePlus3/OnePlus3:7.0/NRD90M/12311011:user/release-keys},HOST{ubuntu-23},ID{NRD90M}

1

There are 1 best solutions below

0
On

4G+ is the new LTE-Advanced (LTE-A) and doesn't exist as constant in TelephonyManager class.

4G is LTE (NETWORK_TYPE_LTE = 13).

I hope Google will update its constants or give us the value for 4G+ (19 ?).