Merge "Use TM SubId in getDataState and getDataActivity"

This commit is contained in:
Nathan Harold
2019-06-18 17:44:15 +00:00
committed by Gerrit Code Review
2 changed files with 28 additions and 8 deletions

View File

@@ -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;

View File

@@ -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.