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

Commit 9255e464 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Update HD tag on status bar for IMS registration"

parents 206bfea8 b4393f78
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -935,4 +935,5 @@

    <!-- Accessibility string for current zen mode and selected exit condition. A template that simply concatenates existing mode string and the current condition description. [CHAR LIMIT=20] -->
    <string name="zen_mode_and_condition"><xliff:g id="zen_mode" example="Priority interruptions only">%1$s</xliff:g>. <xliff:g id="exit_condition" example="For one hour">%2$s</xliff:g></string>
    <string name="high_definiation_voice">(HD)</string>
</resources>
+16 −1
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.SubInfoRecord;
import android.telephony.TelephonyManager;
import android.telephony.VoLteServiceState;

import android.text.TextUtils;
import android.util.Slog;
import android.view.View;
@@ -253,7 +255,8 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
                                        | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
                                        | PhoneStateListener.LISTEN_CALL_STATE
                                        | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
                                        | PhoneStateListener.LISTEN_DATA_ACTIVITY);
                                        | PhoneStateListener.LISTEN_DATA_ACTIVITY
                                        | PhoneStateListener.LISTEN_VOLTE_STATE);
                    } else {
                        mMSimPhoneStateListener[i] = null;
                    }
@@ -605,6 +608,18 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
                updateDataIcon(phoneId);
                refreshViews(phoneId);
            }

            @Override
            public void onVoLteServiceStateChanged(VoLteServiceState stateInfo) {
                int phoneId = getPhoneId(mSubId);
                if (stateInfo.getSrvccState() == VoLteServiceState.IMS_REGISTERED) {
                    updateImsRegistrationForNewtorkName(true);
                    refreshViews(phoneId);
                } else if (stateInfo.getSrvccState() == VoLteServiceState.IMS_UNREGISTERED) {
                    updateImsRegistrationForNewtorkName(false);
                    refreshViews(phoneId);
                }
            }
        };
        return mMSimPhoneStateListener;
    }
+28 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.telephony.VoLteServiceState;

import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.TelephonyIntents;
@@ -318,7 +319,8 @@ public class NetworkControllerImpl extends BroadcastReceiver
                        | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
                        | PhoneStateListener.LISTEN_CALL_STATE
                        | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
                        | PhoneStateListener.LISTEN_DATA_ACTIVITY);
                        | PhoneStateListener.LISTEN_DATA_ACTIVITY
                        | PhoneStateListener.LISTEN_VOLTE_STATE);
    }

    public void addPhoneSignalIconView(ImageView v) {
@@ -689,6 +691,17 @@ public class NetworkControllerImpl extends BroadcastReceiver
            updateDataIcon();
            refreshViews();
        }

        @Override
        public void onVoLteServiceStateChanged(VoLteServiceState stateInfo) {
            if (stateInfo.getSrvccState() == VoLteServiceState.IMS_REGISTERED) {
                updateImsRegistrationForNewtorkName(true);
                refreshViews();
            } else if (stateInfo.getSrvccState() == VoLteServiceState.IMS_UNREGISTERED) {
                updateImsRegistrationForNewtorkName(false);
                refreshViews();
            }
        }
    };

    private void updateCarrierText() {
@@ -1072,6 +1085,20 @@ public class NetworkControllerImpl extends BroadcastReceiver
        }
        return opeartorName;
    }

    public void updateImsRegistrationForNewtorkName(boolean registered) {
        String hdTag = mContext.getResources().getString(R.string.high_definiation_voice);
        Log.d(TAG, "updateIMSRegistrationForNewtorkName " + hdTag
                + ";" + registered);
        if (registered) {
            mNetworkName = mNetworkName + hdTag;
        } else {
            if (mNetworkName.contains(hdTag)) {
                mNetworkName = mNetworkName.replace(hdTag, "");
            }
        }
    }

    // ===== Wifi ===================================================================

    class WifiHandler extends Handler {
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ public final class VoLteServiceState implements Parcelable {
    public static final int HANDOVER_FAILED    = 2;
    public static final int HANDOVER_CANCELED  = 3;

    public static final int IMS_REGISTERED = 4;
    public static final int IMS_UNREGISTERED = 5;
    private int mSrvccState;

    /**