From 795c077bfe7afff506cb00a227e9efaf6ad0bb9d Mon Sep 17 00:00:00 2001 From: Aswin Sankar Date: Thu, 20 Oct 2022 11:58:45 -0700 Subject: [PATCH 1/2] Introduce new resource overlay for Virtual DSDA - "Virtual DSDA" functionality is planned for P22+ on Android U. - New flag "virtual_dsda_enabled" denotes support for in-call IMS connectivity on both subs with just single active logical modem / data line. Bug: 249857869 Test: Live test for incoming call reception on 2nd sub. New UTs: TelephonyConnectionServiceTest#testSecondCallDifferentSubWontDisconnectForDsdaDevice() TelephonyConnectionServiceTest#testDontDisconnectDifferentSubForDsdaDevice() Change-Id: I42dc44afe17546deabdae303c4a48892dc5d5e8c --- core/res/res/values/config_telephony.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/res/res/values/config_telephony.xml b/core/res/res/values/config_telephony.xml index 71b2f00ff2b15..f2a16d355ed7b 100644 --- a/core/res/res/values/config_telephony.xml +++ b/core/res/res/values/config_telephony.xml @@ -130,4 +130,9 @@ true, routing from the android emergency number database will be ignored. --> false + + + false + From 000e5e9ec4c2bcfc33dae2b678a3c68f0007432e Mon Sep 17 00:00:00 2001 From: Aswin Sankar Date: Thu, 20 Oct 2022 15:59:17 -0700 Subject: [PATCH 2/2] PhoneCapability Builder to override fields - Builder will allow overriding fields not filled in by HAL today, such as maxActiveVoiceSubscriptions. Bug: 249857869 Test: make Change-Id: Ic8be6d291e04d7bef77b04bdae29d754928d7f4e --- .../android/telephony/PhoneCapability.java | 147 +++++++++++++++++- 1 file changed, 142 insertions(+), 5 deletions(-) diff --git a/telephony/java/android/telephony/PhoneCapability.java b/telephony/java/android/telephony/PhoneCapability.java index 63e3468ac19b8..48170dfd0e54d 100644 --- a/telephony/java/android/telephony/PhoneCapability.java +++ b/telephony/java/android/telephony/PhoneCapability.java @@ -90,7 +90,9 @@ public final class PhoneCapability implements Parcelable { /** * mMaxActiveVoiceSubscriptions defines the maximum subscriptions that can support * simultaneous voice calls. For a dual sim dual standby (DSDS) device it would be one, but - * for a dual sim dual active device it would be 2. + * for a dual sim dual active (DSDA) device, or a DSDS device that supports "virtual DSDA" ( + * using the data line of 1 SIM to temporarily provide IMS voice connectivity to the other SIM) + * it would be 2. * * @hide */ @@ -99,7 +101,7 @@ public final class PhoneCapability implements Parcelable { /** * mMaxActiveDataSubscriptions defines the maximum subscriptions that can support * simultaneous data connections. - * For example, for L+L device it should be 2. + * For example, for dual sim dual active L+L device it should be 2. * * @hide */ @@ -114,14 +116,20 @@ public final class PhoneCapability implements Parcelable { */ private final boolean mNetworkValidationBeforeSwitchSupported; - /** @hide */ - private final List mLogicalModemList; - /** * List of logical modem information. * * @hide */ + @NonNull + private final List mLogicalModemList; + + /** + * Device NR capabilities. + * + * @hide + */ + @NonNull private final int[] mDeviceNrCapabilities; /** @hide */ @@ -136,6 +144,18 @@ public final class PhoneCapability implements Parcelable { this.mDeviceNrCapabilities = deviceNrCapabilities; } + private PhoneCapability(@NonNull Builder builder) { + this.mMaxActiveVoiceSubscriptions = builder.mMaxActiveVoiceSubscriptions; + this.mMaxActiveDataSubscriptions = builder.mMaxActiveDataSubscriptions; + // Make sure it's not null. + this.mLogicalModemList = builder.mLogicalModemList == null ? new ArrayList<>() + : builder.mLogicalModemList; + this.mNetworkValidationBeforeSwitchSupported = + builder.mNetworkValidationBeforeSwitchSupported; + this.mDeviceNrCapabilities = builder.mDeviceNrCapabilities; + + } + @Override public String toString() { return "mMaxActiveVoiceSubscriptions=" + mMaxActiveVoiceSubscriptions @@ -264,4 +284,121 @@ public final class PhoneCapability implements Parcelable { public @NonNull @DeviceNrCapability int[] getDeviceNrCapabilities() { return mDeviceNrCapabilities == null ? (new int[0]) : mDeviceNrCapabilities; } + + + /** + * Builder for {@link PhoneCapability}. + * + * @hide + */ + public static class Builder { + /** + * mMaxActiveVoiceSubscriptions defines the maximum subscriptions that can support + * simultaneous voice calls. For a dual sim dual standby (DSDS) device it would be one, but + * for a dual sim dual active (DSDA) device, or a DSDS device that supports "virtual DSDA" + * (using the data line of 1 SIM to temporarily provide IMS voice connectivity to the other + * SIM) it would be 2. + * + * @hide + */ + private int mMaxActiveVoiceSubscriptions = 0; + + /** + * mMaxActiveDataSubscriptions defines the maximum subscriptions that can support + * simultaneous data connections. For example, for L+L device it should be 2. + * + * @hide + */ + private int mMaxActiveDataSubscriptions = 0; + + /** + * Whether modem supports both internet PDN up so that we can do ping test before tearing + * down the other one. + * + * @hide + */ + private boolean mNetworkValidationBeforeSwitchSupported = false; + + /** + * List of logical modem information. + * + * @hide + */ + @NonNull + private List mLogicalModemList = new ArrayList<>(); + + /** + * Device NR capabilities. + * + * @hide + */ + @NonNull + private int[] mDeviceNrCapabilities = new int[0]; + + /** + * Default constructor. + */ + public Builder() { + } + + public Builder(@NonNull PhoneCapability phoneCapability) { + mMaxActiveVoiceSubscriptions = phoneCapability.mMaxActiveVoiceSubscriptions; + mMaxActiveDataSubscriptions = phoneCapability.mMaxActiveDataSubscriptions; + mNetworkValidationBeforeSwitchSupported = + phoneCapability.mNetworkValidationBeforeSwitchSupported; + mLogicalModemList = phoneCapability.mLogicalModemList; + mDeviceNrCapabilities = phoneCapability.mDeviceNrCapabilities; + } + + /** + * Sets the max active voice subscriptions supported by the device. + */ + public Builder setMaxActiveVoiceSubscriptions(int maxActiveVoiceSubscriptions) { + mMaxActiveVoiceSubscriptions = maxActiveVoiceSubscriptions; + return this; + } + + /** + * Sets the max active voice subscriptions supported by the device. + */ + public Builder setMaxActiveDataSubscriptions(int maxActiveDataSubscriptions) { + mMaxActiveDataSubscriptions = maxActiveDataSubscriptions; + return this; + } + + /** + * Sets the max active data subscriptions supported by the device. Can be fewer than the + * active voice subscriptions. + */ + public Builder setNetworkValidationBeforeSwitchSupported( + boolean networkValidationBeforeSwitchSupported) { + mNetworkValidationBeforeSwitchSupported = networkValidationBeforeSwitchSupported; + return this; + } + + /** + * Sets the logical modem list of the device. + */ + public Builder setLogicalModemList(@NonNull List logicalModemList) { + mLogicalModemList = logicalModemList; + return this; + } + + /** + * Sets the NR capabilities supported by the device. + */ + public Builder setDeviceNrCapabilities(@NonNull int[] deviceNrCapabilities) { + mDeviceNrCapabilities = deviceNrCapabilities; + return this; + } + + /** + * Build the {@link PhoneCapability}. + * + * @return The {@link PhoneCapability} instance. + */ + public PhoneCapability build() { + return new PhoneCapability(this); + } + } }