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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user