diff options
| author | 2019-06-14 16:56:05 -0700 | |
|---|---|---|
| committer | 2019-06-17 18:29:09 -0700 | |
| commit | b2ab846cf4529142382f7de6ec9b1e77998db22c (patch) | |
| tree | fa1f8edead27f5ab11fda51568b40f500e0b6485 | |
| parent | 807a82b3aade518f5140233cb930c484c82e6416 (diff) | |
Use TM SubId in getDataState and getDataActivity
-Update getDataState() API to use the SubId specified
by the TelephonyManager instance.
-Update the getDataActivity() API to use the SubId
specified by the TelephonyManager instance.
Bug: 135205433
Test: manual (automated test is infeasible)
Change-Id: Icf27eab40b1f979892123dc4185db2a138c1ffc2
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 6 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 30 |
2 files changed, 28 insertions, 8 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 3ae9b33cb145..c955efbe6632 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -4733,7 +4733,8 @@ public class TelephonyManager { ITelephony telephony = getITelephony(); if (telephony == null) return DATA_ACTIVITY_NONE; - return telephony.getDataActivity(); + return telephony.getDataActivity( + getSubId(SubscriptionManager.getActiveDataSubscriptionId())); } catch (RemoteException ex) { // the phone process is restarting. return DATA_ACTIVITY_NONE; @@ -4781,7 +4782,8 @@ public class TelephonyManager { ITelephony telephony = getITelephony(); if (telephony == null) return DATA_DISCONNECTED; - return telephony.getDataState(); + return telephony.getDataState( + getSubId(SubscriptionManager.getActiveDataSubscriptionId())); } catch (RemoteException ex) { // the phone process is restarting. return DATA_DISCONNECTED; diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 1aba95bf5e5a..4de19173965b 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -308,18 +308,36 @@ interface ITelephony { */ List<NeighboringCellInfo> getNeighboringCellInfo(String callingPkg); - @UnsupportedAppUsage - int getCallState(); + @UnsupportedAppUsage + int getCallState(); /** * Returns the call state for a slot. */ int getCallStateForSlot(int slotIndex); - @UnsupportedAppUsage - int getDataActivity(); - @UnsupportedAppUsage - int getDataState(); + /** + * Returns a constant indicating the type of activity on a data connection + * (cellular). + * + * @see #DATA_ACTIVITY_NONE + * @see #DATA_ACTIVITY_IN + * @see #DATA_ACTIVITY_OUT + * @see #DATA_ACTIVITY_INOUT + * @see #DATA_ACTIVITY_DORMANT + */ + int getDataActivity(int subId); + + /** + * Returns a constant indicating the current data connection state + * (cellular). + * + * @see #DATA_DISCONNECTED + * @see #DATA_CONNECTING + * @see #DATA_CONNECTED + * @see #DATA_SUSPENDED + */ + int getDataState(int subId); /** * Returns the current active phone type as integer. |