[automerger skipped] [RESTRICT AUTOMERGE] Fix potential out of bounds writes in LogEvent. am: 53251a491f -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: I98bcb73f462edd54f2ed21b80a3f511f8325e68c