[automerger skipped] [RESTRICT AUTOMERGE] Fix potential out of bounds writes in LogEvent. am: 53251a491f am: 60b00ec30f -s ours

am skip reason: skipped by user muhammadq

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I86e796e3caa7be0d362ca08de4a2887dfb77c68c