From a95dd62e858e4f280fe346b16e873569e1107a99 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Mon, 21 Mar 2022 09:38:14 -0700 Subject: [PATCH 1/3] Moved MVNO matching logic out of old data stack Moved MVNO matching logic out of old data stack. There is no logic change here. Bug: 171809764 Test: Manual Merged-In: Ia7fc8042fe81a884bbab60c7a9bb6423f0401d65 Change-Id: Ia7fc8042fe81a884bbab60c7a9bb6423f0401d65 --- .../android/telephony/TelephonyManager.java | 2 +- .../data/QualifiedNetworksService.java | 26 ++++++++++++++----- .../internal/telephony/ITelephony.aidl | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index bbd3c46c0d688..4e186e5e09fd1 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -14837,7 +14837,7 @@ public class TelephonyManager { } ITelephony service = getITelephony(); if (service != null) { - return service.isMvnoMatched(getSubId(), mvnoType, mvnoMatchData); + return service.isMvnoMatched(getSlotIndex(), mvnoType, mvnoMatchData); } } catch (RemoteException ex) { Rlog.e(TAG, "Telephony#matchesCurrentSimOperator RemoteException" + ex); diff --git a/telephony/java/android/telephony/data/QualifiedNetworksService.java b/telephony/java/android/telephony/data/QualifiedNetworksService.java index 4e85d8926f116..a846088cec6c2 100644 --- a/telephony/java/android/telephony/data/QualifiedNetworksService.java +++ b/telephony/java/android/telephony/data/QualifiedNetworksService.java @@ -129,17 +129,31 @@ public abstract class QualifiedNetworksService extends Service { } /** - * Update the qualified networks list. Network availability provider must invoke this method - * whenever the qualified networks changes. If this method is never invoked for certain - * APN types, then frameworks will always use the default (i.e. cellular) data and network - * service. + * Update the suggested qualified networks list. Network availability provider must invoke + * this method whenever the suggested qualified networks changes. If this method is never + * invoked for certain APN types, then frameworks uses its own logic to determine the + * transport to setup the data network. + * + * For example, QNS can suggest frameworks to setup IMS on IWLAN by specifying + * {@link ApnSetting#TYPE_IMS} with a list containing single element + * {@link AccessNetworkType#IWLAN}. + * + * Or if QNS consider multiple access networks are qualified for certain APN type, it can + * suggest frameworks by specifying the APN type with multiple elements in the list like + * {{@link AccessNetworkType#EUTRAN}, {@link AccessNetworkType#IWLAN}}. Frameworks will then + * first attempt to setup data on LTE network. If the device moves from LTE to UMTS, then + * frameworks can perform handover the data network to the second preferred access network + * if available. + * + * If the {@code qualifiedNetworkTypes} list is empty, it means QNS has no suggestion to the + * frameworks, and frameworks will decide the transport to setup the data network. * * @param apnTypes APN types of the qualified networks. This must be a bitmask combination * of {@link ApnType}. * @param qualifiedNetworkTypes List of network types which are qualified for data * connection setup for {@link @apnType} in the preferred order. Each element in the list - * is a {@link AccessNetworkType}. An empty list indicates no networks are qualified - * for data setup. + * is a {@link AccessNetworkType}. Note that {@link AccessNetworkType#UNKNOWN} is not a + * valid input here. */ public final void updateQualifiedNetworkTypes( @ApnType int apnTypes, @NonNull List qualifiedNetworkTypes) { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index f5877d8fd20a3..20b9f3a5c8c5a 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -2148,7 +2148,7 @@ interface ITelephony { List getSystemSelectionChannels(int subId); - boolean isMvnoMatched(int subId, int mvnoType, String mvnoMatchData); + boolean isMvnoMatched(int slotIndex, int mvnoType, String mvnoMatchData); /** * Enqueue a pending sms Consumer, which will answer with the user specified selection for an From ca544abf6fc8d5961471fba73ba133883e03a598 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 24 Mar 2022 23:41:45 -0700 Subject: [PATCH 2/3] Partially revert ag/17294635 The qualified network service change was accidentally merged in ag/17294635. It should be merged in a different CL. Revert back to the previous version. Bug: 171809764 Test: Build Merged-In: Id50e376c04141a347ff70cdc7ab7ad1fab661844 Change-Id: Id50e376c04141a347ff70cdc7ab7ad1fab661844 --- .../data/QualifiedNetworksService.java | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/telephony/java/android/telephony/data/QualifiedNetworksService.java b/telephony/java/android/telephony/data/QualifiedNetworksService.java index a846088cec6c2..4e85d8926f116 100644 --- a/telephony/java/android/telephony/data/QualifiedNetworksService.java +++ b/telephony/java/android/telephony/data/QualifiedNetworksService.java @@ -129,31 +129,17 @@ public abstract class QualifiedNetworksService extends Service { } /** - * Update the suggested qualified networks list. Network availability provider must invoke - * this method whenever the suggested qualified networks changes. If this method is never - * invoked for certain APN types, then frameworks uses its own logic to determine the - * transport to setup the data network. - * - * For example, QNS can suggest frameworks to setup IMS on IWLAN by specifying - * {@link ApnSetting#TYPE_IMS} with a list containing single element - * {@link AccessNetworkType#IWLAN}. - * - * Or if QNS consider multiple access networks are qualified for certain APN type, it can - * suggest frameworks by specifying the APN type with multiple elements in the list like - * {{@link AccessNetworkType#EUTRAN}, {@link AccessNetworkType#IWLAN}}. Frameworks will then - * first attempt to setup data on LTE network. If the device moves from LTE to UMTS, then - * frameworks can perform handover the data network to the second preferred access network - * if available. - * - * If the {@code qualifiedNetworkTypes} list is empty, it means QNS has no suggestion to the - * frameworks, and frameworks will decide the transport to setup the data network. + * Update the qualified networks list. Network availability provider must invoke this method + * whenever the qualified networks changes. If this method is never invoked for certain + * APN types, then frameworks will always use the default (i.e. cellular) data and network + * service. * * @param apnTypes APN types of the qualified networks. This must be a bitmask combination * of {@link ApnType}. * @param qualifiedNetworkTypes List of network types which are qualified for data * connection setup for {@link @apnType} in the preferred order. Each element in the list - * is a {@link AccessNetworkType}. Note that {@link AccessNetworkType#UNKNOWN} is not a - * valid input here. + * is a {@link AccessNetworkType}. An empty list indicates no networks are qualified + * for data setup. */ public final void updateQualifiedNetworkTypes( @ApnType int apnTypes, @NonNull List qualifiedNetworkTypes) { From 14111703f3d13b75eed2f989641bd3b1b8c0496b Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Fri, 25 Mar 2022 02:07:30 -0700 Subject: [PATCH 3/3] Document the QNS behavior Clearly defined the QNS behavior to avoid ambiguity. Bug: 226267529 Test: atest AccessNetworksManagerTest Merged-In: I274d88338ac4f15a4458e035af0e5c0b278f9c1b Change-Id: I274d88338ac4f15a4458e035af0e5c0b278f9c1b --- .../data/QualifiedNetworksService.java | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/telephony/java/android/telephony/data/QualifiedNetworksService.java b/telephony/java/android/telephony/data/QualifiedNetworksService.java index 4e85d8926f116..fb973361e398f 100644 --- a/telephony/java/android/telephony/data/QualifiedNetworksService.java +++ b/telephony/java/android/telephony/data/QualifiedNetworksService.java @@ -26,6 +26,7 @@ import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.RemoteException; +import android.telephony.AccessNetworkConstants; import android.telephony.AccessNetworkConstants.AccessNetworkType; import android.telephony.Annotation.ApnType; import android.util.Log; @@ -129,17 +130,36 @@ public abstract class QualifiedNetworksService extends Service { } /** - * Update the qualified networks list. Network availability provider must invoke this method - * whenever the qualified networks changes. If this method is never invoked for certain - * APN types, then frameworks will always use the default (i.e. cellular) data and network - * service. + * Update the suggested qualified networks list. Network availability provider must invoke + * this method whenever the suggested qualified networks changes. If this method is never + * invoked for certain APN types, then frameworks uses its own logic to determine the + * transport to setup the data network. * - * @param apnTypes APN types of the qualified networks. This must be a bitmask combination - * of {@link ApnType}. - * @param qualifiedNetworkTypes List of network types which are qualified for data - * connection setup for {@link @apnType} in the preferred order. Each element in the list - * is a {@link AccessNetworkType}. An empty list indicates no networks are qualified - * for data setup. + * For example, QNS can suggest frameworks setting up IMS data network on IWLAN by + * specifying {@link ApnSetting#TYPE_IMS} with a list containing + * {@link AccessNetworkType#IWLAN}. + * + * If QNS considers multiple access networks qualified for certain APN type, it can + * suggest frameworks by specifying the APN type with multiple access networks in the list, + * for example {{@link AccessNetworkType#EUTRAN}, {@link AccessNetworkType#IWLAN}}. + * Frameworks will then first attempt to setup data on LTE network, and If the device moves + * from LTE to UMTS, then frameworks will perform handover the data network to the second + * preferred access network if available. + * + * If the {@code qualifiedNetworkTypes} list is empty, it means QNS has no suggestion to the + * frameworks, and for that APN type frameworks will route the corresponding network + * requests to {@link AccessNetworkConstants#TRANSPORT_TYPE_WWAN}. + * + * @param apnTypes APN type(s) of the qualified networks. This must be a bitmask combination + * of {@link ApnType}. The same qualified networks will be applicable to all APN types + * specified here. + * @param qualifiedNetworkTypes List of access network types which are qualified for data + * connection setup for {@code apnTypes} in the preferred order. Empty list means QNS has no + * suggestion to the frameworks, and for that APN type frameworks will route the + * corresponding network requests to {@link AccessNetworkConstants#TRANSPORT_TYPE_WWAN}. + * + * If one of the element is invalid, for example, {@link AccessNetworkType#UNKNOWN}, then + * this operation becomes a no-op. */ public final void updateQualifiedNetworkTypes( @ApnType int apnTypes, @NonNull List qualifiedNetworkTypes) {