commit | f14e212d82b32053d151eedf97ac59a4b5b18369 | [log] [tgz] |
---|---|---|
author | Nate Myren <ntmyren@google.com> | Wed Dec 01 15:15:47 2021 -0800 |
committer | Nate Myren <ntmyren@google.com> | Tue Dec 21 00:12:53 2021 +0000 |
tree | dff583969c3129a927f0957646b25317c2461629 | |
parent | 94ddd3853ecaa22aee591e70f0dfebaf1f419914 [diff] |
Get fresh InProgress array in AttributedAppOp when adding/removing Otherwise, a call to finish() and then start() might reallocate the array, and cause the reference to point to the old location of the array. Fixes: 208662370 Test: atest ForegroundModeAndActiveTest Change-Id: I7e754c067520765c00cc67cc310926e63bd0462d Merged-In: I7e754c067520765c00cc67cc310926e63bd0462d
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index 64b9bd9..6d29c37 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -1314,6 +1314,7 @@ event.getAttributionFlags(), event.getAttributionChainId()); } + events = isRunning ? mInProgressEvents : mPausedInProgressEvents; InProgressStartOpEvent newEvent = events.get(binders.get(i)); if (newEvent != null) { newEvent.numUnfinishedStarts += numPreviousUnfinishedStarts - 1;