[RESTRICT AUTOMERGE] Fix potential out of bounds writes in LogEvent. am: 53251a491f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13321771

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1da4a9159e5611d80c618913f728defb5399d927