Merge "[Provider Model] Should show "Connected" and highlight carrier layout as well if connected to W+" into sc-qpr1-dev
This commit is contained in:
@@ -303,7 +303,8 @@ public class InternetDialog extends SystemUIDialog implements
|
|||||||
mInternetDialogSubTitle.setText(getSubtitleText());
|
mInternetDialogSubTitle.setText(getSubtitleText());
|
||||||
}
|
}
|
||||||
updateEthernet();
|
updateEthernet();
|
||||||
setMobileDataLayout(mInternetDialogController.activeNetworkIsCellular());
|
setMobileDataLayout(mInternetDialogController.activeNetworkIsCellular()
|
||||||
|
|| mInternetDialogController.isCarrierNetworkActive());
|
||||||
|
|
||||||
if (!mCanConfigWifi) {
|
if (!mCanConfigWifi) {
|
||||||
return;
|
return;
|
||||||
@@ -355,7 +356,7 @@ public class InternetDialog extends SystemUIDialog implements
|
|||||||
mInternetDialogController.hasEthernet() ? View.VISIBLE : View.GONE);
|
mInternetDialogController.hasEthernet() ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMobileDataLayout(boolean isCellularNetwork) {
|
private void setMobileDataLayout(boolean isCarrierNetworkConnected) {
|
||||||
if (mInternetDialogController.isAirplaneModeEnabled()
|
if (mInternetDialogController.isAirplaneModeEnabled()
|
||||||
|| !mInternetDialogController.hasCarrier()) {
|
|| !mInternetDialogController.hasCarrier()) {
|
||||||
mMobileNetworkLayout.setVisibility(View.GONE);
|
mMobileNetworkLayout.setVisibility(View.GONE);
|
||||||
@@ -371,13 +372,13 @@ public class InternetDialog extends SystemUIDialog implements
|
|||||||
mMobileSummaryText.setVisibility(View.GONE);
|
mMobileSummaryText.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
mSignalIcon.setImageDrawable(getSignalStrengthDrawable());
|
mSignalIcon.setImageDrawable(getSignalStrengthDrawable());
|
||||||
mMobileTitleText.setTextAppearance(isCellularNetwork
|
mMobileTitleText.setTextAppearance(isCarrierNetworkConnected
|
||||||
? R.style.TextAppearance_InternetDialog_Active
|
? R.style.TextAppearance_InternetDialog_Active
|
||||||
: R.style.TextAppearance_InternetDialog);
|
: R.style.TextAppearance_InternetDialog);
|
||||||
mMobileSummaryText.setTextAppearance(isCellularNetwork
|
mMobileSummaryText.setTextAppearance(isCarrierNetworkConnected
|
||||||
? R.style.TextAppearance_InternetDialog_Secondary_Active
|
? R.style.TextAppearance_InternetDialog_Secondary_Active
|
||||||
: R.style.TextAppearance_InternetDialog_Secondary);
|
: R.style.TextAppearance_InternetDialog_Secondary);
|
||||||
mMobileNetworkLayout.setBackground(isCellularNetwork ? mBackgroundOn : null);
|
mMobileNetworkLayout.setBackground(isCarrierNetworkConnected ? mBackgroundOn : null);
|
||||||
|
|
||||||
mMobileDataToggle.setVisibility(mCanConfigMobileData ? View.VISIBLE : View.INVISIBLE);
|
mMobileDataToggle.setVisibility(mCanConfigMobileData ? View.VISIBLE : View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,9 +370,12 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback,
|
|||||||
drawable = shared.get();
|
drawable = shared.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
drawable.setTint(activeNetworkIsCellular() ? mContext.getColor(
|
int tintColor = Utils.getColorAttrDefaultColor(mContext,
|
||||||
R.color.connected_network_primary_color) : Utils.getColorAttrDefaultColor(
|
android.R.attr.textColorTertiary);
|
||||||
mContext, android.R.attr.textColorTertiary));
|
if (activeNetworkIsCellular() || isCarrierNetworkActive()) {
|
||||||
|
tintColor = mContext.getColor(R.color.connected_network_primary_color);
|
||||||
|
}
|
||||||
|
drawable.setTint(tintColor);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -533,9 +536,7 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int resId = mapIconSets(config).get(iconKey).dataContentDescription;
|
int resId = mapIconSets(config).get(iconKey).dataContentDescription;
|
||||||
final MergedCarrierEntry mergedCarrierEntry =
|
if (isCarrierNetworkActive()) {
|
||||||
mAccessPointController.getMergedCarrierEntry();
|
|
||||||
if (mergedCarrierEntry != null && mergedCarrierEntry.isDefaultNetwork()) {
|
|
||||||
SignalIcon.MobileIconGroup carrierMergedWifiIconGroup =
|
SignalIcon.MobileIconGroup carrierMergedWifiIconGroup =
|
||||||
TelephonyIcons.CARRIER_MERGED_WIFI;
|
TelephonyIcons.CARRIER_MERGED_WIFI;
|
||||||
resId = carrierMergedWifiIconGroup.dataContentDescription;
|
resId = carrierMergedWifiIconGroup.dataContentDescription;
|
||||||
@@ -554,7 +555,7 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback,
|
|||||||
return context.getString(R.string.mobile_data_no_connection);
|
return context.getString(R.string.mobile_data_no_connection);
|
||||||
}
|
}
|
||||||
String summary = networkTypeDescription;
|
String summary = networkTypeDescription;
|
||||||
if (activeNetworkIsCellular()) {
|
if (activeNetworkIsCellular() || isCarrierNetworkActive()) {
|
||||||
summary = context.getString(R.string.preference_summary_default_combination,
|
summary = context.getString(R.string.preference_summary_default_combination,
|
||||||
context.getString(R.string.mobile_data_connection_active),
|
context.getString(R.string.mobile_data_connection_active),
|
||||||
networkTypeDescription);
|
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() {
|
WifiManager getWifiManager() {
|
||||||
return mWifiManager;
|
return mWifiManager;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user