mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Merge "Add detailed exception for snappedIndex == -1 when dismissing tasks" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
dcbe9583fb
@@ -3742,19 +3742,33 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
taskViewIdArray.removeValue(
|
||||
finalNextFocusedTaskView.getTaskViewId());
|
||||
}
|
||||
if (snappedIndex < taskViewIdArray.size()) {
|
||||
taskViewIdToSnapTo = taskViewIdArray.get(snappedIndex);
|
||||
} else if (snappedIndex == taskViewIdArray.size()) {
|
||||
// If the snapped task is the last item from the
|
||||
// dismissed row,
|
||||
// snap to the same column in the other grid row
|
||||
IntArray inverseRowTaskViewIdArray =
|
||||
isSnappedTaskInTopRow ? getBottomRowIdArray()
|
||||
: getTopRowIdArray();
|
||||
if (snappedIndex < inverseRowTaskViewIdArray.size()) {
|
||||
taskViewIdToSnapTo = inverseRowTaskViewIdArray.get(
|
||||
snappedIndex);
|
||||
try {
|
||||
if (snappedIndex < taskViewIdArray.size()) {
|
||||
taskViewIdToSnapTo = taskViewIdArray.get(snappedIndex);
|
||||
} else if (snappedIndex == taskViewIdArray.size()) {
|
||||
// If the snapped task is the last item from the
|
||||
// dismissed row,
|
||||
// snap to the same column in the other grid row
|
||||
IntArray inverseRowTaskViewIdArray =
|
||||
isSnappedTaskInTopRow ? getBottomRowIdArray()
|
||||
: getTopRowIdArray();
|
||||
if (snappedIndex < inverseRowTaskViewIdArray.size()) {
|
||||
taskViewIdToSnapTo = inverseRowTaskViewIdArray.get(
|
||||
snappedIndex);
|
||||
}
|
||||
}
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
throw new IllegalStateException(
|
||||
"b/269956477 invalid snappedIndex"
|
||||
+ "\nsnappedTaskViewId: "
|
||||
+ snappedTaskViewId
|
||||
+ "\nfocusedTaskViewId: "
|
||||
+ mFocusedTaskViewId
|
||||
+ "\ntopRowIdArray: "
|
||||
+ getTopRowIdArray().toConcatString()
|
||||
+ "\nbottomRowIdArray: "
|
||||
+ getBottomRowIdArray().toConcatString(),
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user