commit | c945c7b98f7c4aa6eeb1f135bb0e3a1dc9459691 | [log] [tgz] |
---|---|---|
author | Tony Wickham <twickham@google.com> | Wed Mar 10 21:33:55 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Mar 10 21:33:55 2021 +0000 |
tree | ddb79bb12c6109de8dc91860cb97aadd76bf348c | |
parent | edf8d5c980ef98b388bf56467255e21d31af8bc6 [diff] | |
parent | b9672a668df885f4e043b1229b3080da9345d3bd [diff] |
Merge "Ensure taskbar hotseat array index is in bounds" into sc-dev am: b9672a668d Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13817631 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Icd08c4233a000ca4468b8c5b5f0bfd42f6b3c66c
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarHotseatController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarHotseatController.java index 082343e..b1bafdb 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarHotseatController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarHotseatController.java
@@ -78,7 +78,10 @@ CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams(); // Since the hotseat might be laid out vertically or horizontally, use whichever // index is higher. - hotseatItemInfos[Math.max(lp.cellX, lp.cellY)] = itemInfo; + int index = Math.max(lp.cellX, lp.cellY); + if (0 <= index && index < hotseatItemInfos.length) { + hotseatItemInfos[index] = itemInfo; + } } }