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

Commit d8952d3f authored by Sindhu Kanathur's avatar Sindhu Kanathur Committed by Steve Kondik
Browse files

MSIM: Retrieve the QS Data icon through PhoneId

While updating the quick settings data icon,
use Msim API to get the icon.

CRs-Fixed: 743707

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java

Change-Id: I6d106e2d03c92eabb7be92f0cf1957489beca0fe
parent 28355c57
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -801,9 +801,9 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
                mMSimDataTypeIconId[phoneId] =
                        TelephonyIcons.getDataTypeIcon(phoneId);
                mMSimContentDescriptionDataType[phoneId] =
                        TelephonyIcons.getDataTypeDesc();
                        TelephonyIcons.getDataTypeDesc(phoneId);
                mQSDataTypeIconId =
                        TelephonyIcons.getQSDataTypeIcon();
                        TelephonyIcons.getQSDataTypeIcon(phoneId);
            }
        }

+24 −16
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ class TelephonyIcons {

    static int[] mSelectedDataTypeIcon;
    static int[] mSelectedQSDataTypeIcon;
    static String mSelectedDataTypeDesc;
    static String[] mSelectedDataTypeDesc;
    static int[] mSelectedDataActivityIndex;
    static int[] mSelectedSignalStreagthIndex;

@@ -310,6 +310,10 @@ class TelephonyIcons {
            && mDataTypeArray.length != 0) {
            mSelectedQSDataTypeIcon = new int[mDataTypeArray.length];
        }
        if (mSelectedDataTypeDesc == null
            && mDataTypeArray.length != 0) {
            mSelectedDataTypeDesc = new String[mDataTypeArray.length];
        }
        if (mSelectedDataActivityIndex == null
            && mDataActivityArray.length != 0) {
            mSelectedDataActivityIndex = new int[mDataActivityArray.length];
@@ -378,7 +382,7 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = 0;
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedDataActivityIndex[sub] = 0;
                    mSelectedSignalStreagthIndex[sub] = 0;
                    break;
@@ -390,7 +394,7 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_E[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedDataActivityIndex[sub] = DATA_TYPE_E;
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_E;
                    break;
@@ -403,7 +407,7 @@ class TelephonyIcons {
                mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                        dataTypeArray[type], null, NS);
                mSelectedQSDataTypeIcon[sub] = QS_DATA_3G[inetCondition];
                mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_UMTS;
                break;
            case TelephonyManager.NETWORK_TYPE_HSDPA:
@@ -414,14 +418,14 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_H[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_H;
                } else {
                    mSelectedDataActivityIndex[sub] = DATA_TYPE_3G;
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            mDataTypeGenerationArray[0], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_3G[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeGenerationDescArray[0];
                    mSelectedDataTypeDesc[sub] = mDataTypeGenerationDescArray[0];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_3G;

                }
@@ -431,7 +435,7 @@ class TelephonyIcons {
                mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                        dataTypeArray[type], null, NS);
                mSelectedQSDataTypeIcon[sub] = QS_DATA_HP[inetCondition];
                mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_HP;
                break;
            case TelephonyManager.NETWORK_TYPE_CDMA:
@@ -440,7 +444,7 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_1X[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_CDMA;
                    break;
                } else {
@@ -452,7 +456,7 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_1X[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_1X;
                    break;
                } else {
@@ -466,7 +470,7 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_3G[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_3G;
                break;
            case TelephonyManager.NETWORK_TYPE_LTE:
@@ -475,14 +479,14 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            mDataTypeGenerationArray[1], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_4G[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeGenerationDescArray[1];
                    mSelectedDataTypeDesc[sub] = mDataTypeGenerationDescArray[1];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_4G;
                } else {
                    mSelectedDataActivityIndex[sub] = DATA_TYPE_LTE;
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_LTE[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_4G;
                }
                break;
@@ -493,14 +497,14 @@ class TelephonyIcons {
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            dataTypeArray[type], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_G[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeDescriptionArray[type];
                    mSelectedDataTypeDesc[sub] = mDataTypeDescriptionArray[type];
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_G;
                } else {
                    mSelectedDataActivityIndex[sub] = DATA_TYPE_3G;
                    mSelectedDataTypeIcon[sub] = mRes.getIdentifier(
                            mDataTypeGenerationArray[0], null, NS);
                    mSelectedQSDataTypeIcon[sub] = QS_DATA_3G[inetCondition];
                    mSelectedDataTypeDesc = mDataTypeGenerationDescArray[0];;
                    mSelectedDataTypeDesc[sub] = mDataTypeGenerationDescArray[0];;
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_3G;
                }
                break;
@@ -508,7 +512,7 @@ class TelephonyIcons {
                    mSelectedDataActivityIndex[sub] = DATA_TYPE_UNKNOWN;
                    mSelectedDataTypeIcon[sub] = 0;
                    mSelectedQSDataTypeIcon[sub] = 0;
                    mSelectedDataTypeDesc = "";
                    mSelectedDataTypeDesc[sub] = "";
                    mSelectedSignalStreagthIndex[sub] = SIGNAL_STRENGTH_TYPE_G;
                break;
        }
@@ -543,7 +547,11 @@ class TelephonyIcons {
    }

    static String getDataTypeDesc() {
        return mSelectedDataTypeDesc;
        return mSelectedDataTypeDesc[DEFAULT_SUB];
    }

    static String getDataTypeDesc(int sub) {
        return mSelectedDataTypeDesc[sub];
    }

    static int getDataActivity(int activity){