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

Commit 0362e870 authored by Sanket Padawe's avatar Sanket Padawe Committed by Android Git Automerger
Browse files

am 7e21fa5a: Data Usage tab title should say "Cellular" with only 1 sim and wifi tab.

* commit '7e21fa5a':
  Data Usage tab title should say "Cellular" with only 1 sim and wifi tab.
parents 60d2ee87 7e21fa5a
Loading
Loading
Loading
Loading
+12 −5
Original line number Original line Diff line number Diff line
@@ -670,10 +670,12 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
        final Context context = getActivity();
        final Context context = getActivity();
        mTabHost.clearAllTabs();
        mTabHost.clearAllTabs();


        for (int i = 0; i < mTelephonyManager.getSimCount(); i++) {
        int simCount = mTelephonyManager.getSimCount();

        for (int i = 0; i < simCount; i++) {
            final SubscriptionInfo sir = Utils.findRecordBySlotId(context, i);
            final SubscriptionInfo sir = Utils.findRecordBySlotId(context, i);
            if (sir != null) {
            if (sir != null) {
                addMobileTab(context, sir);
                addMobileTab(context, sir, (simCount > 1));
            }
            }
        }
        }


@@ -2672,11 +2674,16 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
            }
            }
        };
        };


        private void addMobileTab(Context context, SubscriptionInfo subInfo) {
        private void addMobileTab(Context context, SubscriptionInfo subInfo, boolean isMultiSim) {
            if (subInfo != null && mMobileTagMap != null) {
            if (subInfo != null && mMobileTagMap != null) {
                if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
                if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
                    if (isMultiSim) {
                        mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
                        mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
                                subInfo.getDisplayName()));
                                subInfo.getDisplayName()));
                    } else {
                        mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
                                R.string.data_usage_tab_mobile));
                    }
                }
                }
            } else {
            } else {
                if (LOGD) Log.d(TAG, "addMobileTab: subInfoList is null");
                if (LOGD) Log.d(TAG, "addMobileTab: subInfoList is null");