Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Camera: Fix FC caused by IndexOutOfBounds exception in BasicIndicator

Change-Id: If8c7da1d8832a44216b8a31b3397fb5f7c40bdae
  • Loading branch information...
commit e148b60f3191c884c47e13b79407ccfb9d694439 1 parent 4b1fb4b
@C3C0 authored
View
12 src/com/android/camera/ui/AbstractIndicator.java
@@ -38,9 +38,15 @@ public AbstractIndicator(Context context) {
@Override
protected void onMeasure(int widthSpec, int heightSpec) {
BitmapTexture icon = getIcon();
- new MeasureHelper(this)
- .setPreferredContentSize(icon.getWidth(), icon.getHeight())
- .measure(widthSpec, heightSpec);
+
+ if(icon == null)
+ new MeasureHelper(this)
+ .setPreferredContentSize(0, 0)
+ .measure(widthSpec, heightSpec);
+ else
+ new MeasureHelper(this)
+ .setPreferredContentSize(icon.getWidth(), icon.getHeight())
+ .measure(widthSpec, heightSpec);
}
@Override
View
4 src/com/android/camera/ui/BasicIndicator.java
@@ -106,6 +106,10 @@ public void onItemSelected(GLView view, int position) {
@Override
protected ResourceTexture getIcon() {
int index = mIndex;
+
+ if(index < 0 || index >= mIcon.length)
+ return null;
+
if (mIcon[index] == null) {
Context context = getGLRootView().getContext();
mIcon[index] = new ResourceTexture(
Please sign in to comment.
Something went wrong with that request. Please try again.