Use TelephonyManager#getSimOperatorName for Carrier WiFi

Bug: 179092121
Test: Manual Test
Change-Id: I3f58bd446afefd860bc8b28bcccb9a5c28958ba0
This commit is contained in:
yinxu
2021-02-05 15:31:58 -08:00
parent 4415e09852
commit 4c478ca37f
3 changed files with 5 additions and 13 deletions

View File

@@ -343,16 +343,8 @@ public class MobileSignalController extends SignalController<MobileState, Mobile
return Utils.isInService(mServiceState);
}
String getNonDefaultCarrierName() {
if (!mCurrentState.networkNameData.equals(mNetworkNameDefault)) {
return mCurrentState.networkNameData;
} else if (mSubscriptionInfo.getCarrierName() != null) {
return mSubscriptionInfo.getCarrierName().toString();
} else if (mSubscriptionInfo.getDisplayName() != null) {
return mSubscriptionInfo.getDisplayName().toString();
} else {
return "";
}
String getNetworkNameForCarrierWiFi() {
return mPhone.getSimOperatorName();
}
private boolean isRoaming() {

View File

@@ -528,9 +528,9 @@ public class NetworkControllerImpl extends BroadcastReceiver
return mConnectedTransports.get(NetworkCapabilities.TRANSPORT_ETHERNET);
}
String getNonDefaultMobileDataNetworkName(int subId) {
String getNetworkNameForCarrierWiFi(int subId) {
MobileSignalController controller = getControllerWithSubId(subId);
return controller != null ? controller.getNonDefaultCarrierName() : "";
return controller != null ? controller.getNetworkNameForCarrierWiFi() : "";
}
private void notifyControllersMobileDataChanged() {

View File

@@ -147,7 +147,7 @@ public class WifiSignalController extends
IconState qsIcon = new IconState(
mCurrentState.connected, getQsCurrentIconIdForCarrierWifi(), contentDescription);
CharSequence description =
mNetworkController.getNonDefaultMobileDataNetworkName(mCurrentState.subId);
mNetworkController.getNetworkNameForCarrierWiFi(mCurrentState.subId);
callback.setMobileDataIndicators(statusIcon, qsIcon, typeIcon, qsTypeIcon,
mCurrentState.activityIn, mCurrentState.activityOut, dataContentDescription,
dataContentDescriptionHtml, description, icons.isWide,