Disable 5G Scanning in NetworkScanHelper

5G has two operating modes: stand-alone and non-standalone.
The vast majority of support is currently for non-standalone
mode. Because Android currently cannot tell the difference
between the supported modes in the modem, and because a device
that supports non-standalone mode shoudn't scan for 5G during a
PLMN selection procedure (it can't camp on 5G, hence non-
standalone mode), disable 5G scans by default and revisit once
modem support exists to distinguish between the two modes. This
avoids alternatives such as allowing 5G to be silently removed
in the RIL or for a 5G scan to be performed which doesn't provide
the user any meaningful options.

A separate bug has been filed (b/151119451) to revisit this logic
once the modem supports interrogation of its 5G capability.

Bug: 149528140
Test: compilation
Change-Id: I4e19b43e6529b5c673bb54c6f8f94c44a7c5bee5
This commit is contained in:
Nathan Harold
2020-03-09 19:39:56 -07:00
parent 7eada07c97
commit adbc1ac905

View File

@@ -113,12 +113,19 @@ public class NetworkScanHelper {
radioAccessSpecifiers.add(
new RadioAccessSpecifier(AccessNetworkType.EUTRAN, null, null));
}
if (networkTypeBitmap3gpp == 0
|| (networkTypeBitmap3gpp & TelephonyManager.NETWORK_CLASS_BITMASK_5G) != 0) {
radioAccessSpecifiers.add(
new RadioAccessSpecifier(AccessNetworkType.NGRAN, null, null));
}
// If a device supports 5G stand-alone then the code below should be re-enabled; however
// a device supporting only non-standalone mode cannot perform PLMN selection and camp on
// a 5G network, which means that it shouldn't scan for 5G at the expense of battery as
// part of the manual network selection process.
//
// FIXME(b/151119451): re-enable this code once there is a way to distinguish SA from NSA
// support in the modem.
//
// if (networkTypeBitmap3gpp == 0
// || (networkTypeBitmap3gpp & TelephonyManager.NETWORK_CLASS_BITMASK_5G) != 0) {
// radioAccessSpecifiers.add(
// new RadioAccessSpecifier(AccessNetworkType.NGRAN, null, null));
// }
return new NetworkScanRequest(
NetworkScanRequest.SCAN_TYPE_ONE_SHOT,