summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-12-17 02:50:17 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-12-17 02:50:17 -0800
commit49c3de4b0da4377f58efa0ef113fff3d5a9f368e (patch)
tree8081fddf4b86a96192b5d971a21cee6e8d2feaf8 /src/com/android
parent3ff555aa6f6ef4cb342bef60d277df38b60483fc (diff)
parent1935f4c5db2ec505a7780958b2f76366fde851c5 (diff)
downloadandroid_packages_apps_Gallery2-49c3de4b0da4377f58efa0ef113fff3d5a9f368e.tar.gz
android_packages_apps_Gallery2-49c3de4b0da4377f58efa0ef113fff3d5a9f368e.tar.bz2
android_packages_apps_Gallery2-49c3de4b0da4377f58efa0ef113fff3d5a9f368e.zip
Merge "Gallery2: Fix monkey test fail"
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/MasterImage.java3
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java8
-rw-r--r--src/com/android/gallery3d/filtershow/ui/ExportDialog.java7
3 files changed, 15 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
index f6b97f11f..4b43d7672 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/MasterImage.java
@@ -271,6 +271,9 @@ public class MasterImage implements RenderingRequestCaller {
public void onHistoryItemClick(int position) {
HistoryItem historyItem = mHistory.getItem(position);
// We need a copy from the history
+ if (historyItem == null) {
+ return;
+ }
ImagePreset newPreset = new ImagePreset(historyItem.getImagePreset());
// don't need to add it to the history
setPreset(newPreset, historyItem.getFilterRepresentation(), false);
diff --git a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
index 844a8fb16..18321f567 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
@@ -67,9 +67,11 @@ public class ImagePreset {
}
public ImagePreset(ImagePreset source) {
- for (int i = 0; i < source.mFilters.size(); i++) {
- FilterRepresentation sourceRepresentation = source.mFilters.elementAt(i);
- mFilters.add(sourceRepresentation.copy());
+ if (source != null && source.mFilters != null) {
+ for (int i = 0; i < source.mFilters.size(); i++) {
+ FilterRepresentation sourceRepresentation = source.mFilters.elementAt(i);
+ mFilters.add(sourceRepresentation.copy());
+ }
}
}
diff --git a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
index b42c9f367..7fdd36d0f 100644
--- a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
+++ b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
@@ -109,6 +109,13 @@ public class ExportDialog extends DialogFragment implements View.OnClickListener
ImagePreset preset = MasterImage.getImage().getPreset();
mOriginalBounds = preset.finalGeometryRect(mOriginalBounds.width(),
mOriginalBounds.height());
+ if (preset != null) {
+ mOriginalBounds = preset.finalGeometryRect(mOriginalBounds.width(),
+ mOriginalBounds.height());
+ }
+ if (mOriginalBounds == null) {
+ return null;
+ }
mRatio = mOriginalBounds.width() / (float) mOriginalBounds.height();
mWidthText.setText("" + mOriginalBounds.width());
mHeightText.setText("" + mOriginalBounds.height());