Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +41 −0 Original line number Diff line number Diff line Loading @@ -2376,6 +2376,24 @@ public class GsmCdmaPhone extends Phone { return false; } /** * Checks the availability of Ut directly without SsDomainController. * This is only applicable for the case that the terminal-based call waiting service * is handled by the IMS service alone without interworking with CallWaitingController. */ private boolean useCallWaitingOverUt(Message onComplete) { Phone imsPhone = mImsPhone; if (imsPhone == null) { logd("useCallWaitingOverUt: called for GsmCdma"); return false; } boolean isUtEnabled = imsPhone.isUtEnabled(); Rlog.d(LOG_TAG, "useCallWaitingOverUt isUtEnabled= " + isUtEnabled + " isCsRetry(onComplete))= " + isCsRetry(onComplete)); return isUtEnabled && !isCsRetry(onComplete); } /** * Returns whether CSFB is supported for supplementary services. */ Loading @@ -2383,6 +2401,14 @@ public class GsmCdmaPhone extends Phone { return mSsDomainController.supportCsfb(); } /** * Returns whether the carrier supports the terminal-based call waiting service * and Ims service handles it by itself. */ private boolean getOemHandlesTerminalBasedCallWaiting() { return mSsDomainController.getOemHandlesTerminalBasedCallWaiting(); } /** * Sends response indicating no nework is available for supplementary services. */ Loading Loading @@ -2742,6 +2768,13 @@ public class GsmCdmaPhone extends Phone { responseInvalidState(onComplete); return; } } else if (getOemHandlesTerminalBasedCallWaiting()) { // Ims service handles the terminal-based call waiting service by itself. // Use legacy implementation. Forward the request to Ims service if Ut is available. if (useCallWaitingOverUt(onComplete)) { imsPhone.getCallWaiting(onComplete); return; } } if (isPhoneTypeGsm()) { Loading Loading @@ -2800,6 +2833,13 @@ public class GsmCdmaPhone extends Phone { responseInvalidState(onComplete); return; } } else if (getOemHandlesTerminalBasedCallWaiting()) { // Ims service handles the terminal-based call waiting service by itself. // Use legacy implementation. Forward the request to Ims service if Ut is available. if (useCallWaitingOverUt(onComplete)) { imsPhone.setCallWaiting(enable, onComplete); return; } } if (isPhoneTypeGsm()) { Loading Loading @@ -2840,6 +2880,7 @@ public class GsmCdmaPhone extends Phone { @Override public void setTerminalBasedCallWaitingSupported(boolean supported) { mCallWaitingController.setTerminalBasedCallWaitingSupported(supported); mSsDomainController.setOemHandlesTerminalBasedCallWaiting(!supported); } @Override Loading src/java/com/android/internal/telephony/SsDomainController.java +60 −9 Original line number Diff line number Diff line Loading @@ -127,10 +127,6 @@ public class SsDomainController { public static final String SS_COLP = "COLP"; public static final String SS_COLR = "COLR"; // Common instance indicating that Ut is available. public static final SuppServiceRoutingInfo SS_ROUTING_OVER_UT = new SuppServiceRoutingInfo(true, true, true); // Barring list of incoming numbers public static final String CB_FACILITY_BIL = "BIL"; // Barring of all anonymous incoming number Loading Loading @@ -174,6 +170,9 @@ public class SsDomainController { private Set<Integer> mUtAvailableRats = new HashSet<>(); private boolean mWiFiAvailable = false; private boolean mIsMonitoringConnectivity = false; /** true if Ims service handles the terminal-based call waiting service by itself. */ private boolean mOemHandlesTerminalBasedCallWaiting = false; private boolean mSupportsTerminalBasedCallWaiting = false; public SsDomainController(GsmCdmaPhone phone) { mPhone = phone; Loading Loading @@ -204,13 +203,16 @@ public class SsDomainController { int[] utRats = b.getIntArray( CarrierConfigManager.ImsSs.KEY_XCAP_OVER_UT_SUPPORTED_RATS_INT_ARRAY); int[] tbServices = b.getIntArray( CarrierConfigManager.ImsSs.KEY_UT_TERMINAL_BASED_SERVICES_INT_ARRAY); updateSsOverUtConfig(supportsUt, supportsCsfb, requiresImsRegistration, availableWhenPsDataOff, availableWhenRoaming, services, utRats); availableWhenPsDataOff, availableWhenRoaming, services, utRats, tbServices); } private void updateSsOverUtConfig(boolean supportsUt, boolean supportsCsfb, boolean requiresImsRegistration, boolean availableWhenPsDataOff, boolean availableWhenRoaming, int[] services, int[] utRats) { boolean availableWhenRoaming, int[] services, int[] utRats, int[] tbServices) { mUtSupported = supportsUt; mCsfbSupported = supportsCsfb; Loading @@ -218,6 +220,18 @@ public class SsDomainController { mUtAvailableWhenPsDataOff = availableWhenPsDataOff; mUtAvailableWhenRoaming = availableWhenRoaming; mSupportsTerminalBasedCallWaiting = false; if (tbServices != null) { for (int tbService : tbServices) { if (tbService == SUPPLEMENTARY_SERVICE_CW) { mSupportsTerminalBasedCallWaiting = true; break; } } } Rlog.i(LOG_TAG, "updateSsOverUtConfig terminal-based cw " + mSupportsTerminalBasedCallWaiting); mCbOverUtSupported.clear(); mCfOverUtSupported.clear(); mSsOverUtSupported.clear(); Loading Loading @@ -521,9 +535,24 @@ public class SsDomainController { * Only for ImsPhoneMmiCode. */ public SuppServiceRoutingInfo getSuppServiceRoutingInfoForSs(String service) { if (SS_CW.equals(service) && getOemHandlesTerminalBasedCallWaiting()) { // Ims service handles the terminal based call waiting service by itself. // Use legacy implementation. Forward the request to Ims service if Ut is available. Phone imsPhone = mPhone.getImsPhone(); boolean isUtEnabled = (imsPhone != null) && imsPhone.isUtEnabled(); return new SuppServiceRoutingInfo(true, isUtEnabled, true); } return new SuppServiceRoutingInfo(useSsOverUt(service), isUtEnabled(), supportCsfb()); } /** * Returns SuppServiceRoutingInfo instance for a service will be served by Ut interface. * Only for ImsPhoneMmiCode. */ public SuppServiceRoutingInfo getSsRoutingOverUt() { return new SuppServiceRoutingInfo(true, isUtEnabled(), true); } /** * Set the carrier configuration for test. * Test purpose only. Loading @@ -531,17 +560,37 @@ public class SsDomainController { @VisibleForTesting public void updateCarrierConfigForTest(boolean supportsUt, boolean supportsCsfb, boolean requiresImsRegistration, boolean availableWhenPsDataOff, boolean availableWhenRoaming, int[] services, int[] utRats) { boolean availableWhenRoaming, int[] services, int[] utRats, int[] tbServices) { Rlog.i(LOG_TAG, "updateCarrierConfigForTest supportsUt=" + supportsUt + ", csfb=" + supportsCsfb + ", reg=" + requiresImsRegistration + ", whenPsDataOff=" + availableWhenPsDataOff + ", whenRoaming=" + availableWhenRoaming + ", services=" + Arrays.toString(services) + ", rats=" + Arrays.toString(utRats)); + ", rats=" + Arrays.toString(utRats) + ", tbServices=" + Arrays.toString(tbServices)); updateSsOverUtConfig(supportsUt, supportsCsfb, requiresImsRegistration, availableWhenPsDataOff, availableWhenRoaming, services, utRats); availableWhenPsDataOff, availableWhenRoaming, services, utRats, tbServices); } /** * @param state true if Ims service handles the terminal-based call waiting service by itself. * Otherwise, false. */ public void setOemHandlesTerminalBasedCallWaiting(boolean state) { Rlog.i(LOG_TAG, "setOemHandlesTerminalBasedCallWaiting " + state); mOemHandlesTerminalBasedCallWaiting = state; } /** * Returns whether the carrier supports the terminal-based call waiting service * and Ims service handles it by itself. */ public boolean getOemHandlesTerminalBasedCallWaiting() { Rlog.i(LOG_TAG, "getOemHandlesTerminalBasedCallWaiting " + mSupportsTerminalBasedCallWaiting + ", " + mOemHandlesTerminalBasedCallWaiting); return mSupportsTerminalBasedCallWaiting && mOemHandlesTerminalBasedCallWaiting; } /** Loading @@ -561,6 +610,8 @@ public class SsDomainController { pw.println(" mUtAvailableWhenRoaming=" + mUtAvailableWhenRoaming); pw.println(" mUtAvailableRats=" + mUtAvailableRats); pw.println(" mWiFiAvailable=" + mWiFiAvailable); pw.println(" mOemHandlesTerminalBasedCallWaiting=" + mOemHandlesTerminalBasedCallWaiting); pw.println(" mSupportsTerminalBasedCallWaiting=" + mSupportsTerminalBasedCallWaiting); pw.decreaseIndent(); } } src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java +4 −4 Original line number Diff line number Diff line Loading @@ -542,7 +542,7 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { return controller.getSuppServiceRoutingInfoForCb(scToBarringFacility(sc)); } else if (sc != null && sc.equals(SC_CFUT)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } else if (sc != null && sc.equals(SC_CLIP)) { return controller.getSuppServiceRoutingInfoForSs(SS_CLIP); } else if (sc != null && sc.equals(SC_CLIR)) { Loading @@ -553,7 +553,7 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { return controller.getSuppServiceRoutingInfoForSs(SS_COLR); } else if (sc != null && sc.equals(SC_CNAP)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } else if (sc != null && sc.equals(SC_BS_MT)) { return controller.getSuppServiceRoutingInfoForCb( SsDomainController.CB_FACILITY_BIL); Loading @@ -562,12 +562,12 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { SsDomainController.CB_FACILITY_ACR); } else if (sc != null && sc.equals(SC_PWD)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } else if (sc != null && sc.equals(SC_WAIT)) { return controller.getSuppServiceRoutingInfoForSs(SS_CW); } else if (isPinPukCommand(sc)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } } return null; Loading tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -2178,4 +2178,32 @@ public class GsmCdmaPhoneTest extends TelephonyTest { mPhoneUT.setCallWaiting(false, CommandsInterface.SERVICE_CLASS_VOICE, null); verify(mImsPhone, times(1)).setCallWaiting(eq(false), any()); } @Test @SmallTest public void testOemHandlesTerminalBasedCallWaiting() throws Exception { doReturn(true).when(mImsPhone).isUtEnabled(); replaceInstance(Phone.class, "mImsPhone", mPhoneUT, mImsPhone); // Ut is disabled in config doReturn(false).when(mSsDomainController).useSsOverUt(anyString()); doReturn(false).when(mSsDomainController).getOemHandlesTerminalBasedCallWaiting(); replaceInstance(GsmCdmaPhone.class, "mSsDomainController", mPhoneUT, mSsDomainController); mPhoneUT.getCallWaiting(null); verify(mImsPhone, times(0)).getCallWaiting(any()); mPhoneUT.setCallWaiting(false, CommandsInterface.SERVICE_CLASS_VOICE, null); verify(mImsPhone, times(0)).setCallWaiting(eq(false), any()); // OEM handles the terminal-based call waiting service by itself. doReturn(true).when(mSsDomainController).getOemHandlesTerminalBasedCallWaiting(); mPhoneUT.getCallWaiting(null); verify(mImsPhone, times(1)).getCallWaiting(any()); mPhoneUT.setCallWaiting(false, CommandsInterface.SERVICE_CLASS_VOICE, null); verify(mImsPhone, times(1)).setCallWaiting(eq(false), any()); } } tests/telephonytests/src/com/android/internal/telephony/SsDomainControllerTest.java +25 −2 Original line number Diff line number Diff line Loading @@ -430,6 +430,29 @@ public class SsDomainControllerTest extends TelephonyTest { assertFalse(mSdc.isUtEnabled()); } @Test @SmallTest public void testOemHandlesTerminalBasedCallWaiting() { setUtEnabled(); // Enable terminal-based call waiting mSdc.updateCarrierConfigForTest(true, true, false, true, true, new int[] {}, UT_OVER_ALL, new int[] { SUPPLEMENTARY_SERVICE_CW }); String sc = mServices.get(SS_CW); mSdc.setOemHandlesTerminalBasedCallWaiting(false); SsDomainController.SuppServiceRoutingInfo ssCode = ImsPhoneMmiCode.getSuppServiceRoutingInfo("*#" + sc + "#", mSdc); assertNotNull(ssCode); assertFalse(ssCode.useSsOverUt()); mSdc.setOemHandlesTerminalBasedCallWaiting(true); ssCode = ImsPhoneMmiCode.getSuppServiceRoutingInfo("*#" + sc + "#", mSdc); assertNotNull(ssCode); assertTrue(ssCode.useSsOverUt()); } private void setUtEnabled() { doReturn(0).when(mImsPhone).getSubId(); mSdc.updateWifiForUt(false); Loading Loading @@ -466,10 +489,10 @@ public class SsDomainControllerTest extends TelephonyTest { private void updateCarrierConfig(boolean supportsCsfb, boolean requiresImsRegistration, boolean availableWhenPsDataOff, boolean availableWhenRoaming, int[] utRats) { mSdc.updateCarrierConfigForTest(true, supportsCsfb, requiresImsRegistration, availableWhenPsDataOff, availableWhenRoaming, null, utRats); availableWhenPsDataOff, availableWhenRoaming, null, utRats, null); } private void updateCarrierConfig(int[] services) { mSdc.updateCarrierConfigForTest(true, true, false, true, true, services, UT_OVER_ALL); mSdc.updateCarrierConfigForTest(true, true, false, true, true, services, UT_OVER_ALL, null); } } Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +41 −0 Original line number Diff line number Diff line Loading @@ -2376,6 +2376,24 @@ public class GsmCdmaPhone extends Phone { return false; } /** * Checks the availability of Ut directly without SsDomainController. * This is only applicable for the case that the terminal-based call waiting service * is handled by the IMS service alone without interworking with CallWaitingController. */ private boolean useCallWaitingOverUt(Message onComplete) { Phone imsPhone = mImsPhone; if (imsPhone == null) { logd("useCallWaitingOverUt: called for GsmCdma"); return false; } boolean isUtEnabled = imsPhone.isUtEnabled(); Rlog.d(LOG_TAG, "useCallWaitingOverUt isUtEnabled= " + isUtEnabled + " isCsRetry(onComplete))= " + isCsRetry(onComplete)); return isUtEnabled && !isCsRetry(onComplete); } /** * Returns whether CSFB is supported for supplementary services. */ Loading @@ -2383,6 +2401,14 @@ public class GsmCdmaPhone extends Phone { return mSsDomainController.supportCsfb(); } /** * Returns whether the carrier supports the terminal-based call waiting service * and Ims service handles it by itself. */ private boolean getOemHandlesTerminalBasedCallWaiting() { return mSsDomainController.getOemHandlesTerminalBasedCallWaiting(); } /** * Sends response indicating no nework is available for supplementary services. */ Loading Loading @@ -2742,6 +2768,13 @@ public class GsmCdmaPhone extends Phone { responseInvalidState(onComplete); return; } } else if (getOemHandlesTerminalBasedCallWaiting()) { // Ims service handles the terminal-based call waiting service by itself. // Use legacy implementation. Forward the request to Ims service if Ut is available. if (useCallWaitingOverUt(onComplete)) { imsPhone.getCallWaiting(onComplete); return; } } if (isPhoneTypeGsm()) { Loading Loading @@ -2800,6 +2833,13 @@ public class GsmCdmaPhone extends Phone { responseInvalidState(onComplete); return; } } else if (getOemHandlesTerminalBasedCallWaiting()) { // Ims service handles the terminal-based call waiting service by itself. // Use legacy implementation. Forward the request to Ims service if Ut is available. if (useCallWaitingOverUt(onComplete)) { imsPhone.setCallWaiting(enable, onComplete); return; } } if (isPhoneTypeGsm()) { Loading Loading @@ -2840,6 +2880,7 @@ public class GsmCdmaPhone extends Phone { @Override public void setTerminalBasedCallWaitingSupported(boolean supported) { mCallWaitingController.setTerminalBasedCallWaitingSupported(supported); mSsDomainController.setOemHandlesTerminalBasedCallWaiting(!supported); } @Override Loading
src/java/com/android/internal/telephony/SsDomainController.java +60 −9 Original line number Diff line number Diff line Loading @@ -127,10 +127,6 @@ public class SsDomainController { public static final String SS_COLP = "COLP"; public static final String SS_COLR = "COLR"; // Common instance indicating that Ut is available. public static final SuppServiceRoutingInfo SS_ROUTING_OVER_UT = new SuppServiceRoutingInfo(true, true, true); // Barring list of incoming numbers public static final String CB_FACILITY_BIL = "BIL"; // Barring of all anonymous incoming number Loading Loading @@ -174,6 +170,9 @@ public class SsDomainController { private Set<Integer> mUtAvailableRats = new HashSet<>(); private boolean mWiFiAvailable = false; private boolean mIsMonitoringConnectivity = false; /** true if Ims service handles the terminal-based call waiting service by itself. */ private boolean mOemHandlesTerminalBasedCallWaiting = false; private boolean mSupportsTerminalBasedCallWaiting = false; public SsDomainController(GsmCdmaPhone phone) { mPhone = phone; Loading Loading @@ -204,13 +203,16 @@ public class SsDomainController { int[] utRats = b.getIntArray( CarrierConfigManager.ImsSs.KEY_XCAP_OVER_UT_SUPPORTED_RATS_INT_ARRAY); int[] tbServices = b.getIntArray( CarrierConfigManager.ImsSs.KEY_UT_TERMINAL_BASED_SERVICES_INT_ARRAY); updateSsOverUtConfig(supportsUt, supportsCsfb, requiresImsRegistration, availableWhenPsDataOff, availableWhenRoaming, services, utRats); availableWhenPsDataOff, availableWhenRoaming, services, utRats, tbServices); } private void updateSsOverUtConfig(boolean supportsUt, boolean supportsCsfb, boolean requiresImsRegistration, boolean availableWhenPsDataOff, boolean availableWhenRoaming, int[] services, int[] utRats) { boolean availableWhenRoaming, int[] services, int[] utRats, int[] tbServices) { mUtSupported = supportsUt; mCsfbSupported = supportsCsfb; Loading @@ -218,6 +220,18 @@ public class SsDomainController { mUtAvailableWhenPsDataOff = availableWhenPsDataOff; mUtAvailableWhenRoaming = availableWhenRoaming; mSupportsTerminalBasedCallWaiting = false; if (tbServices != null) { for (int tbService : tbServices) { if (tbService == SUPPLEMENTARY_SERVICE_CW) { mSupportsTerminalBasedCallWaiting = true; break; } } } Rlog.i(LOG_TAG, "updateSsOverUtConfig terminal-based cw " + mSupportsTerminalBasedCallWaiting); mCbOverUtSupported.clear(); mCfOverUtSupported.clear(); mSsOverUtSupported.clear(); Loading Loading @@ -521,9 +535,24 @@ public class SsDomainController { * Only for ImsPhoneMmiCode. */ public SuppServiceRoutingInfo getSuppServiceRoutingInfoForSs(String service) { if (SS_CW.equals(service) && getOemHandlesTerminalBasedCallWaiting()) { // Ims service handles the terminal based call waiting service by itself. // Use legacy implementation. Forward the request to Ims service if Ut is available. Phone imsPhone = mPhone.getImsPhone(); boolean isUtEnabled = (imsPhone != null) && imsPhone.isUtEnabled(); return new SuppServiceRoutingInfo(true, isUtEnabled, true); } return new SuppServiceRoutingInfo(useSsOverUt(service), isUtEnabled(), supportCsfb()); } /** * Returns SuppServiceRoutingInfo instance for a service will be served by Ut interface. * Only for ImsPhoneMmiCode. */ public SuppServiceRoutingInfo getSsRoutingOverUt() { return new SuppServiceRoutingInfo(true, isUtEnabled(), true); } /** * Set the carrier configuration for test. * Test purpose only. Loading @@ -531,17 +560,37 @@ public class SsDomainController { @VisibleForTesting public void updateCarrierConfigForTest(boolean supportsUt, boolean supportsCsfb, boolean requiresImsRegistration, boolean availableWhenPsDataOff, boolean availableWhenRoaming, int[] services, int[] utRats) { boolean availableWhenRoaming, int[] services, int[] utRats, int[] tbServices) { Rlog.i(LOG_TAG, "updateCarrierConfigForTest supportsUt=" + supportsUt + ", csfb=" + supportsCsfb + ", reg=" + requiresImsRegistration + ", whenPsDataOff=" + availableWhenPsDataOff + ", whenRoaming=" + availableWhenRoaming + ", services=" + Arrays.toString(services) + ", rats=" + Arrays.toString(utRats)); + ", rats=" + Arrays.toString(utRats) + ", tbServices=" + Arrays.toString(tbServices)); updateSsOverUtConfig(supportsUt, supportsCsfb, requiresImsRegistration, availableWhenPsDataOff, availableWhenRoaming, services, utRats); availableWhenPsDataOff, availableWhenRoaming, services, utRats, tbServices); } /** * @param state true if Ims service handles the terminal-based call waiting service by itself. * Otherwise, false. */ public void setOemHandlesTerminalBasedCallWaiting(boolean state) { Rlog.i(LOG_TAG, "setOemHandlesTerminalBasedCallWaiting " + state); mOemHandlesTerminalBasedCallWaiting = state; } /** * Returns whether the carrier supports the terminal-based call waiting service * and Ims service handles it by itself. */ public boolean getOemHandlesTerminalBasedCallWaiting() { Rlog.i(LOG_TAG, "getOemHandlesTerminalBasedCallWaiting " + mSupportsTerminalBasedCallWaiting + ", " + mOemHandlesTerminalBasedCallWaiting); return mSupportsTerminalBasedCallWaiting && mOemHandlesTerminalBasedCallWaiting; } /** Loading @@ -561,6 +610,8 @@ public class SsDomainController { pw.println(" mUtAvailableWhenRoaming=" + mUtAvailableWhenRoaming); pw.println(" mUtAvailableRats=" + mUtAvailableRats); pw.println(" mWiFiAvailable=" + mWiFiAvailable); pw.println(" mOemHandlesTerminalBasedCallWaiting=" + mOemHandlesTerminalBasedCallWaiting); pw.println(" mSupportsTerminalBasedCallWaiting=" + mSupportsTerminalBasedCallWaiting); pw.decreaseIndent(); } }
src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java +4 −4 Original line number Diff line number Diff line Loading @@ -542,7 +542,7 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { return controller.getSuppServiceRoutingInfoForCb(scToBarringFacility(sc)); } else if (sc != null && sc.equals(SC_CFUT)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } else if (sc != null && sc.equals(SC_CLIP)) { return controller.getSuppServiceRoutingInfoForSs(SS_CLIP); } else if (sc != null && sc.equals(SC_CLIR)) { Loading @@ -553,7 +553,7 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { return controller.getSuppServiceRoutingInfoForSs(SS_COLR); } else if (sc != null && sc.equals(SC_CNAP)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } else if (sc != null && sc.equals(SC_BS_MT)) { return controller.getSuppServiceRoutingInfoForCb( SsDomainController.CB_FACILITY_BIL); Loading @@ -562,12 +562,12 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { SsDomainController.CB_FACILITY_ACR); } else if (sc != null && sc.equals(SC_PWD)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } else if (sc != null && sc.equals(SC_WAIT)) { return controller.getSuppServiceRoutingInfoForSs(SS_CW); } else if (isPinPukCommand(sc)) { // for backward compatibility, not specified by CarrierConfig return SsDomainController.SS_ROUTING_OVER_UT; return controller.getSsRoutingOverUt(); } } return null; Loading
tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -2178,4 +2178,32 @@ public class GsmCdmaPhoneTest extends TelephonyTest { mPhoneUT.setCallWaiting(false, CommandsInterface.SERVICE_CLASS_VOICE, null); verify(mImsPhone, times(1)).setCallWaiting(eq(false), any()); } @Test @SmallTest public void testOemHandlesTerminalBasedCallWaiting() throws Exception { doReturn(true).when(mImsPhone).isUtEnabled(); replaceInstance(Phone.class, "mImsPhone", mPhoneUT, mImsPhone); // Ut is disabled in config doReturn(false).when(mSsDomainController).useSsOverUt(anyString()); doReturn(false).when(mSsDomainController).getOemHandlesTerminalBasedCallWaiting(); replaceInstance(GsmCdmaPhone.class, "mSsDomainController", mPhoneUT, mSsDomainController); mPhoneUT.getCallWaiting(null); verify(mImsPhone, times(0)).getCallWaiting(any()); mPhoneUT.setCallWaiting(false, CommandsInterface.SERVICE_CLASS_VOICE, null); verify(mImsPhone, times(0)).setCallWaiting(eq(false), any()); // OEM handles the terminal-based call waiting service by itself. doReturn(true).when(mSsDomainController).getOemHandlesTerminalBasedCallWaiting(); mPhoneUT.getCallWaiting(null); verify(mImsPhone, times(1)).getCallWaiting(any()); mPhoneUT.setCallWaiting(false, CommandsInterface.SERVICE_CLASS_VOICE, null); verify(mImsPhone, times(1)).setCallWaiting(eq(false), any()); } }
tests/telephonytests/src/com/android/internal/telephony/SsDomainControllerTest.java +25 −2 Original line number Diff line number Diff line Loading @@ -430,6 +430,29 @@ public class SsDomainControllerTest extends TelephonyTest { assertFalse(mSdc.isUtEnabled()); } @Test @SmallTest public void testOemHandlesTerminalBasedCallWaiting() { setUtEnabled(); // Enable terminal-based call waiting mSdc.updateCarrierConfigForTest(true, true, false, true, true, new int[] {}, UT_OVER_ALL, new int[] { SUPPLEMENTARY_SERVICE_CW }); String sc = mServices.get(SS_CW); mSdc.setOemHandlesTerminalBasedCallWaiting(false); SsDomainController.SuppServiceRoutingInfo ssCode = ImsPhoneMmiCode.getSuppServiceRoutingInfo("*#" + sc + "#", mSdc); assertNotNull(ssCode); assertFalse(ssCode.useSsOverUt()); mSdc.setOemHandlesTerminalBasedCallWaiting(true); ssCode = ImsPhoneMmiCode.getSuppServiceRoutingInfo("*#" + sc + "#", mSdc); assertNotNull(ssCode); assertTrue(ssCode.useSsOverUt()); } private void setUtEnabled() { doReturn(0).when(mImsPhone).getSubId(); mSdc.updateWifiForUt(false); Loading Loading @@ -466,10 +489,10 @@ public class SsDomainControllerTest extends TelephonyTest { private void updateCarrierConfig(boolean supportsCsfb, boolean requiresImsRegistration, boolean availableWhenPsDataOff, boolean availableWhenRoaming, int[] utRats) { mSdc.updateCarrierConfigForTest(true, supportsCsfb, requiresImsRegistration, availableWhenPsDataOff, availableWhenRoaming, null, utRats); availableWhenPsDataOff, availableWhenRoaming, null, utRats, null); } private void updateCarrierConfig(int[] services) { mSdc.updateCarrierConfigForTest(true, true, false, true, true, services, UT_OVER_ALL); mSdc.updateCarrierConfigForTest(true, true, false, true, true, services, UT_OVER_ALL, null); } }