Light refactors to packet wakeup events.

This patch uses the recently added MacAddress class in WakeupEvent and
WakeupStats for replacing the byte array representation of dest mac
addresses in packet wakeup events.

Bug: 28806131
Test: runtest frameworks-net
Merged-In: I5a3c76498a4b720f0d9308a65b5dd4b32377d0d1

(partial cherry pick from 884970e0ba)

Change-Id: I878d51d4cc53c6d9a2cc3c55faa15b86156afbd7
This commit is contained in:
Hugo Benichi
2017-11-14 22:42:46 +09:00
parent 06e314f6cc
commit 2ccba0e0e1
3 changed files with 5 additions and 5 deletions

View File

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

View File

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