diff options
author | ztenghui <ztenghui@google.com> | 2013-07-22 14:06:22 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2013-07-22 14:39:17 -0700 |
commit | a08fab5958ecd50ada4b7c013af362029c61f117 (patch) | |
tree | 5bfa8e38aacec1f87bf902bf4663922b698a0eb4 /src | |
parent | 08f4cc3988e54937f191e61588f50535df34712e (diff) | |
download | android_packages_apps_Gallery2-a08fab5958ecd50ada4b7c013af362029c61f117.tar.gz android_packages_apps_Gallery2-a08fab5958ecd50ada4b7c013af362029c61f117.tar.bz2 android_packages_apps_Gallery2-a08fab5958ecd50ada4b7c013af362029c61f117.zip |
WAR the crash from re-editing missing online image
Instead of crashing, we get a toast now.
As a bonus, this will show the same toast if .aux directory is removed
manually.
bug:9961671
Change-Id: I92f38fc752a48d3cb5a9a80aa041cd9b290937ea
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 9508bdc21..d589bef0b 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -160,6 +160,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL } private ServiceConnection mConnection = new ServiceConnection() { + @Override public void onServiceConnected(ComponentName className, IBinder service) { /* * This is called when the connection with the service has been @@ -173,6 +174,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL mBoundService.onStart(); } + @Override public void onServiceDisconnected(ComponentName className) { /* * This is called when the connection with the service has been @@ -598,6 +600,9 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL if (!result) { cannotLoadImage(); + // TODO: We should figure out the best way preventing this from + // happening, e.g: early checking. + return; } if (null == CachingPipeline.getRenderScriptContext()){ @@ -669,7 +674,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL private int getScreenImageSize() { DisplayMetrics outMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(outMetrics); - return (int) Math.max(outMetrics.heightPixels, outMetrics.widthPixels); + return Math.max(outMetrics.heightPixels, outMetrics.widthPixels); } private void showSavingProgress(String albumName) { |