summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorPavel Zhamaitsiak <pavelz@google.com>2015-05-05 21:05:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-05 21:05:49 +0000
commitb2e3b74418f7fc09f2610bc5620e748d420b5f87 (patch)
tree62c9afd812c65c128a5f8eefd067ea7ba0adfaa3 /packages
parent2b0eaffc6264abb4162c089adf7089b4cfee5719 (diff)
parent5504d39b7f880fa8b8660e5d4b014ec559124cf9 (diff)
downloadframeworks_base-b2e3b74418f7fc09f2610bc5620e748d420b5f87.zip
frameworks_base-b2e3b74418f7fc09f2610bc5620e748d420b5f87.tar.gz
frameworks_base-b2e3b74418f7fc09f2610bc5620e748d420b5f87.tar.bz2
Merge "WiFi Calling: Show different operator name string in Data usage dialog." into mnc-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java25
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java2
4 files changed, 27 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java
index f2b2f66..a7fdadc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java
@@ -162,7 +162,7 @@ public class MobileDataControllerImpl implements NetworkController.MobileDataCon
usage.warningLevel = DEFAULT_WARNING_LEVEL;
}
if (usage != null) {
- usage.carrier = mNetworkController.getMobileNetworkName();
+ usage.carrier = mNetworkController.getMobileDataNetworkName();
}
return usage;
} catch (RemoteException e) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index c3c6b12..22bf47c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -84,6 +84,7 @@ public class MobileSignalController extends SignalController<
mapIconSets();
mLastState.networkName = mCurrentState.networkName = mNetworkNameDefault;
+ mLastState.networkNameData = mCurrentState.networkNameData = mNetworkNameDefault;
mLastState.enabled = mCurrentState.enabled = hasMobileData;
mLastState.iconGroup = mCurrentState.iconGroup = mDefaultIcons;
// Get initial data sim state.
@@ -294,6 +295,7 @@ public class MobileSignalController extends SignalController<
if (action.equals(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION)) {
updateNetworkName(intent.getBooleanExtra(TelephonyIntents.EXTRA_SHOW_SPN, false),
intent.getStringExtra(TelephonyIntents.EXTRA_SPN),
+ intent.getStringExtra(TelephonyIntents.EXTRA_DATA_SPN),
intent.getBooleanExtra(TelephonyIntents.EXTRA_SHOW_PLMN, false),
intent.getStringExtra(TelephonyIntents.EXTRA_PLMN));
notifyListenersIfNecessary();
@@ -322,14 +324,18 @@ public class MobileSignalController extends SignalController<
/**
* Updates the network's name based on incoming spn and plmn.
*/
- void updateNetworkName(boolean showSpn, String spn, boolean showPlmn, String plmn) {
+ void updateNetworkName(boolean showSpn, String spn, String dataSpn,
+ boolean showPlmn, String plmn) {
if (CHATTY) {
- Log.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn
+ Log.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn
+ + " spn=" + spn + " dataSpn=" + dataSpn
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
}
StringBuilder str = new StringBuilder();
+ StringBuilder strData = new StringBuilder();
if (showPlmn && plmn != null) {
str.append(plmn);
+ strData.append(plmn);
}
if (showSpn && spn != null) {
if (str.length() != 0) {
@@ -342,6 +348,17 @@ public class MobileSignalController extends SignalController<
} else {
mCurrentState.networkName = mNetworkNameDefault;
}
+ if (showSpn && dataSpn != null) {
+ if (strData.length() != 0) {
+ strData.append(mNetworkNameSeparator);
+ }
+ strData.append(dataSpn);
+ }
+ if (strData.length() != 0) {
+ mCurrentState.networkNameData = strData.toString();
+ } else {
+ mCurrentState.networkNameData = mNetworkNameDefault;
+ }
}
/**
@@ -492,6 +509,7 @@ public class MobileSignalController extends SignalController<
static class MobileState extends SignalController.State {
String networkName;
+ String networkNameData;
boolean dataSim;
boolean dataConnected;
boolean isEmergency;
@@ -505,6 +523,7 @@ public class MobileSignalController extends SignalController<
MobileState state = (MobileState) s;
dataSim = state.dataSim;
networkName = state.networkName;
+ networkNameData = state.networkNameData;
dataConnected = state.dataConnected;
inetForNetwork = state.inetForNetwork;
isEmergency = state.isEmergency;
@@ -518,6 +537,7 @@ public class MobileSignalController extends SignalController<
builder.append(',');
builder.append("dataSim=").append(dataSim).append(',');
builder.append("networkName=").append(networkName).append(',');
+ builder.append("networkNameData=").append(networkNameData).append(',');
builder.append("dataConnected=").append(dataConnected).append(',');
builder.append("inetForNetwork=").append(inetForNetwork).append(',');
builder.append("isEmergency=").append(isEmergency).append(',');
@@ -529,6 +549,7 @@ public class MobileSignalController extends SignalController<
public boolean equals(Object o) {
return super.equals(o)
&& Objects.equals(((MobileState) o).networkName, networkName)
+ && Objects.equals(((MobileState) o).networkNameData, networkNameData)
&& ((MobileState) o).dataSim == dataSim
&& ((MobileState) o).dataConnected == dataConnected
&& ((MobileState) o).isEmergency == isEmergency
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 6d88535..df133e4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -246,9 +246,9 @@ public class NetworkControllerImpl extends BroadcastReceiver
return mDefaultSignalController;
}
- public String getMobileNetworkName() {
+ public String getMobileDataNetworkName() {
MobileSignalController controller = getDataController();
- return controller != null ? controller.getState().networkName : "";
+ return controller != null ? controller.getState().networkNameData : "";
}
public boolean isEmergencyOnly() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index a176c98..29f461e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -306,6 +306,6 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
}
protected void assertNetworkNameEquals(String expected) {
- assertEquals("Network name", expected, mNetworkController.getMobileNetworkName());
+ assertEquals("Network name", expected, mNetworkController.getMobileDataNetworkName());
}
}