Add SafetyNet logging to DHCP packet parsing Test: unit test passes Bug: 31850211 Change-Id: I47f9db1f2c50ccd4fc90b80a9ffc1e9e43078f5f (cherry picked from commit a0289894718c230c746f7e85207d30fee431dab8)
diff --git a/services/net/java/android/net/dhcp/DhcpClient.java b/services/net/java/android/net/dhcp/DhcpClient.java index ffbea9f..8dd05b1 100644 --- a/services/net/java/android/net/dhcp/DhcpClient.java +++ b/services/net/java/android/net/dhcp/DhcpClient.java
@@ -40,6 +40,7 @@ import android.system.ErrnoException; import android.system.Os; import android.system.PacketSocketAddress; +import android.util.EventLog; import android.util.Log; import android.util.SparseArray; import android.util.TimeUtils; @@ -369,6 +370,13 @@ if (PACKET_DBG) { Log.d(TAG, HexDump.dumpHexString(mPacket, 0, length)); } + if (e.errorCode == DhcpErrorEvent.DHCP_NO_COOKIE) { + int snetTagId = 0x534e4554; + String bugId = "31850211"; + int uid = -1; + String data = DhcpPacket.ParseException.class.getName(); + EventLog.writeEvent(snetTagId, bugId, uid, data); + } logError(e.errorCode); } }