From adbc1ac905a8b1e2e70070856b2adda3e183889c Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Mon, 9 Mar 2020 19:39:56 -0700 Subject: [PATCH] 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 --- .../network/telephony/NetworkScanHelper.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/com/android/settings/network/telephony/NetworkScanHelper.java b/src/com/android/settings/network/telephony/NetworkScanHelper.java index 6d3cdbb2f32..fe5b9e1037c 100644 --- a/src/com/android/settings/network/telephony/NetworkScanHelper.java +++ b/src/com/android/settings/network/telephony/NetworkScanHelper.java @@ -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,