Clean up camera switcher

Change-Id: I9f0495524028528ca02c7ddf94f4698d4e87af14
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index dde4c56..f580450 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -113,9 +113,6 @@
     public static final boolean HAS_MEDIA_ACTION_SOUND =
             Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
 
-    public static final boolean HAS_OLD_PANORAMA =
-            Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
-
     public static final boolean HAS_TIME_LAPSE_RECORDING =
             Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
 
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index c5cbb7e..07cb6ce 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -44,6 +44,7 @@
 
 import com.android.camera.data.CameraDataAdapter;
 import com.android.camera.data.LocalData;
+import com.android.camera.ui.CameraSwitcher;
 import com.android.camera.ui.CameraSwitcher.CameraSwitchListener;
 import com.android.camera.ui.FilmStripView;
 import com.android.gallery3d.R;
@@ -55,11 +56,6 @@
 
     private static final String TAG = "CAM_Activity";
 
-    public static final int PHOTO_MODULE_INDEX = 0;
-    public static final int VIDEO_MODULE_INDEX = 1;
-    public static final int PANORAMA_MODULE_INDEX = 2;
-    public static final int LIGHTCYCLE_MODULE_INDEX = 3;
-
     private static final String INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE =
             "android.media.action.STILL_IMAGE_CAMERA_SECURE";
     public static final String ACTION_IMAGE_CAPTURE_SECURE =
@@ -422,13 +418,13 @@
         closeModule(mCurrentModule);
         mCurrentModuleIndex = i;
         switch (i) {
-            case VIDEO_MODULE_INDEX:
+            case CameraSwitcher.VIDEO_MODULE_INDEX:
                 mCurrentModule = new VideoModule();
                 break;
-            case PHOTO_MODULE_INDEX:
+            case CameraSwitcher.PHOTO_MODULE_INDEX:
                 mCurrentModule = new PhotoModule();
                 break;
-            case LIGHTCYCLE_MODULE_INDEX:
+            case CameraSwitcher.LIGHTCYCLE_MODULE_INDEX:
                 mCurrentModule = LightCycleHelper.createPanoramaModule();
                 break;
            default:
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index b2a9df8..96d21f0 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -195,7 +195,7 @@
 
         mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button);
         mSwitcher = (CameraSwitcher) mRootView.findViewById(R.id.camera_switcher);
-        mSwitcher.setCurrentIndex(0);
+        mSwitcher.setCurrentIndex(CameraSwitcher.PHOTO_MODULE_INDEX);
         mSwitcher.setSwitchListener((CameraSwitchListener) mActivity);
         mMenuButton = mRootView.findViewById(R.id.menu);
         if (ApiHelper.HAS_FACE_DETECTION) {
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index c446b97..169fc7d 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -143,7 +143,7 @@
         ((CameraRootView) mRootView).setDisplayChangeListener(this);
         mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button);
         mSwitcher = (CameraSwitcher) mRootView.findViewById(R.id.camera_switcher);
-        mSwitcher.setCurrentIndex(1);
+        mSwitcher.setCurrentIndex(CameraSwitcher.VIDEO_MODULE_INDEX);
         mSwitcher.setSwitchListener((CameraSwitchListener) mActivity);
         initializeMiscControls();
         initializeControlByIntent();
diff --git a/src/com/android/camera/ui/CameraSwitcher.java b/src/com/android/camera/ui/CameraSwitcher.java
index 537577f..90d88d2 100644
--- a/src/com/android/camera/ui/CameraSwitcher.java
+++ b/src/com/android/camera/ui/CameraSwitcher.java
@@ -48,12 +48,10 @@
 
     public static final int PHOTO_MODULE_INDEX = 0;
     public static final int VIDEO_MODULE_INDEX = 1;
-    public static final int PANORAMA_MODULE_INDEX = 2;
-    public static final int LIGHTCYCLE_MODULE_INDEX = 3;
+    public static final int LIGHTCYCLE_MODULE_INDEX = 2;
     private static final int[] DRAW_IDS = {
             R.drawable.ic_switch_camera,
             R.drawable.ic_switch_video,
-            R.drawable.ic_switch_pan,
             R.drawable.ic_switch_photosphere
     };
     public interface CameraSwitchListener {
@@ -98,17 +96,13 @@
     public void initializeDrawables(Context context) {
         int totaldrawid = (LightCycleHelper.hasLightCycleCapture(context)
                 ? DRAW_IDS.length : DRAW_IDS.length - 1);
-        if (!ApiHelper.HAS_OLD_PANORAMA) totaldrawid--;
 
         int[] drawids = new int[totaldrawid];
         int[] moduleids = new int[totaldrawid];
         int ix = 0;
         for (int i = 0; i < DRAW_IDS.length; i++) {
-            if (i == PANORAMA_MODULE_INDEX && !ApiHelper.HAS_OLD_PANORAMA) {
-            continue; // not enabled, so don't add to UI
-            }
             if (i == LIGHTCYCLE_MODULE_INDEX && !LightCycleHelper.hasLightCycleCapture(context)) {
-            continue; // not enabled, so don't add to UI
+                continue; // not enabled, so don't add to UI
             }
             moduleids[ix] = i;
             drawids[ix++] = DRAW_IDS[i];
@@ -188,10 +182,6 @@
                     item.setContentDescription(getContext().getResources().getString(
                             R.string.accessibility_switch_to_video));
                     break;
-                case R.drawable.ic_switch_pan:
-                    item.setContentDescription(getContext().getResources().getString(
-                            R.string.accessibility_switch_to_panorama));
-                    break;
                 case R.drawable.ic_switch_photosphere:
                     item.setContentDescription(getContext().getResources().getString(
                             R.string.accessibility_switch_to_new_panorama));