RESTRICT AUTOMERGE: Validate the position value for UsageEvent

Ensure the position value getting from a Parcel for UsageEvent
is smaller than that parcel's data size before setting it.

Bug: 399155883
Ignore-AOSP-First: security fix
Test: atest FrameworksCoreTests:android.app.usage.*
Test: atest CtsUsageStatsTestCases:android.app.usage.cts.UsageStatsTest
Flag: EXEMPT bug fix
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:838301ebf546fbfdcf154797890cd2c1d2017553
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:a75397155667ba8a178f1f8ea837e7e6123eadf9
Merged-In: I32605b73a2ded91c1bf392d5f8d830ff765a3f23
Change-Id: I32605b73a2ded91c1bf392d5f8d830ff765a3f23
1 file changed