Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +7 −1 Original line number Diff line number Diff line Loading @@ -158,6 +158,10 @@ public class GsmCdmaPhone extends Phone { public static final int RESTART_ECM_TIMER = 0; // restart Ecm timer public static final int CANCEL_ECM_TIMER = 1; // cancel Ecm timer private static final String PREFIX_WPS = "*272"; // WPS prefix when CLIR is being deactivated for the call. private static final String PREFIX_WPS_CLIR_DEACTIVATE = "#31#*272"; // WPS prefix when CLIS is being activated for the call. private static final String PREFIX_WPS_CLIR_ACTIVATE = "*31#*272"; private CdmaSubscriptionSourceManager mCdmaSSM; public int mCdmaSubscriptionSource = CdmaSubscriptionSourceManager.SUBSCRIPTION_SOURCE_UNKNOWN; private PowerManager.WakeLock mWakeLock; Loading Loading @@ -1327,7 +1331,9 @@ public class GsmCdmaPhone extends Phone { (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); /** Check if the call is Wireless Priority Service call */ boolean isWpsCall = dialString != null ? dialString.startsWith(PREFIX_WPS) : false; boolean isWpsCall = dialString != null ? (dialString.startsWith(PREFIX_WPS) || dialString.startsWith(PREFIX_WPS_CLIR_ACTIVATE) || dialString.startsWith(PREFIX_WPS_CLIR_DEACTIVATE)) : false; boolean allowWpsOverIms = configManager.getConfigForSubId(getSubId()) .getBoolean(CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL); Loading tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +78 −3 Original line number Diff line number Diff line Loading @@ -503,8 +503,8 @@ public class GsmCdmaPhoneTest extends TelephonyTest { mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, false); Connection connection = mPhoneUT.dial("*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); mPhoneUT.dial("*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", null, null); verify(mImsCT).hangupAllConnections(); } catch (CallStateException e) { Loading @@ -512,6 +512,44 @@ public class GsmCdmaPhoneTest extends TelephonyTest { } } @Test @SmallTest public void testWpsClirActiveDialOverCs() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, false); mPhoneUT.dial("*31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_SUPPRESSION, null, null); verify(mImsCT).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testWpsClirInactiveDialOverCs() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, false); mPhoneUT.dial("#31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_INVOCATION, null, null); verify(mImsCT).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testWpsDialOverIms() throws Exception { Loading @@ -521,7 +559,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, true); Connection connection = mPhoneUT.dial("*27216505551212", mPhoneUT.dial("*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", null, null); verify(mImsCT, never()).hangupAllConnections(); Loading @@ -530,6 +568,43 @@ public class GsmCdmaPhoneTest extends TelephonyTest { } } @Test @SmallTest public void testWpsClirActiveDialOverIms() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, true); mPhoneUT.dial("*31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_SUPPRESSION, null, null); verify(mImsCT, never()).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testWpsClirInactiveDialOverIms() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, true); mPhoneUT.dial("#31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_INVOCATION, null, null); verify(mImsCT, never()).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testHandlePinMmi() { Loading Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +7 −1 Original line number Diff line number Diff line Loading @@ -158,6 +158,10 @@ public class GsmCdmaPhone extends Phone { public static final int RESTART_ECM_TIMER = 0; // restart Ecm timer public static final int CANCEL_ECM_TIMER = 1; // cancel Ecm timer private static final String PREFIX_WPS = "*272"; // WPS prefix when CLIR is being deactivated for the call. private static final String PREFIX_WPS_CLIR_DEACTIVATE = "#31#*272"; // WPS prefix when CLIS is being activated for the call. private static final String PREFIX_WPS_CLIR_ACTIVATE = "*31#*272"; private CdmaSubscriptionSourceManager mCdmaSSM; public int mCdmaSubscriptionSource = CdmaSubscriptionSourceManager.SUBSCRIPTION_SOURCE_UNKNOWN; private PowerManager.WakeLock mWakeLock; Loading Loading @@ -1327,7 +1331,9 @@ public class GsmCdmaPhone extends Phone { (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); /** Check if the call is Wireless Priority Service call */ boolean isWpsCall = dialString != null ? dialString.startsWith(PREFIX_WPS) : false; boolean isWpsCall = dialString != null ? (dialString.startsWith(PREFIX_WPS) || dialString.startsWith(PREFIX_WPS_CLIR_ACTIVATE) || dialString.startsWith(PREFIX_WPS_CLIR_DEACTIVATE)) : false; boolean allowWpsOverIms = configManager.getConfigForSubId(getSubId()) .getBoolean(CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL); Loading
tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +78 −3 Original line number Diff line number Diff line Loading @@ -503,8 +503,8 @@ public class GsmCdmaPhoneTest extends TelephonyTest { mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, false); Connection connection = mPhoneUT.dial("*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); mPhoneUT.dial("*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", null, null); verify(mImsCT).hangupAllConnections(); } catch (CallStateException e) { Loading @@ -512,6 +512,44 @@ public class GsmCdmaPhoneTest extends TelephonyTest { } } @Test @SmallTest public void testWpsClirActiveDialOverCs() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, false); mPhoneUT.dial("*31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_SUPPRESSION, null, null); verify(mImsCT).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testWpsClirInactiveDialOverCs() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, false); mPhoneUT.dial("#31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_INVOCATION, null, null); verify(mImsCT).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testWpsDialOverIms() throws Exception { Loading @@ -521,7 +559,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, true); Connection connection = mPhoneUT.dial("*27216505551212", mPhoneUT.dial("*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", null, null); verify(mImsCT, never()).hangupAllConnections(); Loading @@ -530,6 +568,43 @@ public class GsmCdmaPhoneTest extends TelephonyTest { } } @Test @SmallTest public void testWpsClirActiveDialOverIms() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, true); mPhoneUT.dial("*31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_SUPPRESSION, null, null); verify(mImsCT, never()).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testWpsClirInactiveDialOverIms() throws Exception { try { setupForWpsCallTest(); mContextFixture.getCarrierConfigBundle().putBoolean( CarrierConfigManager.KEY_SUPPORT_WPS_OVER_IMS_BOOL, true); mPhoneUT.dial("#31#*27216505551212", new PhoneInternalInterface.DialArgs.Builder().build()); verify(mCT).dialGsm("*27216505551212", CommandsInterface.CLIR_INVOCATION, null, null); verify(mImsCT, never()).hangupAllConnections(); } catch (CallStateException e) { fail(); } } @Test @SmallTest public void testHandlePinMmi() { Loading