summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/dashboard
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-06-23 16:33:39 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2014-06-23 16:33:39 -0700
commitf24859cdb76c840a9ff97a4ccc1e4a2753d565a6 (patch)
treea2d8e7ff5b667ecce950e2a27123b439cfc65111 /src/com/android/settings/dashboard
parent47a25e76409aec1ae29b983779addf39722377f6 (diff)
downloadpackages_apps_Settings-f24859cdb76c840a9ff97a4ccc1e4a2753d565a6.tar.gz
packages_apps_Settings-f24859cdb76c840a9ff97a4ccc1e4a2753d565a6.tar.bz2
packages_apps_Settings-f24859cdb76c840a9ff97a4ccc1e4a2753d565a6.zip
Fix bug #15827043 - Stability: CursorIndexOutOfBoundsException in Settings: Index -1 requested, with a size of 38
- ahhhh Monkeys, do not allow to have position < 0 Similar fix than the one done for: mSuggestionsListView.setOnItemClickListener(...) in I3a8ded4c1471a1589134826539c9db1b551f49dd Change-Id: I6ef266852e2c2ab5d0d0f6b4faf358b22d12bf6b
Diffstat (limited to 'src/com/android/settings/dashboard')
-rw-r--r--src/com/android/settings/dashboard/SearchResultsSummary.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/settings/dashboard/SearchResultsSummary.java b/src/com/android/settings/dashboard/SearchResultsSummary.java
index 5af602e5a..9e8435761 100644
--- a/src/com/android/settings/dashboard/SearchResultsSummary.java
+++ b/src/com/android/settings/dashboard/SearchResultsSummary.java
@@ -169,6 +169,12 @@ public class SearchResultsSummary extends Fragment {
// 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 = mResultsAdapter.mCursor;
cursor.moveToPosition(position);