summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoMenu.java
diff options
context:
space:
mode:
authormingwax <mingwax@codeaurora.org>2016-09-05 15:10:43 +0800
committermingwax <mingwax@codeaurora.org>2016-09-07 10:26:02 +0800
commit68359ee7df739df7aeda2d542dbbc884f613147b (patch)
tree6441907f84877bee444a19e750d9d52215cfc3b6 /src/com/android/camera/VideoMenu.java
parent9159ebde9c1bc74e531bd0cc5e7e9379d1d235e6 (diff)
downloadandroid_packages_apps_Snap-68359ee7df739df7aeda2d542dbbc884f613147b.tar.gz
android_packages_apps_Snap-68359ee7df739df7aeda2d542dbbc884f613147b.tar.bz2
android_packages_apps_Snap-68359ee7df739df7aeda2d542dbbc884f613147b.zip
SnapdragonCamera: Fix OutOfBoundsException in monkey test
In monkey test, set defaultValue operation in xml file, parsing XML in framework code, pref.getValue() return null when defaultValue not ready. When findIndexOfValue() failed to get the index of the value, it will return -1, but -1 can`t be the index of the array, it will cause exception. So if can`t find the index of the value, just go back and don`t execute the following code. Change-Id: I2b5595d7d558e3ab3863287e3d1424df141c5d59 CRs-Fixed: 1063228
Diffstat (limited to 'src/com/android/camera/VideoMenu.java')
-rw-r--r--src/com/android/camera/VideoMenu.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
index aae59faf7..5ea01c575 100644
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -472,6 +472,9 @@ public class VideoMenu extends MenuController
int resid = -1;
int index = pref.findIndexOfValue(pref.getValue());
if (!pref.getUseSingleIcon() && iconIds != null) {
+ if (index == -1) {
+ return;
+ }
// Each entry has a corresponding icon.
resid = iconIds[index];
} else {