am ef011a1e: Cancel the mosaic computation when paused.

* commit 'ef011a1e479f8e801318eba2dccb50fac1590d3c':
  Cancel the mosaic computation when paused.
diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java
index 0442c09..83b1a1a 100755
--- a/src/com/android/camera/panorama/PanoramaActivity.java
+++ b/src/com/android/camera/panorama/PanoramaActivity.java
@@ -815,9 +815,7 @@
         }
     }
 
-    @OnClickAttr
-    public void onCancelButtonClicked(View v) {
-        if (mPausing || mSurfaceTexture == null) return;
+    private void cancelHighResComputation() {
         mCancelComputation = true;
         synchronized (mWaitObject) {
             mWaitObject.notify();
@@ -825,6 +823,12 @@
     }
 
     @OnClickAttr
+    public void onCancelButtonClicked(View v) {
+        if (mPausing || mSurfaceTexture == null) return;
+        cancelHighResComputation();
+    }
+
+    @OnClickAttr
     public void onThumbnailClicked(View v) {
         if (mPausing || mThreadRunning || mSurfaceTexture == null) return;
         showSharePopup();
@@ -897,6 +901,7 @@
         super.onPause();
 
         mPausing = true;
+        cancelHighResComputation();
         // Stop the capturing first.
         if (mCaptureState == CAPTURE_STATE_MOSAIC) {
             stopCapture(true);