summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2015-11-10 13:19:41 -0800
committerSteve Kondik <steve@cyngn.com>2016-08-03 15:44:40 -0700
commit69d1c4dfde72a717cd977ca69fe1cd17f8817087 (patch)
treee3f5bfa7b410f10ba6555747278a07ef64590a1f
parent48feef948c83e55c76f91d20468cddb65ce24806 (diff)
downloadandroid_packages_apps_Snap-69d1c4dfde72a717cd977ca69fe1cd17f8817087.zip
android_packages_apps_Snap-69d1c4dfde72a717cd977ca69fe1cd17f8817087.tar.gz
android_packages_apps_Snap-69d1c4dfde72a717cd977ca69fe1cd17f8817087.tar.bz2
SnapdragonCamera: Do not update panorama thumbnail when cancelled
Do not update thumbnail when panorama is cancelled. Change-Id: I3db9f9614b35ee4e475fbb7b1dc801b77e6ed6bd CRs-Fixed: 934157
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java7
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java12
2 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 5f74adc..e385660 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -315,7 +315,7 @@ public class WideAnglePanoramaModule
switch (msg.what) {
case MSG_LOW_RES_FINAL_MOSAIC_READY:
onBackgroundThreadFinished();
- showFinalMosaic((Bitmap) msg.obj);
+ saveFinalMosaic((Bitmap) msg.obj);
saveHighResMosaic();
break;
case MSG_GENERATE_FINAL_MOSAIC_ERROR:
@@ -757,6 +757,7 @@ public class WideAnglePanoramaModule
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
+ mUI.showFinalMosaic();
mActivity.notifyNewMedia(uri);
}
});
@@ -815,8 +816,8 @@ public class WideAnglePanoramaModule
}
}
- private void showFinalMosaic(Bitmap bitmap) {
- mUI.showFinalMosaic(bitmap, getCaptureOrientation());
+ private void saveFinalMosaic(Bitmap bitmap) {
+ mUI.saveFinalMosaic(bitmap, getCaptureOrientation());
}
private Uri savePanorama(byte[] jpegData, int width, int height, int orientation) {
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index 37a476f..e0d82f2 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -88,6 +88,7 @@ public class WideAnglePanoramaUI implements
private ShutterButton mShutterButton;
private CameraControls mCameraControls;
private ImageView mThumbnail;
+ private Bitmap mThumbnailBitmap;
private Matrix mProgressDirectionMatrix = new Matrix();
private float[] mProgressAngle = new float[2];
@@ -303,7 +304,7 @@ public class WideAnglePanoramaUI implements
mCaptureProgressBar.setVisibility(View.INVISIBLE);
}
- public void showFinalMosaic(Bitmap bitmap, int orientation) {
+ public void saveFinalMosaic(Bitmap bitmap, int orientation) {
if (bitmap != null && orientation != 0) {
Matrix rotateMatrix = new Matrix();
rotateMatrix.setRotate(orientation);
@@ -320,7 +321,14 @@ public class WideAnglePanoramaUI implements
// a framework bug. Call requestLayout() as a workaround.
mSavingProgressBar.requestLayout();
- mActivity.updateThumbnail(bitmap);
+ mThumbnailBitmap = bitmap;
+ }
+
+ public void showFinalMosaic() {
+ if (mThumbnailBitmap == null) return;
+ mActivity.updateThumbnail(mThumbnailBitmap);
+ mThumbnailBitmap.recycle();
+ mThumbnailBitmap = null;
}
public void onConfigurationChanged(