Add a SubId to getDataState and getDataActivity
Both getDataState and getDataActivity should work
on multiple data subIds rather than just the default.
This fix will make the data state explicit by subId
and avoid any potential ambiguity during windows where
data is changing between subIds.
Bug: 135205433
Test: manual (automated testing for PIM infeasible)
Change-Id: I426f35e97a96972ab22c969024ba056b11873a8c
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index f2c15bc..425ad36 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1868,10 +1868,10 @@
}
@Override
- public int getDataState() {
+ public int getDataState(int subId) {
final long identity = Binder.clearCallingIdentity();
try {
- Phone phone = getPhone(mSubscriptionController.getDefaultDataSubId());
+ final Phone phone = getPhone(subId);
if (phone != null) {
return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
} else {
@@ -1884,10 +1884,10 @@
}
@Override
- public int getDataActivity() {
+ public int getDataActivity(int subId) {
final long identity = Binder.clearCallingIdentity();
try {
- Phone phone = getPhone(mSubscriptionController.getDefaultDataSubId());
+ final Phone phone = getPhone(subId);
if (phone != null) {
return DefaultPhoneNotifier.convertDataActivityState(phone.getDataActivityState());
} else {