Merge "Light refactors to packet wakeup events."
This commit is contained in:
@@ -29,7 +29,7 @@ public class WakeupEvent {
|
||||
public String iface;
|
||||
public int uid;
|
||||
public int ethertype;
|
||||
public byte[] dstHwAddr;
|
||||
public MacAddress dstHwAddr;
|
||||
public String srcIp;
|
||||
public String dstIp;
|
||||
public int ipNextHeader;
|
||||
@@ -44,7 +44,7 @@ public class WakeupEvent {
|
||||
j.add(iface);
|
||||
j.add("uid: " + Integer.toString(uid));
|
||||
j.add("eth=0x" + Integer.toHexString(ethertype));
|
||||
j.add("dstHw=" + MacAddress.stringAddrFromByteAddr(dstHwAddr));
|
||||
j.add("dstHw=" + dstHwAddr);
|
||||
if (ipNextHeader > 0) {
|
||||
j.add("ipNxtHdr=" + ipNextHeader);
|
||||
j.add("srcIp=" + srcIp);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package android.net.metrics;
|
||||
|
||||
import android.net.MacAddress;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
import android.util.SparseIntArray;
|
||||
@@ -80,7 +79,7 @@ public class WakeupStats {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (MacAddress.macAddressType(ev.dstHwAddr)) {
|
||||
switch (ev.dstHwAddr.addressType()) {
|
||||
case UNICAST:
|
||||
l2UnicastCount++;
|
||||
break;
|
||||
|
||||
@@ -21,6 +21,7 @@ import static android.util.TimeUtils.NANOS_PER_MS;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.INetdEventCallback;
|
||||
import android.net.MacAddress;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.metrics.ConnectStats;
|
||||
@@ -242,7 +243,7 @@ public class NetdEventListenerService extends INetdEventListener.Stub {
|
||||
event.timestampMs = timestampMs;
|
||||
event.uid = uid;
|
||||
event.ethertype = ethertype;
|
||||
event.dstHwAddr = dstHw;
|
||||
event.dstHwAddr = new MacAddress(dstHw);
|
||||
event.srcIp = srcIp;
|
||||
event.dstIp = dstIp;
|
||||
event.ipNextHeader = ipNextHeader;
|
||||
|
||||
Reference in New Issue
Block a user