Merge "Provider model CarrierItem's subtitle show no connection" into sc-dev am: 826a146c20

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13922069

Change-Id: I26dca0c67486767ad996fe29869e06848f5d8bbe
This commit is contained in:
SongFerng Wang
2021-03-22 08:14:49 +00:00
committed by Automerger Merge Worker
3 changed files with 68 additions and 61 deletions

View File

@@ -24,6 +24,7 @@ import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
@@ -231,6 +232,7 @@ public class ProviderModelSliceHelper {
}
private String getMobileSummary(String networkTypeDescription) {
final WifiManager wifiManager = mContext.getSystemService(WifiManager.class);
String summary = networkTypeDescription;
if (isDataSimActive()) {
summary = mContext.getString(R.string.preference_summary_default_combination,
@@ -238,6 +240,8 @@ public class ProviderModelSliceHelper {
networkTypeDescription);
} else if (!isMobileDataEnabled()) {
summary = mContext.getString(R.string.mobile_data_off_summary);
} else if (!wifiManager.isWifiEnabled() && !isDataSimActive()) {
summary = mContext.getString(R.string.mobile_data_no_connection);
}
return summary;
}