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

Commit bfb5e1de authored by Zoey Chen's avatar Zoey Chen Committed by Automerger Merge Worker
Browse files

Merge "[Provider Model] Should show "Connected" and highlight carrier layout...

Merge "[Provider Model] Should show "Connected" and highlight carrier layout as well if connected to W+" into sc-qpr1-dev am: 2494a839 am: 5965d3bf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15838313

Change-Id: Ife69aaa22d9fc82c1d34316785f679a1d2551131
parents a6ec05e0 5965d3bf
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -303,7 +303,8 @@ public class InternetDialog extends SystemUIDialog implements
            mInternetDialogSubTitle.setText(getSubtitleText());
        }
        updateEthernet();
        setMobileDataLayout(mInternetDialogController.activeNetworkIsCellular());
        setMobileDataLayout(mInternetDialogController.activeNetworkIsCellular()
                || mInternetDialogController.isCarrierNetworkActive());

        if (!mCanConfigWifi) {
            return;
@@ -355,7 +356,7 @@ public class InternetDialog extends SystemUIDialog implements
                mInternetDialogController.hasEthernet() ? View.VISIBLE : View.GONE);
    }

    private void setMobileDataLayout(boolean isCellularNetwork) {
    private void setMobileDataLayout(boolean isCarrierNetworkConnected) {
        if (mInternetDialogController.isAirplaneModeEnabled()
                || !mInternetDialogController.hasCarrier()) {
            mMobileNetworkLayout.setVisibility(View.GONE);
@@ -371,13 +372,13 @@ public class InternetDialog extends SystemUIDialog implements
                mMobileSummaryText.setVisibility(View.GONE);
            }
            mSignalIcon.setImageDrawable(getSignalStrengthDrawable());
            mMobileTitleText.setTextAppearance(isCellularNetwork
            mMobileTitleText.setTextAppearance(isCarrierNetworkConnected
                    ? R.style.TextAppearance_InternetDialog_Active
                    : R.style.TextAppearance_InternetDialog);
            mMobileSummaryText.setTextAppearance(isCellularNetwork
            mMobileSummaryText.setTextAppearance(isCarrierNetworkConnected
                    ? R.style.TextAppearance_InternetDialog_Secondary_Active
                    : R.style.TextAppearance_InternetDialog_Secondary);
            mMobileNetworkLayout.setBackground(isCellularNetwork ? mBackgroundOn : null);
            mMobileNetworkLayout.setBackground(isCarrierNetworkConnected ? mBackgroundOn : null);

            mMobileDataToggle.setVisibility(mCanConfigMobileData ? View.VISIBLE : View.INVISIBLE);
        }
+14 −7
Original line number Diff line number Diff line
@@ -370,9 +370,12 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback,
                drawable = shared.get();
            }

            drawable.setTint(activeNetworkIsCellular() ? mContext.getColor(
                    R.color.connected_network_primary_color) : Utils.getColorAttrDefaultColor(
                    mContext, android.R.attr.textColorTertiary));
            int tintColor = Utils.getColorAttrDefaultColor(mContext,
                    android.R.attr.textColorTertiary);
            if (activeNetworkIsCellular() || isCarrierNetworkActive()) {
                tintColor = mContext.getColor(R.color.connected_network_primary_color);
            }
            drawable.setTint(tintColor);
        } catch (Throwable e) {
            e.printStackTrace();
        }
@@ -533,9 +536,7 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback,
        }

        int resId = mapIconSets(config).get(iconKey).dataContentDescription;
        final MergedCarrierEntry mergedCarrierEntry =
                mAccessPointController.getMergedCarrierEntry();
        if (mergedCarrierEntry != null && mergedCarrierEntry.isDefaultNetwork()) {
        if (isCarrierNetworkActive()) {
            SignalIcon.MobileIconGroup carrierMergedWifiIconGroup =
                    TelephonyIcons.CARRIER_MERGED_WIFI;
            resId = carrierMergedWifiIconGroup.dataContentDescription;
@@ -554,7 +555,7 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback,
            return context.getString(R.string.mobile_data_no_connection);
        }
        String summary = networkTypeDescription;
        if (activeNetworkIsCellular()) {
        if (activeNetworkIsCellular() || isCarrierNetworkActive()) {
            summary = context.getString(R.string.preference_summary_default_combination,
                    context.getString(R.string.mobile_data_connection_active),
                    networkTypeDescription);
@@ -583,6 +584,12 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback,
        }
    }

    boolean isCarrierNetworkActive() {
        final MergedCarrierEntry mergedCarrierEntry =
                mAccessPointController.getMergedCarrierEntry();
        return mergedCarrierEntry != null && mergedCarrierEntry.isDefaultNetwork();
    }

    WifiManager getWifiManager() {
        return mWifiManager;
    }