[Telphony Fix] Update notifyDataActivityForSubscriber()
Update notifyDataActivityForSubscriber() method for phone id support Bug: 284258406 Test: atest TelephonyRegistryTests & atest DefaultPhoneNotifierTests Test: Device validation b/285299825 & b/285295292 Change-Id: Iec80d3fb24b555aa6c7bdf6c594fbe86eeb73cb9
This commit is contained in:
@@ -490,13 +490,16 @@ public class TelephonyRegistryManager {
|
||||
/**
|
||||
* Notify changes to activity state changes on certain subscription.
|
||||
*
|
||||
* @param slotIndex for which data activity changed. Can be derived from subId except
|
||||
* when subId is invalid.
|
||||
* @param subId for which data activity state changed.
|
||||
* @param dataActivityType indicates the latest data activity type e.g, {@link
|
||||
* TelephonyManager#DATA_ACTIVITY_IN}
|
||||
*/
|
||||
public void notifyDataActivityChanged(int subId, @DataActivityType int dataActivityType) {
|
||||
public void notifyDataActivityChanged(int slotIndex, int subId,
|
||||
@DataActivityType int dataActivityType) {
|
||||
try {
|
||||
sRegistry.notifyDataActivityForSubscriber(subId, dataActivityType);
|
||||
sRegistry.notifyDataActivityForSubscriber(slotIndex, subId, dataActivityType);
|
||||
} catch (RemoteException ex) {
|
||||
// system process is dead
|
||||
throw ex.rethrowFromSystemServer();
|
||||
|
||||
@@ -60,9 +60,7 @@ interface ITelephonyRegistry {
|
||||
@UnsupportedAppUsage(maxTargetSdk = 28)
|
||||
void notifyCallForwardingChanged(boolean cfi);
|
||||
void notifyCallForwardingChangedForSubscriber(in int subId, boolean cfi);
|
||||
@UnsupportedAppUsage(maxTargetSdk = 28)
|
||||
void notifyDataActivity(int state);
|
||||
void notifyDataActivityForSubscriber(in int subId, int state);
|
||||
void notifyDataActivityForSubscriber(int phoneId, int subId, int state);
|
||||
void notifyDataConnectionForSubscriber(
|
||||
int phoneId, int subId, in PreciseDataConnectionState preciseState);
|
||||
// Uses CellIdentity which is Parcelable here; will convert to CellLocation in client.
|
||||
|
||||
@@ -2093,20 +2093,24 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyDataActivity(int state) {
|
||||
notifyDataActivityForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, state);
|
||||
}
|
||||
|
||||
public void notifyDataActivityForSubscriber(int subId, int state) {
|
||||
/**
|
||||
* Send a notification to registrants about the data activity state.
|
||||
*
|
||||
* @param phoneId the phoneId carrying the data connection
|
||||
* @param subId the subscriptionId for the data connection
|
||||
* @param state indicates the latest data activity type
|
||||
* e.g.,{@link TelephonyManager#DATA_ACTIVITY_IN}
|
||||
*
|
||||
*/
|
||||
public void notifyDataActivityForSubscriber(int phoneId, int subId, int state) {
|
||||
if (!checkNotifyPermission("notifyDataActivity()" )) {
|
||||
return;
|
||||
}
|
||||
int phoneId = getPhoneIdFromSubId(subId);
|
||||
|
||||
synchronized (mRecords) {
|
||||
if (validatePhoneId(phoneId)) {
|
||||
mDataActivity[phoneId] = state;
|
||||
for (Record r : mRecords) {
|
||||
// Notify by correct subId.
|
||||
if (r.matchTelephonyCallbackEvent(
|
||||
TelephonyCallback.EVENT_DATA_ACTIVITY_CHANGED)
|
||||
&& idMatch(r, subId, phoneId)) {
|
||||
|
||||
Reference in New Issue
Block a user