summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorPavel Zhamaitsiak <pavelz@google.com>2015-03-30 16:21:17 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-03-30 16:21:17 +0000
commit271c9edc3039cbcabd2b7cadeead8c96bb785d8f (patch)
tree362ec4f614c05df1221da075c144444c29592776 /packages
parent998fb1975f37881ee07a9f74d723bd742ac64363 (diff)
parent5fd843b33383266cfe5f79f7ba4c5134c104cda0 (diff)
downloadframeworks_base-271c9edc3039cbcabd2b7cadeead8c96bb785d8f.zip
frameworks_base-271c9edc3039cbcabd2b7cadeead8c96bb785d8f.tar.gz
frameworks_base-271c9edc3039cbcabd2b7cadeead8c96bb785d8f.tar.bz2
Merge "WiFi Calling: Show different operator name string in Data usage dialog." into lmp-mr1-wfc-dev
automerge: 5fd843b * commit '5fd843b33383266cfe5f79f7ba4c5134c104cda0': WiFi Calling: Show different operator name string in Data usage dialog.
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/NetworkControllerImpl.java29
2 files changed, 26 insertions, 5 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/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 9a7f21e..07ba04e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -277,9 +277,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() {
@@ -1039,6 +1039,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
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.
@@ -1274,6 +1275,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
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();
@@ -1302,14 +1304,18 @@ public class NetworkControllerImpl extends BroadcastReceiver
/**
* 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) {
@@ -1322,6 +1328,17 @@ public class NetworkControllerImpl extends BroadcastReceiver
} 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;
+ }
}
/**
@@ -1450,6 +1467,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
static class MobileState extends SignalController.State {
String networkName;
+ String networkNameData;
boolean dataSim;
boolean dataConnected;
boolean isEmergency;
@@ -1462,6 +1480,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
MobileState state = (MobileState) s;
dataSim = state.dataSim;
networkName = state.networkName;
+ networkNameData = state.networkNameData;
dataConnected = state.dataConnected;
inetForNetwork = state.inetForNetwork;
isEmergency = state.isEmergency;
@@ -1474,6 +1493,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
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(',');
@@ -1484,6 +1504,7 @@ public class NetworkControllerImpl extends BroadcastReceiver
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