Merge "[IT4.2] Update argument type of interfaceClassDataActivityChanged" am: dcb4051101 am: 8495b1b1dc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1531806 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I2e255f46fc8b3d9fb3f4e1af4bd66b4a0e38369e
This commit is contained in:
@@ -85,14 +85,14 @@ oneway interface INetworkManagementEventObserver {
|
|||||||
/**
|
/**
|
||||||
* Interface data activity status is changed.
|
* 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 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 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
|
* @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,
|
* radio. For those events that are reported by system itself, not from specific uid,
|
||||||
* use -1 for the events which means no 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.
|
* Information about available DNS servers has been received.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class BaseNetworkObserver extends INetworkManagementEventObserver.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos,
|
public void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos,
|
||||||
int uid) {
|
int uid) {
|
||||||
// default no-op
|
// default no-op
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1792,10 +1792,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
|
|
||||||
private INetworkManagementEventObserver mDataActivityObserver = new BaseNetworkObserver() {
|
private INetworkManagementEventObserver mDataActivityObserver = new BaseNetworkObserver() {
|
||||||
@Override
|
@Override
|
||||||
public void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos,
|
public void interfaceClassDataActivityChanged(int networkType, boolean active, long tsNanos,
|
||||||
int uid) {
|
int uid) {
|
||||||
int deviceType = Integer.parseInt(label);
|
sendDataActivityBroadcast(networkType, active, tsNanos);
|
||||||
sendDataActivityBroadcast(deviceType, active, tsNanos);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
|
|||||||
|
|
||||||
final boolean active = isActive;
|
final boolean active = isActive;
|
||||||
invokeForAllObservers(o -> o.interfaceClassDataActivityChanged(
|
invokeForAllObservers(o -> o.interfaceClassDataActivityChanged(
|
||||||
Integer.toString(type), active, tsNanos, uid));
|
type, active, tsNanos, uid));
|
||||||
|
|
||||||
boolean report = false;
|
boolean report = false;
|
||||||
synchronized (mIdleTimerLock) {
|
synchronized (mIdleTimerLock) {
|
||||||
|
|||||||
@@ -167,13 +167,13 @@ public class NetworkManagementServiceTest {
|
|||||||
* Interface class activity.
|
* Interface class activity.
|
||||||
*/
|
*/
|
||||||
unsolListener.onInterfaceClassActivityChanged(true, 1, 1234, TEST_UID);
|
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);
|
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);
|
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.
|
* IP address changes.
|
||||||
|
|||||||
Reference in New Issue
Block a user