Merge "[IT4.2] Update argument type of interfaceClassDataActivityChanged"
This commit is contained in:
commit
dcb4051101
@ -85,14 +85,14 @@ oneway interface INetworkManagementEventObserver {
|
||||
/**
|
||||
* Interface data activity status is changed.
|
||||
*
|
||||
* @param label Unique identifier indicates the network type of the data activity change.
|
||||
* @param networkType The legacy network type of the data activity change.
|
||||
* @param active True if the interface is actively transmitting data, false if it is idle.
|
||||
* @param tsNanos Elapsed realtime in nanos when the state of the network interface changed.
|
||||
* @param uid Uid of this event. It represents the uid that was responsible for waking the
|
||||
* radio. For those events that are reported by system itself, not from specific uid,
|
||||
* use -1 for the events which means no uid.
|
||||
*/
|
||||
void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos, int uid);
|
||||
void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos, int uid);
|
||||
|
||||
/**
|
||||
* Information about available DNS servers has been received.
|
||||
|
@ -64,7 +64,7 @@ public class BaseNetworkObserver extends INetworkManagementEventObserver.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos,
|
||||
public void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos,
|
||||
int uid) {
|
||||
// default no-op
|
||||
}
|
||||
|
@ -1792,10 +1792,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
|
||||
private INetworkManagementEventObserver mDataActivityObserver = new BaseNetworkObserver() {
|
||||
@Override
|
||||
public void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos,
|
||||
public void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos,
|
||||
int uid) {
|
||||
int deviceType = Integer.parseInt(label);
|
||||
sendDataActivityBroadcast(deviceType, active, tsNanos);
|
||||
sendDataActivityBroadcast(networkType, active, tsNanos);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -423,7 +423,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
|
||||
|
||||
final boolean active = isActive;
|
||||
invokeForAllObservers(o -> o.interfaceClassDataActivityChanged(
|
||||
Integer.toString(type), active, tsNanos, uid));
|
||||
type, active, tsNanos, uid));
|
||||
|
||||
boolean report = false;
|
||||
synchronized (mIdleTimerLock) {
|
||||
|
@ -167,13 +167,13 @@ public class NetworkManagementServiceTest {
|
||||
* Interface class activity.
|
||||
*/
|
||||
unsolListener.onInterfaceClassActivityChanged(true, 1, 1234, TEST_UID);
|
||||
expectSoon(observer).interfaceClassDataActivityChanged("1", true, 1234, TEST_UID);
|
||||
expectSoon(observer).interfaceClassDataActivityChanged(1, true, 1234, TEST_UID);
|
||||
|
||||
unsolListener.onInterfaceClassActivityChanged(false, 9, 5678, TEST_UID);
|
||||
expectSoon(observer).interfaceClassDataActivityChanged("9", false, 5678, TEST_UID);
|
||||
expectSoon(observer).interfaceClassDataActivityChanged(9, false, 5678, TEST_UID);
|
||||
|
||||
unsolListener.onInterfaceClassActivityChanged(false, 9, 4321, TEST_UID);
|
||||
expectSoon(observer).interfaceClassDataActivityChanged("9", false, 4321, TEST_UID);
|
||||
expectSoon(observer).interfaceClassDataActivityChanged(9, false, 4321, TEST_UID);
|
||||
|
||||
/**
|
||||
* IP address changes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user