summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-10-30 13:14:39 +0100
committerAdrian DC <radian.dc@gmail.com>2016-12-03 22:12:07 +0100
commit3502c3c1047ce35960bed99c6d487602d4c05067 (patch)
treeaefdb6b4b26bf06764464eb8b3ed74bae161ed5f /src/com
parentffd44061e93cfd63040b909024407a8c5953422e (diff)
downloadandroid_packages_apps_Snap-3502c3c1047ce35960bed99c6d487602d4c05067.tar.gz
android_packages_apps_Snap-3502c3c1047ce35960bed99c6d487602d4c05067.tar.bz2
android_packages_apps_Snap-3502c3c1047ce35960bed99c6d487602d4c05067.zip
Fix off-by-one error in submenu selection handling.
RM-290 Change-Id: I7e0f44110735d8e098abdf9724e89a837b96c3e9
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/ui/ListSubMenu.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/ListSubMenu.java b/src/com/android/camera/ui/ListSubMenu.java
index 87c99c0fe..1965cec6a 100644
--- a/src/com/android/camera/ui/ListSubMenu.java
+++ b/src/com/android/camera/ui/ListSubMenu.java
@@ -138,6 +138,10 @@ public class ListSubMenu extends ListView implements
@Override
public void onItemClick(AdapterView<?> parent, View view,
int index, long id) {
+ index -= getHeaderViewsCount();
+ if (index < 0 || index >= getAdapter().getCount()) {
+ return;
+ }
mPreference.setValueIndex(index);
if (mListener != null)
mListener.onListPrefChanged(mPreference);