Fix NPE when swiping from capturing panorama.

bug:8022096
Change-Id: Iadfc7cb12f15712732b435805e6070fa96d800e5
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 4ecc900..51b3a1b 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -19,6 +19,7 @@
     <color name="on_viewfinder_label_background_color">#77333333</color>
     <color name="review_control_pressed_color">#FF33B5E5</color>
     <color name="review_control_pressed_fan_color">#3F33B5E5</color>
+    <color name="review_background">#FF000000</color>
     <color name="icon_disabled_color">#DD777777</color>
     <color name="time_lapse_arc">#FFC5C5C5</color>
     <color name="indicator_background">#40000000</color>
diff --git a/src/com/android/camera/PanoramaModule.java b/src/com/android/camera/PanoramaModule.java
index 7a45124..1829087 100644
--- a/src/com/android/camera/PanoramaModule.java
+++ b/src/com/android/camera/PanoramaModule.java
@@ -134,6 +134,7 @@
 
     private int mIndicatorColor;
     private int mIndicatorColorFast;
+    private int mReviewBackground;
 
     private boolean mUsingFrontCamera;
     private int mPreviewWidth;
@@ -690,6 +691,7 @@
 
         mReviewLayout = mRootView.findViewById(R.id.pano_review_layout);
         mReview = (ImageView) mRootView.findViewById(R.id.pano_reviewarea);
+        mReview.setBackgroundColor(mReviewBackground);
         View cancelButton = mRootView.findViewById(R.id.pano_review_cancel_button);
         cancelButton.setOnClickListener(new OnClickListener() {
             @Override
@@ -715,6 +717,7 @@
         Resources appRes = mActivity.getResources();
         mCaptureLayout = (LinearLayout) mRootView.findViewById(R.id.camera_app_root);
         mIndicatorColor = appRes.getColor(R.color.pano_progress_indication);
+        mReviewBackground = appRes.getColor(R.color.review_background);
         mIndicatorColorFast = appRes.getColor(R.color.pano_progress_indication_fast);
         mPanoLayout = (ViewGroup) mRootView.findViewById(R.id.pano_layout);
         mRotateDialog = new RotateDialogController(mActivity, R.layout.rotate_dialog);
@@ -898,7 +901,6 @@
             }
         }
 
-        mGLRootView.setVisibility(View.GONE);
         mCaptureLayout.setVisibility(View.GONE);
         mReviewLayout.setVisibility(View.VISIBLE);
     }
@@ -1083,7 +1085,7 @@
             mActivity.hideUI();
             mWaitProcessorTask = new WaitProcessorTask().execute();
         } else {
-            if (!mThreadRunning) mGLRootView.setVisibility(View.VISIBLE);
+            mGLRootView.setVisibility(View.VISIBLE);
             // Camera must be initialized before MosaicFrameProcessor is
             // initialized. The preview size has to be decided by camera device.
             initMosaicFrameProcessorIfNeeded();