Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab437c75 authored by Michele's avatar Michele
Browse files

Removed direct usage of resource to check if voice capable.

Bug: 143289541
Test: make
Change-Id: I84c707262c3e527e6e8e735ddf85212e56e0b688
parent 2176b8d1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -504,8 +504,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        * This will be false on "data only" devices which can't make voice
        * calls and don't support any in-call UI.
        */
        mIsVoiceCapable = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_voice_capable);
        mIsVoiceCapable = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE))
                .isVoiceCapable();

        /**
         *  Some RIL's don't always send RIL_UNSOL_CALL_RING so it needs
+3 −5
Original line number Diff line number Diff line
@@ -606,8 +606,9 @@ public class ServiceStateTracker extends Handler {
                .makeEriManager(mPhone, EriManager.ERI_FROM_XML);

        mRatRatcheter = new RatRatcheter(mPhone);
        mVoiceCapable = mPhone.getContext().getResources().getBoolean(
                com.android.internal.R.bool.config_voice_capable);
        mVoiceCapable = ((TelephonyManager) mPhone.getContext()
                .getSystemService(Context.TELEPHONY_SERVICE))
                .isVoiceCapable();
        mUiccController = UiccController.getInstance();

        mUiccController.registerForIccChanged(this, EVENT_ICC_CHANGED, null);
@@ -2085,9 +2086,6 @@ public class ServiceStateTracker extends Handler {

                    mGsmRoaming = regCodeIsRoaming(registrationState);
                    mNewRejectCode = reasonForDenial;

                    boolean isVoiceCapable = mPhone.getContext().getResources()
                            .getBoolean(com.android.internal.R.bool.config_voice_capable);
                } else {
                    int roamingIndicator = voiceSpecificStates.roamingIndicator;

+1 −2
Original line number Diff line number Diff line
@@ -2172,8 +2172,7 @@ public class SubscriptionController extends ISub.Stub {
    @Override
    public int getDefaultSubId() {
        int subId;
        boolean isVoiceCapable = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_voice_capable);
        boolean isVoiceCapable = mTelephonyManager.isVoiceCapable();
        if (isVoiceCapable) {
            subId = getDefaultVoiceSubId();
            if (VDBG) logdl("[getDefaultSubId] isVoiceCapable subId=" + subId);
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ public class ImsPhoneTest extends TelephonyTest {
        doReturn(Call.State.IDLE).when(mRingingCall).getState();
        doReturn(mExecutor).when(mContext).getMainExecutor();

        mContextFixture.putBooleanResource(com.android.internal.R.bool.config_voice_capable, true);
        doReturn(true).when(mTelephonyManager).isVoiceCapable();

        mImsPhoneUT = new ImsPhone(mContext, mNotifier, mPhone, true);