Merge "Fix the missing filter name after deserialization." into gb-ub-photos-carlsbad
diff --git a/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.cpp b/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.cpp
deleted file mode 100644
index aeabf8f..0000000
--- a/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-///////////////////////////////////////////////////
-// AlignFeatures.cpp
-// S.O. # :
-// Author(s): zkira, mbansal, bsouthall, narodits
-// $Id: AlignFeatures.cpp,v 1.20 2011/06/17 13:35:47 mbansal Exp $
-
-#include <stdio.h>
-#include <string.h>
-
-#include "trsMatrix.h"
-#include "MatrixUtils.h"
-#include "AlignFeatures.h"
-#include "Log.h"
-
-#define LOG_TAG "AlignFeatures"
-
-Align::Align()
-{
-  width = height = 0;
-  frame_number = 0;
-  num_frames_captured = 0;
-  reference_frame_index = 0;
-  db_Identity3x3(Hcurr);
-  db_Identity3x3(Hprev);
-}
-
-Align::~Align()
-{
-  // Free gray-scale image
-  if (imageGray != ImageUtils::IMAGE_TYPE_NOIMAGE)
-    ImageUtils::freeImage(imageGray);
-}
-
-char* Align::getRegProfileString()
-{
-  return reg.profile_string;
-}
-
-int Align::initialize(int width, int height, bool _quarter_res, float _thresh_still)
-{
-  int    nr_corners = DEFAULT_NR_CORNERS;
-  double max_disparity = DEFAULT_MAX_DISPARITY;
-  int    motion_model_type = DEFAULT_MOTION_MODEL;
-  int nrsamples = DB_DEFAULT_NR_SAMPLES;
-  double scale = DB_POINT_STANDARDDEV;
-  int chunk_size = DB_DEFAULT_CHUNK_SIZE;
-  int nrhorz = width/48;  // Empirically determined number of horizontal
-  int nrvert = height/60; // and vertical buckets for harris corner detection.
-  bool linear_polish = false;
-  unsigned int reference_update_period = DEFAULT_REFERENCE_UPDATE_PERIOD;
-
-  const bool DEFAULT_USE_SMALLER_MATCHING_WINDOW = false;
-  bool   use_smaller_matching_window = DEFAULT_USE_SMALLER_MATCHING_WINDOW;
-
-  quarter_res = _quarter_res;
-  thresh_still = _thresh_still;
-
-  frame_number = 0;
-  num_frames_captured = 0;
-  reference_frame_index = 0;
-  db_Identity3x3(Hcurr);
-  db_Identity3x3(Hprev);
-
-  if (!reg.Initialized())
-  {
-    reg.Init(width, height, motion_model_type, 20, linear_polish, quarter_res,
-            scale, reference_update_period, false, 0, nrsamples, chunk_size,
-            nr_corners, max_disparity, use_smaller_matching_window,
-            nrhorz, nrvert);
-  }
-  this->width = width;
-  this->height = height;
-
-  imageGray = ImageUtils::allocateImage(width, height, 1);
-
-  if (reg.Initialized())
-    return ALIGN_RET_OK;
-  else
-    return ALIGN_RET_ERROR;
-}
-
-int Align::addFrameRGB(ImageType imageRGB)
-{
-  ImageUtils::rgb2gray(imageGray, imageRGB, width, height);
-  return addFrame(imageGray);
-}
-
-int Align::addFrame(ImageType imageGray_)
-{
-  int ret_code = ALIGN_RET_OK;
-
- // Obtain a vector of pointers to rows in image and pass in to dbreg
-  ImageType *m_rows = ImageUtils::imageTypeToRowPointers(imageGray_, width, height);
-
-  if (frame_number == 0)
-  {
-      reg.AddFrame(m_rows, Hcurr, true);    // Force this to be a reference frame
-      int num_corner_ref = reg.GetNrRefCorners();
-
-      if (num_corner_ref < MIN_NR_REF_CORNERS)
-      {
-          return ALIGN_RET_LOW_TEXTURE;
-      }
-  }
-  else
-  {
-      reg.AddFrame(m_rows, Hcurr, false);
-  }
-
-  // Average translation per frame =
-  //    [Translation from Frame0 to Frame(n-1)] / [(n-1)]
-  average_tx_per_frame = (num_frames_captured < 2) ? 0.0 :
-        Hprev[2] / (num_frames_captured - 1);
-
-  // Increment the captured frame counter if we already have a reference frame
-  num_frames_captured++;
-
-  if (frame_number != 0)
-  {
-    int num_inliers = reg.GetNrInliers();
-
-    if(num_inliers < MIN_NR_INLIERS)
-    {
-        ret_code = ALIGN_RET_FEW_INLIERS;
-
-        Hcurr[0] = 1.0;
-        Hcurr[1] = 0.0;
-        // Set this as the average per frame translation taking into acccount
-        // the separation of the current frame from the reference frame...
-        Hcurr[2] = -average_tx_per_frame *
-                (num_frames_captured - reference_frame_index);
-        Hcurr[3] = 0.0;
-        Hcurr[4] = 1.0;
-        Hcurr[5] = 0.0;
-        Hcurr[6] = 0.0;
-        Hcurr[7] = 0.0;
-        Hcurr[8] = 1.0;
-    }
-
-    if(fabs(Hcurr[2])<thresh_still && fabs(Hcurr[5])<thresh_still)  // Still camera
-    {
-        return ALIGN_RET_ERROR;
-    }
-
-    // compute the homography:
-    double Hinv33[3][3];
-    double Hprev33[3][3];
-    double Hcurr33[3][3];
-
-    // Invert and multiple with previous transformation
-    Matrix33::convert9to33(Hcurr33, Hcurr);
-    Matrix33::convert9to33(Hprev33, Hprev);
-    normProjMat33d(Hcurr33);
-
-    inv33d(Hcurr33, Hinv33);
-
-    mult33d(Hcurr33, Hprev33, Hinv33);
-    normProjMat33d(Hcurr33);
-    Matrix9::convert33to9(Hprev, Hcurr33);
-    // Since we have already factored the current transformation
-    // into Hprev, we can reset the Hcurr to identity
-    db_Identity3x3(Hcurr);
-
-    // Update the reference frame to be the current frame
-    reg.UpdateReference(m_rows,quarter_res,false);
-
-    // Update the reference frame index
-    reference_frame_index = num_frames_captured;
-  }
-
-  frame_number++;
-
-  return ret_code;
-}
-
-// Get current transformation
-int Align::getLastTRS(double trs[3][3])
-{
-  if (frame_number < 1)
-  {
-    trs[0][0] = 1.0;
-    trs[0][1] = 0.0;
-    trs[0][2] = 0.0;
-    trs[1][0] = 0.0;
-    trs[1][1] = 1.0;
-    trs[1][2] = 0.0;
-    trs[2][0] = 0.0;
-    trs[2][1] = 0.0;
-    trs[2][2] = 1.0;
-    return ALIGN_RET_ERROR;
-  }
-
-  // Note that the logic here handles the case, where a frame is not used for
-  // mosaicing but is captured and used in the preview-rendering.
-  // For these frames, we don't set Hcurr to identity in AddFrame() and the
-  // logic here appends their transformation to Hprev to render them with the
-  // correct transformation. For the frames we do use for mosaicing, we already
-  // append their Hcurr to Hprev in AddFrame() and then set Hcurr to identity.
-
-  double Hinv33[3][3];
-  double Hprev33[3][3];
-  double Hcurr33[3][3];
-
-  Matrix33::convert9to33(Hcurr33, Hcurr);
-  normProjMat33d(Hcurr33);
-  inv33d(Hcurr33, Hinv33);
-
-  Matrix33::convert9to33(Hprev33, Hprev);
-
-  mult33d(trs, Hprev33, Hinv33);
-  normProjMat33d(trs);
-
-  return ALIGN_RET_OK;
-}
-
diff --git a/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.h b/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.h
deleted file mode 100644
index 19f3905..0000000
--- a/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-///////////////////////////////////////////////////
-// Align.h
-// S.O. # :
-// Author(s): zkira
-// $Id: AlignFeatures.h,v 1.13 2011/06/17 13:35:47 mbansal Exp $
-
-#ifndef ALIGN_H
-#define ALIGN_H
-
-#include "dbreg/dbreg.h"
-#include <db_utilities_camera.h>
-
-#include "ImageUtils.h"
-#include "MatrixUtils.h"
-
-class Align {
-
-public:
-  // Types of alignment possible
-  static const int ALIGN_TYPE_PAN    = 1;
-
-  // Return codes
-  static const int ALIGN_RET_LOW_TEXTURE  = -2;
-  static const int ALIGN_RET_ERROR        = -1;
-  static const int ALIGN_RET_OK           = 0;
-  static const int ALIGN_RET_FEW_INLIERS  = 1;
-
-  ///// Settings for feature-based alignment
-  // Number of features to use from corner detection
-  static const int DEFAULT_NR_CORNERS=750;
-  static const double DEFAULT_MAX_DISPARITY=0.1;//0.4;
-  // Type of homography to model
-  static const int DEFAULT_MOTION_MODEL=DB_HOMOGRAPHY_TYPE_R_T;
-// static const int DEFAULT_MOTION_MODEL=DB_HOMOGRAPHY_TYPE_PROJECTIVE;
-//  static const int DEFAULT_MOTION_MODEL=DB_HOMOGRAPHY_TYPE_AFFINE;
-  static const unsigned int DEFAULT_REFERENCE_UPDATE_PERIOD=1500; //  Manual reference frame update so set this to a large number
-
-  static const int MIN_NR_REF_CORNERS = 25;
-  static const int MIN_NR_INLIERS = 10;
-
-  Align();
-  ~Align();
-
-  // Initialization of structures, etc.
-  int initialize(int width, int height, bool quarter_res, float thresh_still);
-
-  // Add a frame.  Note: The alignment computation is performed
-  // in this function
-  int addFrameRGB(ImageType image);
-  int addFrame(ImageType image);
-
-  // Obtain the TRS matrix from the last two frames
-  int getLastTRS(double trs[3][3]);
-  char* getRegProfileString();
-
-protected:
-
-  db_FrameToReferenceRegistration reg;
-
-  int frame_number;
-
-  double Hcurr[9];   // Homography from the alignment reference to the frame-t
-  double Hprev[9];   // Homography from frame-0 to the frame-(t-1)
-
-  int reference_frame_index; // Index of the reference frame from all captured frames
-  int num_frames_captured; // Total number of frames captured (different from frame_number)
-  double average_tx_per_frame; // Average pixel translation per captured frame
-
-  int width,height;
-
-  bool quarter_res;     // Whether to process at quarter resolution
-  float thresh_still;   // Translation threshold in pixels to detect still camera
-  ImageType imageGray;
-};
-
-
-#endif
diff --git a/res/drawable/pano_direction_left_indicator.xml b/res/drawable/pano_direction_left_indicator.xml
deleted file mode 100644
index a0bfb0a..0000000
--- a/res/drawable/pano_direction_left_indicator.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_enabled="false"
-              android:drawable="@drawable/ic_pan_left_indicator" />
-    <item android:drawable="@drawable/ic_pan_left_indicator_fast" />
-</selector>
diff --git a/res/drawable/pano_direction_right_indicator.xml b/res/drawable/pano_direction_right_indicator.xml
deleted file mode 100644
index c3ce377..0000000
--- a/res/drawable/pano_direction_right_indicator.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_enabled="false"
-              android:drawable="@drawable/ic_pan_right_indicator" />
-    <item android:drawable="@drawable/ic_pan_right_indicator_fast" />
-</selector>
diff --git a/res/layout-land/pano_module_capture.xml b/res/layout-land/pano_module_capture.xml
deleted file mode 100644
index 26cbfb1..0000000
--- a/res/layout-land/pano_module_capture.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/camera_app"
-        android:layout_height="match_parent"
-        android:layout_width="match_parent"
-        android:layout_gravity="center"
-        android:orientation="horizontal">
-
-    <include layout="@layout/preview_frame_pano" />
-
-</LinearLayout>
diff --git a/res/layout-land/pano_review.xml b/res/layout-land/pano_review.xml
deleted file mode 100644
index ea65c26..0000000
--- a/res/layout-land/pano_review.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/pano_review_layout"
-        android:visibility="gone"
-        android:orientation="vertical"
-        android:layout_height="match_parent"
-        android:layout_width="match_parent">
-
-    <TextView style="@style/PanoViewHorizontalBar"
-            android:text="@string/pano_review_rendering"
-            android:textAppearance="?android:textAppearanceMedium"
-            android:gravity="center" />
-
-    <ImageView android:id="@+id/pano_reviewarea"
-            android:scaleType="fitCenter"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/pano_mosaic_surface_height" />
-
-    <RelativeLayout style="@style/PanoViewHorizontalBar">
-        <com.android.camera.ui.RotateLayout
-                android:id="@+id/pano_saving_progress_bar_layout"
-                android:layout_centerInParent="true"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content">
-            <com.android.camera.PanoProgressBar
-                    android:id="@+id/pano_saving_progress_bar"
-                    android:src="@drawable/ic_pan_progression"
-                    android:layout_centerInParent="true"
-                    android:layout_height="wrap_content"
-                    android:layout_width="wrap_content" />
-        </com.android.camera.ui.RotateLayout>
-
-        <com.android.camera.ui.RotateImageView android:id="@+id/pano_review_cancel_button"
-                style="@style/ReviewControlIcon"
-                android:contentDescription="@string/accessibility_review_cancel"
-                android:layout_alignParentRight="true"
-                android:layout_centerVertical="true"
-                android:layout_centerHorizontal="false"
-                android:src="@drawable/ic_menu_cancel_holo_light" />
-    </RelativeLayout>
-</LinearLayout>
diff --git a/res/layout-land/preview_frame_pano.xml b/res/layout-land/preview_frame_pano.xml
deleted file mode 100644
index bd05f9a..0000000
--- a/res/layout-land/preview_frame_pano.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/frame_layout"
-        android:layout_width="0dp"
-        android:layout_height="match_parent"
-        android:layout_weight="1">
-
-    <LinearLayout android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical">
-
-        <!-- The top bar with capture indication -->
-        <FrameLayout style="@style/PanoViewHorizontalBar">
-            <TextView android:id="@+id/pano_capture_indicator"
-                    android:text="@string/pano_capture_indication"
-                    android:textAppearance="?android:textAppearanceMedium"
-                    android:layout_gravity="center"
-                    android:visibility="gone"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
-        </FrameLayout>
-
-        <com.android.camera.ui.LayoutNotifyView
-                android:id="@+id/pano_preview_area"
-                android:visibility="invisible"
-                android:background="@drawable/ic_pan_border_fast"
-                android:layout_gravity="center"
-                android:layout_weight="5"
-                android:layout_width="match_parent"
-                android:layout_height="0dp" />
-
-        <!-- The bottom bar with progress bar and direction indicators -->
-        <RelativeLayout style="@style/PanoViewHorizontalBar">
-
-            <com.android.camera.ui.RotateLayout
-                    android:id="@+id/pano_pan_progress_bar_layout"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_centerInParent="true">
-                <com.android.camera.PanoProgressBar
-                        android:id="@+id/pano_pan_progress_bar"
-                        android:visibility="gone"
-                        android:src="@drawable/ic_pan_progression"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content" />
-            </com.android.camera.ui.RotateLayout>
-            <ImageView
-                    android:id="@+id/pano_pan_left_indicator"
-                    android:src="@drawable/pano_direction_left_indicator"
-                    android:visibility="gone"
-                    android:layout_marginRight="5dp"
-                    android:layout_toLeftOf="@id/pano_pan_progress_bar_layout"
-                    android:layout_centerVertical="true"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
-
-            <ImageView
-                    android:id="@+id/pano_pan_right_indicator"
-                    android:src="@drawable/pano_direction_right_indicator"
-                    android:visibility="gone"
-                    android:layout_marginLeft="5dp"
-                    android:layout_toRightOf="@id/pano_pan_progress_bar_layout"
-                    android:layout_centerVertical="true"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
-        </RelativeLayout>
-
-    </LinearLayout>
-
-    <!-- The hint for "Too fast" text view -->
-    <com.android.camera.ui.RotateLayout
-            android:id="@+id/pano_capture_too_fast_textview_layout"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerInParent="true">
-        <TextView android:id="@+id/pano_capture_too_fast_textview"
-                android:text="@string/pano_too_fast_prompt"
-                android:textAppearance="?android:textAppearanceMedium"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:visibility="gone" />
-    </com.android.camera.ui.RotateLayout>
-</RelativeLayout>
diff --git a/res/layout-port/pano_module_capture.xml b/res/layout-port/pano_module_capture.xml
deleted file mode 100644
index d9c9877..0000000
--- a/res/layout-port/pano_module_capture.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/camera_app"
-        android:layout_height="match_parent"
-        android:layout_width="match_parent"
-        android:orientation="vertical">
-
-    <include layout="@layout/preview_frame_pano" />
-
-</LinearLayout>
diff --git a/res/layout-port/pano_review.xml b/res/layout-port/pano_review.xml
deleted file mode 100644
index b2e3d8d..0000000
--- a/res/layout-port/pano_review.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/pano_review_layout"
-        android:visibility="gone"
-        android:layout_height="match_parent"
-        android:layout_width="match_parent">
-
-    <LinearLayout
-            android:orientation="vertical"
-            android:layout_height="match_parent"
-            android:layout_width="match_parent">
-        <TextView style="@style/PanoViewHorizontalBar"
-                android:text="@string/pano_review_rendering"
-                android:textAppearance="?android:textAppearanceMedium"
-                android:gravity="center" />
-
-        <com.android.camera.ui.RotateLayout
-                android:id="@+id/pano_rotate_reviewarea"
-                android:layout_width="match_parent"
-                android:layout_height="0dp"
-                android:layout_weight="1.5">
-            <ImageView android:id="@+id/pano_reviewarea"
-                    android:scaleType="fitCenter"
-                    android:layout_height="match_parent"
-                    android:layout_width="match_parent" />
-        </com.android.camera.ui.RotateLayout>
-
-        <View style="@style/PanoViewHorizontalBar"/>
-    </LinearLayout>
-
-    <com.android.camera.ui.RotateLayout
-            android:id="@+id/pano_saving_progress_bar_layout"
-            android:layout_centerHorizontal="true"
-            android:layout_above="@+id/shutter_button_placeholder"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content">
-        <com.android.camera.PanoProgressBar
-                android:id="@+id/pano_saving_progress_bar"
-                android:src="@drawable/ic_pan_progression"
-                android:layout_centerInParent="true"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content" />
-    </com.android.camera.ui.RotateLayout>
-
-    <ImageView android:id="@id/shutter_button_placeholder"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerHorizontal="true"
-            android:layout_alignParentBottom="true"
-            android:layout_marginBottom="@dimen/shutter_offset"
-            android:visibility="invisible"
-            android:layout_gravity="center"
-            android:src="@drawable/btn_shutter_default"/>
-
-    <com.android.camera.ui.RotateImageView android:id="@id/pano_review_cancel_button"
-            style="@style/ReviewControlIcon"
-            android:contentDescription="@string/accessibility_review_cancel"
-            android:layout_alignParentBottom="true"
-            android:layout_centerHorizontal="true"
-            android:layout_centerVertical="false"
-            android:src="@drawable/ic_menu_cancel_holo_light" />
-</RelativeLayout>
diff --git a/res/layout-port/preview_frame_pano.xml b/res/layout-port/preview_frame_pano.xml
deleted file mode 100644
index 09d7899..0000000
--- a/res/layout-port/preview_frame_pano.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/frame_layout"
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:layout_weight="1">
-
-    <LinearLayout android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:baselineAligned="false"
-            android:orientation="vertical">
-        <FrameLayout style="@style/PanoViewHorizontalBar">
-            <TextView android:id="@+id/pano_capture_indicator"
-                    android:text="@string/pano_capture_indication"
-                    android:textAppearance="?android:textAppearanceMedium"
-                    android:visibility="gone"
-                    android:layout_gravity="center"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
-        </FrameLayout>
-
-        <com.android.camera.ui.LayoutNotifyView
-                android:id="@+id/pano_preview_area"
-                android:visibility="invisible"
-                android:background="@drawable/ic_pan_border_fast"
-                android:layout_gravity="center"
-                android:layout_weight="2"
-                android:layout_width="match_parent"
-                android:layout_height="0dp" />
-
-        <View style="@style/PanoViewHorizontalBar"/>
-    </LinearLayout>
-
-    <!-- The hint for "Too fast" text view -->
-    <com.android.camera.ui.RotateLayout
-            android:id="@+id/pano_capture_too_fast_textview_layout"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerInParent="true">
-        <TextView android:id="@+id/pano_capture_too_fast_textview"
-                android:text="@string/pano_too_fast_prompt"
-                android:textAppearance="?android:textAppearanceMedium"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:visibility="gone" />
-    </com.android.camera.ui.RotateLayout>
-
-    <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_above="@+id/placeholder">
-        <com.android.camera.ui.RotateLayout
-                android:id="@+id/pano_pan_progress_bar_layout"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerInParent="true">
-            <com.android.camera.PanoProgressBar
-                    android:id="@+id/pano_pan_progress_bar"
-                    android:visibility="gone"
-                    android:src="@drawable/ic_pan_progression"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
-        </com.android.camera.ui.RotateLayout>
-
-        <ImageView
-                android:id="@+id/pano_pan_left_indicator"
-                android:src="@drawable/pano_direction_left_indicator"
-                android:visibility="gone"
-                android:layout_marginRight="5dp"
-                android:layout_toLeftOf="@id/pano_pan_progress_bar_layout"
-                android:layout_centerVertical="true"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-
-        <ImageView
-                android:id="@+id/pano_pan_right_indicator"
-                android:src="@drawable/pano_direction_right_indicator"
-                android:visibility="gone"
-                android:layout_marginLeft="5dp"
-                android:layout_toRightOf="@id/pano_pan_progress_bar_layout"
-                android:layout_centerVertical="true"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-    </RelativeLayout>
-
-    <ImageView
-            android:id="@id/placeholder"
-            android:visibility="invisible"
-            android:layout_centerHorizontal="true"
-            android:layout_alignParentBottom="true"
-            android:layout_marginBottom="@dimen/shutter_offset"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:src="@drawable/btn_shutter_default" />
-
-</RelativeLayout>
diff --git a/res/layout/panorama_module.xml b/res/layout/panorama_module.xml
deleted file mode 100644
index 9ecbd07..0000000
--- a/res/layout/panorama_module.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/pano_layout"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <include layout="@layout/pano_module_capture" />
-    <include layout="@layout/pano_review" />
-</merge>
diff --git a/src/com/android/camera/PanoProgressBar.java b/src/com/android/camera/PanoProgressBar.java
deleted file mode 100644
index 8dfb366..0000000
--- a/src/com/android/camera/PanoProgressBar.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.camera;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.RectF;
-import android.util.AttributeSet;
-import android.widget.ImageView;
-
-class PanoProgressBar extends ImageView {
-    @SuppressWarnings("unused")
-    private static final String TAG = "PanoProgressBar";
-    public static final int DIRECTION_NONE = 0;
-    public static final int DIRECTION_LEFT = 1;
-    public static final int DIRECTION_RIGHT = 2;
-    private float mProgress = 0;
-    private float mMaxProgress = 0;
-    private float mLeftMostProgress = 0;
-    private float mRightMostProgress = 0;
-    private float mProgressOffset = 0;
-    private float mIndicatorWidth = 0;
-    private int mDirection = 0;
-    private final Paint mBackgroundPaint = new Paint();
-    private final Paint mDoneAreaPaint = new Paint();
-    private final Paint mIndicatorPaint = new Paint();
-    private float mWidth;
-    private float mHeight;
-    private RectF mDrawBounds;
-    private OnDirectionChangeListener mListener = null;
-
-    public interface OnDirectionChangeListener {
-        public void onDirectionChange(int direction);
-    }
-
-    public PanoProgressBar(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        mDoneAreaPaint.setStyle(Paint.Style.FILL);
-        mDoneAreaPaint.setAlpha(0xff);
-
-        mBackgroundPaint.setStyle(Paint.Style.FILL);
-        mBackgroundPaint.setAlpha(0xff);
-
-        mIndicatorPaint.setStyle(Paint.Style.FILL);
-        mIndicatorPaint.setAlpha(0xff);
-
-        mDrawBounds = new RectF();
-    }
-
-    public void setOnDirectionChangeListener(OnDirectionChangeListener l) {
-        mListener = l;
-    }
-
-    private void setDirection(int direction) {
-        if (mDirection != direction) {
-            mDirection = direction;
-            if (mListener != null) {
-                mListener.onDirectionChange(mDirection);
-            }
-            invalidate();
-        }
-    }
-
-    public int getDirection() {
-        return mDirection;
-    }
-
-    @Override
-    public void setBackgroundColor(int color) {
-        mBackgroundPaint.setColor(color);
-        invalidate();
-    }
-
-    public void setDoneColor(int color) {
-        mDoneAreaPaint.setColor(color);
-        invalidate();
-    }
-
-    public void setIndicatorColor(int color) {
-        mIndicatorPaint.setColor(color);
-        invalidate();
-    }
-
-    @Override
-    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
-        mWidth = w;
-        mHeight = h;
-        mDrawBounds.set(0, 0, mWidth, mHeight);
-    }
-
-    public void setMaxProgress(int progress) {
-        mMaxProgress = progress;
-    }
-
-    public void setIndicatorWidth(float w) {
-        mIndicatorWidth = w;
-        invalidate();
-    }
-
-    public void setRightIncreasing(boolean rightIncreasing) {
-        if (rightIncreasing) {
-            mLeftMostProgress = 0;
-            mRightMostProgress = 0;
-            mProgressOffset = 0;
-            setDirection(DIRECTION_RIGHT);
-        } else {
-            mLeftMostProgress = mWidth;
-            mRightMostProgress = mWidth;
-            mProgressOffset = mWidth;
-            setDirection(DIRECTION_LEFT);
-        }
-        invalidate();
-    }
-
-    public void setProgress(int progress) {
-        // The panning direction will be decided after user pan more than 10 degrees in one
-        // direction.
-        if (mDirection == DIRECTION_NONE) {
-            if (progress > 10) {
-                setRightIncreasing(true);
-            } else if (progress < -10) {
-                setRightIncreasing(false);
-            }
-        }
-        // mDirection might be modified by setRightIncreasing() above. Need to check again.
-        if (mDirection != DIRECTION_NONE) {
-            mProgress = progress * mWidth / mMaxProgress + mProgressOffset;
-            // value bounds.
-            mProgress = Math.min(mWidth, Math.max(0, mProgress));
-            if (mDirection == DIRECTION_RIGHT) {
-                // The right most progress is adjusted.
-                mRightMostProgress = Math.max(mRightMostProgress, mProgress);
-            }
-            if (mDirection == DIRECTION_LEFT) {
-                // The left most progress is adjusted.
-                mLeftMostProgress = Math.min(mLeftMostProgress, mProgress);
-            }
-            invalidate();
-        }
-    }
-
-    public void reset() {
-        mProgress = 0;
-        mProgressOffset = 0;
-        setDirection(DIRECTION_NONE);
-        invalidate();
-    }
-
-    @Override
-    protected void onDraw(Canvas canvas) {
-        // the background
-        canvas.drawRect(mDrawBounds, mBackgroundPaint);
-        if (mDirection != DIRECTION_NONE) {
-            // the progress area
-            canvas.drawRect(mLeftMostProgress, mDrawBounds.top, mRightMostProgress,
-                    mDrawBounds.bottom, mDoneAreaPaint);
-            // the indication bar
-            float l;
-            float r;
-            if (mDirection == DIRECTION_RIGHT) {
-                l = Math.max(mProgress - mIndicatorWidth, 0f);
-                r = mProgress;
-            } else {
-                l = mProgress;
-                r = Math.min(mProgress + mIndicatorWidth, mWidth);
-            }
-            canvas.drawRect(l, mDrawBounds.top, r, mDrawBounds.bottom, mIndicatorPaint);
-        }
-
-        // draw the mask image on the top for shaping.
-        super.onDraw(canvas);
-    }
-}