Loading src/java/com/android/internal/telephony/Phone.java +18 −0 Original line number Diff line number Diff line Loading @@ -640,6 +640,24 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { } } /** * Check if sending CLIR activation("*31#") and deactivation("#31#") code only without dialing * number is prevented. * * @return {@code true} when carrier config * "KEY_PREVENT_CLIR_ACTIVATION_AND_DEACTIVATION_CODE_BOOL" is set to {@code true} */ public boolean isClirActivationAndDeactivationPrevented() { CarrierConfigManager configManager = (CarrierConfigManager) getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE); PersistableBundle b = configManager.getConfigForSubId(getSubId()); if (b == null) { b = CarrierConfigManager.getDefaultConfig(); } return b.getBoolean( CarrierConfigManager.KEY_PREVENT_CLIR_ACTIVATION_AND_DEACTIVATION_CODE_BOOL); } /** * When overridden the derived class needs to call * super.handleMessage(msg) so this method has a Loading src/java/com/android/internal/telephony/gsm/GsmMmiCode.java +2 −2 Original line number Diff line number Diff line Loading @@ -921,10 +921,10 @@ public final class GsmMmiCode extends Handler implements MmiCode { } } else if (mSc != null && mSc.equals(SC_CLIR)) { Rlog.d(LOG_TAG, "processCode: is CLIR"); if (isActivate()) { if (isActivate() && !mPhone.isClirActivationAndDeactivationPrevented()) { mPhone.mCi.setCLIR(CommandsInterface.CLIR_INVOCATION, obtainMessage(EVENT_SET_COMPLETE, this)); } else if (isDeactivate()) { } else if (isDeactivate() && !mPhone.isClirActivationAndDeactivationPrevented()) { mPhone.mCi.setCLIR(CommandsInterface.CLIR_SUPPRESSION, obtainMessage(EVENT_SET_COMPLETE, this)); } else if (isInterrogate()) { Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java +4 −2 Original line number Diff line number Diff line Loading @@ -870,14 +870,16 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { // NOTE: Since these supplementary services are accessed only // via MMI codes, methods have not been added to ImsPhone. // Only the UT interface handle is used. if (isActivate()) { if (isActivate() && !mPhone.getDefaultPhone().isClirActivationAndDeactivationPrevented()) { try { mPhone.mCT.getUtInterface().updateCLIR(CommandsInterface.CLIR_INVOCATION, obtainMessage(EVENT_SET_COMPLETE, this)); } catch (ImsException e) { Rlog.d(LOG_TAG, "processCode: Could not get UT handle for updateCLIR."); } } else if (isDeactivate()) { } else if (isDeactivate() && !mPhone.getDefaultPhone().isClirActivationAndDeactivationPrevented()) { try { mPhone.mCT.getUtInterface().updateCLIR(CommandsInterface.CLIR_SUPPRESSION, obtainMessage(EVENT_SET_COMPLETE, this)); Loading Loading
src/java/com/android/internal/telephony/Phone.java +18 −0 Original line number Diff line number Diff line Loading @@ -640,6 +640,24 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { } } /** * Check if sending CLIR activation("*31#") and deactivation("#31#") code only without dialing * number is prevented. * * @return {@code true} when carrier config * "KEY_PREVENT_CLIR_ACTIVATION_AND_DEACTIVATION_CODE_BOOL" is set to {@code true} */ public boolean isClirActivationAndDeactivationPrevented() { CarrierConfigManager configManager = (CarrierConfigManager) getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE); PersistableBundle b = configManager.getConfigForSubId(getSubId()); if (b == null) { b = CarrierConfigManager.getDefaultConfig(); } return b.getBoolean( CarrierConfigManager.KEY_PREVENT_CLIR_ACTIVATION_AND_DEACTIVATION_CODE_BOOL); } /** * When overridden the derived class needs to call * super.handleMessage(msg) so this method has a Loading
src/java/com/android/internal/telephony/gsm/GsmMmiCode.java +2 −2 Original line number Diff line number Diff line Loading @@ -921,10 +921,10 @@ public final class GsmMmiCode extends Handler implements MmiCode { } } else if (mSc != null && mSc.equals(SC_CLIR)) { Rlog.d(LOG_TAG, "processCode: is CLIR"); if (isActivate()) { if (isActivate() && !mPhone.isClirActivationAndDeactivationPrevented()) { mPhone.mCi.setCLIR(CommandsInterface.CLIR_INVOCATION, obtainMessage(EVENT_SET_COMPLETE, this)); } else if (isDeactivate()) { } else if (isDeactivate() && !mPhone.isClirActivationAndDeactivationPrevented()) { mPhone.mCi.setCLIR(CommandsInterface.CLIR_SUPPRESSION, obtainMessage(EVENT_SET_COMPLETE, this)); } else if (isInterrogate()) { Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java +4 −2 Original line number Diff line number Diff line Loading @@ -870,14 +870,16 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode { // NOTE: Since these supplementary services are accessed only // via MMI codes, methods have not been added to ImsPhone. // Only the UT interface handle is used. if (isActivate()) { if (isActivate() && !mPhone.getDefaultPhone().isClirActivationAndDeactivationPrevented()) { try { mPhone.mCT.getUtInterface().updateCLIR(CommandsInterface.CLIR_INVOCATION, obtainMessage(EVENT_SET_COMPLETE, this)); } catch (ImsException e) { Rlog.d(LOG_TAG, "processCode: Could not get UT handle for updateCLIR."); } } else if (isDeactivate()) { } else if (isDeactivate() && !mPhone.getDefaultPhone().isClirActivationAndDeactivationPrevented()) { try { mPhone.mCT.getUtInterface().updateCLIR(CommandsInterface.CLIR_SUPPRESSION, obtainMessage(EVENT_SET_COMPLETE, this)); Loading