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

Commit 5b4c495b authored by Nivedita Sarkar's avatar Nivedita Sarkar Committed by Steve Kondik
Browse files

Fix for data and roaming icons

- Enable data connected flag based on the data state.

- Do not display data icon in data connected state
if radio type is unknown

- Show service if either voice/data is in
service if ro.config.combined_signal is true

- Consider eri only when in service

- Add in service check to isCdmaEri.
roaming related information
in registration state will not be valid
during out of service

Change-Id: I915421a6f5906d80ed5b8dd9c433115ad5df1f14
CRs-Fixed: 303275, 326204, 326634, 333008, 339297
parent 69fd8992
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2025,5 +2025,7 @@

    <!-- Configuration to enable non-default PDP during IWLAN -->
    <bool name="config_feature_iwlan_enabled">false</bool>

    <!-- set to false if we dont need to consider data
         service state to display signal strength bars -->
    <bool name="config_combined_signal">true</bool>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -1875,6 +1875,7 @@
  <java-symbol type="string" name="usb_storage_stop_title" />
  <java-symbol type="string" name="usb_storage_title" />
  <java-symbol type="style" name="Animation.RecentApplications" />
  <java-symbol type="bool" name="config_combined_signal" />

  <!-- ImfTest -->
  <java-symbol type="layout" name="auto_complete_list" />
+23 −8
Original line number Diff line number Diff line
@@ -634,6 +634,17 @@ public class NetworkControllerImpl extends BroadcastReceiver
                        + " dataState=" + state.getDataRegState());
            }
            mServiceState = state;
            if (mContext.getResources().getBoolean(
                    com.android.internal.R.bool.config_combined_signal)) {
                /*
                 * if combined_signal is set to true only then consider data
                 * service state for signal display
                 */
                mDataServiceState = mServiceState.getDataRegState();
                if (DEBUG) {
                    Log.d(TAG, "Combining data service state " + mDataServiceState + " for signal");
                }
            }
            updateIconSet();
            updateTelephonySignalStrength();
            updateDataNetType();
@@ -833,15 +844,16 @@ public class NetworkControllerImpl extends BroadcastReceiver
            Log.d(TAG, "updateTelephonySignalStrength: hasService=" + hasService()
                    + " ss=" + mSignalStrength);
        }
        if (!hasService()) {
            if (CHATTY) Log.d(TAG, "updateTelephonySignalStrength: !hasService()");
        if (!hasService() &&
              (mDataServiceState != ServiceState.STATE_IN_SERVICE)) {
            if (CHATTY) Log.d(TAG, "updateTelephonySignalStrength: No Service");
            mPhoneSignalIconId = TelephonyIcons.getSignalNullIcon();
            mQSPhoneSignalIconId = R.drawable.ic_qs_signal_no_signal;
            mDataSignalIconId = mPhoneSignalIconId;
            mContentDescriptionPhoneSignal = TelephonyIcons.getSignalStrengthDes(0);
        } else {
            if (mSignalStrength == null || (mServiceState == null)) {
                if (CHATTY) Log.d(TAG, "updateTelephonySignalStrength: mSignalStrength == null");
                if (CHATTY) Log.d(TAG, "updateTelephonySignalStrength: mSignalStrength == null mServiceState == null");
                mPhoneSignalIconId = TelephonyIcons.getSignalNullIcon();
                mQSPhoneSignalIconId = R.drawable.ic_qs_signal_no_signal;
                mDataSignalIconId = mPhoneSignalIconId;
@@ -907,7 +919,6 @@ public class NetworkControllerImpl extends BroadcastReceiver
            mContentDescriptionDataType = TelephonyIcons.getDataTypeDesc();
            mQSDataTypeIconId = TelephonyIcons.getQSDataTypeIcon();
        }

        if (isCdma()) {
            if (isCdmaEri()) {
                mDataTypeIconId = TelephonyIcons.ROAMING_ICON;
@@ -926,7 +937,8 @@ public class NetworkControllerImpl extends BroadcastReceiver
    }

    boolean isCdmaEri() {
        if (mServiceState != null) {
        if ((mServiceState != null)
                && (hasService() || (mDataServiceState == ServiceState.STATE_IN_SERVICE))) {
            final int iconIndex = mServiceState.getCdmaEriIconIndex();
            if (iconIndex != EriInfo.ROAMING_INDICATOR_OFF) {
                final int iconMode = mServiceState.getCdmaEriIconMode();
@@ -960,12 +972,15 @@ public class NetworkControllerImpl extends BroadcastReceiver
    private final void updateDataIcon() {
        int iconId = 0;
        boolean visible = true;
        if (!isCdma()) {
        if (mDataNetType == TelephonyManager.NETWORK_TYPE_UNKNOWN) {
            // If data network type is unknown do not display data icon
            visible = false;
        } else if (!isCdma()) {
            // GSM case, we have to check also the sim state
            if (mSimState == IccCardConstants.State.READY ||
                    mSimState == IccCardConstants.State.UNKNOWN) {
                mNoSim = false;
                if (hasService() && mDataState == TelephonyManager.DATA_CONNECTED) {
                if (mDataState == TelephonyManager.DATA_CONNECTED) {
                    iconId = TelephonyIcons.getDataActivity(mDataActivity);
                } else {
                    iconId = 0;
@@ -978,7 +993,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
            }
        } else {
            // CDMA case, mDataActivity can be also DATA_ACTIVITY_DORMANT
            if (hasService() && mDataState == TelephonyManager.DATA_CONNECTED) {
            if (mDataState == TelephonyManager.DATA_CONNECTED) {
                iconId = TelephonyIcons.getDataActivity(mDataActivity);
            } else {
                iconId = 0;
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ public class ServiceState implements Parcelable {
    private int mSystemId;
    private int mCdmaRoamingIndicator;
    private int mCdmaDefaultRoamingIndicator;
    private int mCdmaEriIconIndex;
    private int mCdmaEriIconIndex = 1; //EriInfo.ROAMING_INDICATOR_OFF;;
    private int mCdmaEriIconMode;

    /**