summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/dashboard
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-06-13 11:35:48 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2014-06-13 21:04:59 +0000
commita8b4dcc8272ce4da23dfca62ef7593b26fcabeb1 (patch)
tree168afb7d4e096ecadccd63e7622be96d0ac7798c /src/com/android/settings/dashboard
parentcbfda988167e5a08382dc64cb006f526faaa7c62 (diff)
downloadpackages_apps_Settings-a8b4dcc8272ce4da23dfca62ef7593b26fcabeb1.zip
packages_apps_Settings-a8b4dcc8272ce4da23dfca62ef7593b26fcabeb1.tar.gz
packages_apps_Settings-a8b4dcc8272ce4da23dfca62ef7593b26fcabeb1.tar.bz2
Fix bug #15611108 Stability: CursorIndexOutOfBoundsException in Settings: Index -1 requested, with a size of 1
- do not allow to have position < 0 A use case was generated by the Monkeys where they were capable to click on the Header. Change-Id: I3a8ded4c1471a1589134826539c9db1b551f49dd
Diffstat (limited to 'src/com/android/settings/dashboard')
-rw-r--r--src/com/android/settings/dashboard/SearchResultsSummary.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/settings/dashboard/SearchResultsSummary.java b/src/com/android/settings/dashboard/SearchResultsSummary.java
index 6981634..5f23671 100644
--- a/src/com/android/settings/dashboard/SearchResultsSummary.java
+++ b/src/com/android/settings/dashboard/SearchResultsSummary.java
@@ -216,6 +216,11 @@ public class SearchResultsSummary extends Fragment {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// We have a header, so we need to decrement the position by one
position--;
+ // Some Monkeys could create a case where they were probably clicking on the
+ // List Header and thus the position passed was "0" and then by decrement was "-1"
+ if (position < 0) {
+ return;
+ }
final Cursor cursor = mSuggestionsAdapter.mCursor;
cursor.moveToPosition(position);