Gcam: begone

Change-Id: I3eef0941a80b1363d9dd721256f1ee792dedd1ad
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/Android.mk b/Android.mk
index 5bb34ce..104f078 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,7 +14,6 @@
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)
-LOCAL_SRC_FILES += $(call all-java-files-under, src_pd_gcam)
 LOCAL_SRC_FILES += $(call all-java-files-under, src_wrapper)
 LOCAL_SRC_FILES += $(call all-java-files-under, quickReader/src)
 LOCAL_SRC_FILES += $(call all-renderscript-files-under, rs)
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 137b5ff..7525b95 100755
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -82,14 +82,11 @@
 import android.widget.ProgressBar;
 import android.widget.ShareActionProvider;
 
-import com.android.camera.app.AppManagerFactory;
-import com.android.camera.app.PlaceholderManager;
 import com.android.camera.crop.CropActivity;
 import com.android.camera.data.CameraDataAdapter;
 import com.android.camera.data.CameraPreviewData;
 import com.android.camera.data.FixedFirstDataAdapter;
 import com.android.camera.data.FixedLastDataAdapter;
-import com.android.camera.data.InProgressDataWrapper;
 import com.android.camera.data.LocalData;
 import com.android.camera.data.LocalDataAdapter;
 import com.android.camera.data.LocalMediaObserver;
@@ -102,7 +99,6 @@
 import com.android.camera.ui.ModuleSwitcher;
 import com.android.camera.util.CameraUtil;
 import com.android.camera.util.FeatureHelper;
-import com.android.camera.util.GcamHelper;
 import com.android.camera.util.IntentHelper;
 import com.android.camera.util.PersistUtil;
 import com.android.camera.util.UsageStatistics;
@@ -194,7 +190,6 @@
     private LocalDataAdapter mWrappedDataAdapter;
 
     private Context mContext;
-    private PlaceholderManager mPlaceholderManager;
     private int mCurrentModuleIndex;
     private CameraModule mCurrentModule;
     private PhotoModule mPhotoModule;
@@ -1154,41 +1149,6 @@
             item.setVisible(visible);
     }
 
-    private ImageTaskManager.TaskListener mPlaceholderListener =
-            new ImageTaskManager.TaskListener() {
-
-                @Override
-                public void onTaskQueued(String filePath, final Uri imageUri) {
-                    mMainHandler.post(new Runnable() {
-                        @Override
-                        public void run() {
-                            notifyNewMedia(imageUri);
-                            int dataID = mDataAdapter.findDataByContentUri(imageUri);
-                            if (dataID != -1) {
-                                LocalData d = mDataAdapter.getLocalData(dataID);
-                                InProgressDataWrapper newData = new InProgressDataWrapper(d, true);
-                                mDataAdapter.updateData(dataID, newData);
-                            }
-                        }
-                    });
-                }
-
-                @Override
-                public void onTaskDone(String filePath, final Uri imageUri) {
-                    mMainHandler.post(new Runnable() {
-                        @Override
-                        public void run() {
-                            mDataAdapter.refresh(getContentResolver(), imageUri);
-                        }
-                    });
-                }
-
-                @Override
-                public void onTaskProgress(String filePath, Uri imageUri, int progress) {
-                    // Do nothing
-                }
-    };
-
     public MediaSaveService getMediaSaveService() {
         return mMediaSaveService;
     }
@@ -1208,8 +1168,6 @@
             mDataAdapter.addNewPhoto(cr, uri);
         } else if (mimeType.startsWith("application/stitching-preview")) {
             mDataAdapter.addNewPhoto(cr, uri);
-        } else if (mimeType.startsWith(PlaceholderManager.PLACEHOLDER_MIME_TYPE)) {
-            mDataAdapter.addNewPhoto(cr, uri);
         } else {
             android.util.Log.w(TAG, "Unknown new media with MIME type:"
                     + mimeType + ", uri:" + uri);
@@ -1436,7 +1394,6 @@
 
         mCursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                 null, null, null, null);
-        GcamHelper.init(getContentResolver());
 
         getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
 
@@ -1452,14 +1409,8 @@
                 || MediaStore.ACTION_VIDEO_CAPTURE.equals(getIntent().getAction())) {
             moduleIndex = ModuleSwitcher.VIDEO_MODULE_INDEX;
         } else if (MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA.equals(getIntent().getAction())
-                || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(getIntent()
-                .getAction())) {
+                || MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(getIntent().getAction())) {
             moduleIndex = ModuleSwitcher.PHOTO_MODULE_INDEX;
-            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
-            if (prefs.getInt(CameraSettings.KEY_STARTUP_MODULE_INDEX, -1)
-                    == ModuleSwitcher.GCAM_MODULE_INDEX && GcamHelper.hasGcamCapture()) {
-                moduleIndex = ModuleSwitcher.GCAM_MODULE_INDEX;
-            }
         } else if (MediaStore.ACTION_IMAGE_CAPTURE.equals(getIntent().getAction())
                 || MediaStore.ACTION_IMAGE_CAPTURE_SECURE.equals(getIntent().getAction())) {
             moduleIndex = ModuleSwitcher.PHOTO_MODULE_INDEX;
@@ -1468,8 +1419,7 @@
             // read the module index from the last time the user changed modes
             SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
             moduleIndex = prefs.getInt(CameraSettings.KEY_STARTUP_MODULE_INDEX, -1);
-            if ((moduleIndex == ModuleSwitcher.GCAM_MODULE_INDEX &&
-                    !GcamHelper.hasGcamCapture()) || moduleIndex < 0) {
+            if (moduleIndex < 0) {
                 moduleIndex = ModuleSwitcher.PHOTO_MODULE_INDEX;
             }
         }
@@ -1503,9 +1453,6 @@
         mAboveFilmstripControlLayout =
                 (FrameLayout) findViewById(R.id.camera_above_filmstrip_layout);
         mAboveFilmstripControlLayout.setFitsSystemWindows(true);
-        mPlaceholderManager = AppManagerFactory.getInstance(this)
-                .getGcamProcessingManager();
-        mPlaceholderManager.addTaskListener(mPlaceholderListener);
         mBottomProgress = (ProgressBar) findViewById(R.id.pano_stitching_progress_bar);
         mCameraPreviewData = new CameraPreviewData(rootLayout,
                 FilmStripView.ImageData.SIZE_FULL,
@@ -2109,7 +2056,6 @@
                 break;
 
             case ModuleSwitcher.LIGHTCYCLE_MODULE_INDEX: //Unused module for now
-            case ModuleSwitcher.GCAM_MODULE_INDEX:  //Unused module for now
             case ModuleSwitcher.PHOTO_MODULE_INDEX:
             default:
                 // Fall back to photo mode.
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 9cd6d48..c5d072e 100755
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -31,7 +31,6 @@
 import android.util.Log;
 
 import com.android.camera.util.CameraUtil;
-import com.android.camera.util.GcamHelper;
 import com.android.camera.util.MultiMap;
 import com.android.camera.util.PersistUtil;
 
@@ -1124,7 +1123,7 @@
         }
         int frontCameraId = CameraHolder.instance().getFrontCameraId();
         boolean isFrontCamera = (frontCameraId == mCameraId);
-        if (cameraHdrPlus != null && (!GcamHelper.hasGcamCapture() || isFrontCamera)) {
+        if (cameraHdrPlus != null && isFrontCamera) {
             removePreference(group, cameraHdrPlus.getKey());
         }
         if (powerShutter != null && CameraUtil.hasCameraKey()) {
diff --git a/src/com/android/camera/ImageTaskManager.java b/src/com/android/camera/ImageTaskManager.java
deleted file mode 100644
index 601de4c..0000000
--- a/src/com/android/camera/ImageTaskManager.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2013 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.net.Uri;
-
-/**
- * The interface for background image processing task manager.
- */
-public interface ImageTaskManager {
-
-    /**
-     * Callback interface for task events.
-     */
-    public interface TaskListener {
-        public void onTaskQueued(String filePath, Uri imageUri);
-        public void onTaskDone(String filePath, Uri imageUri);
-        public void onTaskProgress(
-                String filePath, Uri imageUri, int progress);
-    }
-
-    public void addTaskListener(TaskListener l);
-
-    public void removeTaskListener(TaskListener l);
-
-    /**
-     * Get task progress by Uri.
-     *
-     * @param uri         The Uri of the final image file to identify the task.
-     * @return            Integer from 0 to 100, or -1. The percentage of the task done
-     *                    so far. -1 means not found.
-     */
-    public int getTaskProgress(Uri uri);
-}
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index ac4d9a8..e070b4f 100755
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -80,7 +80,6 @@
 import com.android.camera.ui.ModuleSwitcher;
 import com.android.camera.ui.RotateTextToast;
 import com.android.camera.util.CameraUtil;
-import com.android.camera.util.GcamHelper;
 import com.android.camera.util.PersistUtil;
 import com.android.camera.util.UsageStatistics;
 import org.codeaurora.snapcam.R;
@@ -533,11 +532,6 @@
                     break;
                }
 
-                case SWITCH_TO_GCAM_MODULE: {
-                    mActivity.onModuleSelected(ModuleSwitcher.GCAM_MODULE_INDEX);
-                    break;
-                }
-
                 case ON_PREVIEW_STARTED: {
                     onPreviewStarted();
                     break;
@@ -4167,38 +4161,32 @@
                 mActivity.getString(R.string.pref_camera_hdr_plus_default));
         boolean hdrOn = onValue.equals(hdr);
         boolean hdrPlusOn = onValue.equals(hdrPlus);
-        boolean doGcamModeSwitch = false;
 
-        if (hdrPlusOn && GcamHelper.hasGcamCapture()) {
-            // Kick off mode switch to gcam.
-            doGcamModeSwitch = true;
-        } else {
-            if (hdrOn) {
-                mSceneMode = CameraUtil.SCENE_MODE_HDR;
-                if (!(Parameters.SCENE_MODE_AUTO).equals(mParameters.getSceneMode())
-                    && !(Parameters.SCENE_MODE_HDR).equals(mParameters.getSceneMode())) {
-                    mParameters.setSceneMode(Parameters.SCENE_MODE_AUTO);
-                    mCameraDevice.setParameters(mParameters);
-                    mParameters = mCameraDevice.getParameters();
-                }
-                if (mLgeHdrMode) {
-                    mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_MODE,
-                            CameraSettings.LGE_HDR_MODE_ON);
-                    try {
-                        // Force enable ZSL mode for LG HDR
-                        mUI.setPreference(CameraSettings.KEY_ZSL, Parameters.ZSL_ON);
-                    } catch (NullPointerException e) {
-                    }
-                }
-            } else {
-                if (mLgeHdrMode) {
-                    mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_MODE,
-                            CameraSettings.LGE_HDR_MODE_OFF);
-                }
-                mSceneMode = mPreferences.getString(
-                        CameraSettings.KEY_SCENE_MODE,
-                        mActivity.getString(R.string.pref_camera_scenemode_default));
+        if (hdrOn) {
+            mSceneMode = CameraUtil.SCENE_MODE_HDR;
+            if (!(Parameters.SCENE_MODE_AUTO).equals(mParameters.getSceneMode())
+                && !(Parameters.SCENE_MODE_HDR).equals(mParameters.getSceneMode())) {
+                mParameters.setSceneMode(Parameters.SCENE_MODE_AUTO);
+                mCameraDevice.setParameters(mParameters);
+                mParameters = mCameraDevice.getParameters();
             }
+            if (mLgeHdrMode) {
+                mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_MODE,
+                        CameraSettings.LGE_HDR_MODE_ON);
+                try {
+                    // Force enable ZSL mode for LG HDR
+                    mUI.setPreference(CameraSettings.KEY_ZSL, Parameters.ZSL_ON);
+                } catch (NullPointerException e) {
+                }
+            }
+        } else {
+            if (mLgeHdrMode) {
+                mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_MODE,
+                        CameraSettings.LGE_HDR_MODE_OFF);
+            }
+            mSceneMode = mPreferences.getString(
+                    CameraSettings.KEY_SCENE_MODE,
+                    mActivity.getString(R.string.pref_camera_scenemode_default));
         }
 
         String refocusOn = mActivity.getString(R.string
@@ -4376,7 +4364,7 @@
 
         //QCom related parameters updated here.
         qcomUpdateCameraParametersPreference();
-        return doGcamModeSwitch;
+        return false;
     }
 
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@@ -4398,8 +4386,6 @@
             return;
         }
         synchronized (mCameraDevice) {
-            boolean doModeSwitch = false;
-
             if ((updateSet & UPDATE_PARAM_INITIALIZE) != 0) {
                 updateCameraParametersInitialize();
             }
@@ -4409,17 +4395,12 @@
             }
 
             if ((updateSet & UPDATE_PARAM_PREFERENCE) != 0) {
-                doModeSwitch = updateCameraParametersPreference();
+                updateCameraParametersPreference();
             }
 
             CameraUtil.dumpParameters(mParameters);
             mCameraDevice.setParameters(mParameters);
             mFocusManager.setParameters(mParameters);
-
-            // Switch to gcam module if HDR+ was selected
-            if (doModeSwitch && !mIsImageCaptureIntent) {
-                mHandler.sendEmptyMessage(SWITCH_TO_GCAM_MODULE);
-            }
         }
     }
 
diff --git a/src/com/android/camera/app/AppManagerFactory.java b/src/com/android/camera/app/AppManagerFactory.java
deleted file mode 100644
index 59aa349..0000000
--- a/src/com/android/camera/app/AppManagerFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2013 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.app;
-
-import android.content.Context;
-
-/**
- * A singleton class which provides application level utility
- * classes.
- */
-public class AppManagerFactory {
-
-    private static AppManagerFactory sFactory;
-
-    public static synchronized AppManagerFactory getInstance(Context ctx) {
-        if (sFactory == null) {
-            sFactory = new AppManagerFactory(ctx.getApplicationContext());
-        }
-        return sFactory;
-    }
-
-    private PlaceholderManager mGcamProcessingManager;
-
-    /** No public constructor. */
-    private AppManagerFactory(Context ctx) {
-        mGcamProcessingManager = new PlaceholderManager(ctx);
-    }
-
-    public PlaceholderManager getGcamProcessingManager() {
-        return mGcamProcessingManager;
-    }
-}
diff --git a/src/com/android/camera/app/PlaceholderManager.java b/src/com/android/camera/app/PlaceholderManager.java
deleted file mode 100644
index 326f0be..0000000
--- a/src/com/android/camera/app/PlaceholderManager.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2013 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.app;
-
-import android.content.Context;
-import android.graphics.BitmapFactory;
-import android.location.Location;
-import android.net.Uri;
-
-import com.android.camera.ImageTaskManager;
-import com.android.camera.Storage;
-import com.android.camera.exif.ExifInterface;
-import com.android.camera.util.CameraUtil;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-public class PlaceholderManager implements ImageTaskManager {
-    private static final String TAG = "PlaceholderManager";
-
-    public static final String PLACEHOLDER_MIME_TYPE = "application/placeholder-image";
-    private final Context mContext;
-
-    final private ArrayList<WeakReference<TaskListener>> mListenerRefs;
-
-    public static class Session {
-        String outputTitle;
-        Uri outputUri;
-        long time;
-
-        Session(String title, Uri uri, long timestamp) {
-            outputTitle = title;
-            outputUri = uri;
-            time = timestamp;
-        }
-    }
-
-    public PlaceholderManager(Context context) {
-        mContext = context;
-        mListenerRefs = new ArrayList<WeakReference<TaskListener>>();
-    }
-
-    @Override
-    public void addTaskListener(TaskListener l) {
-        synchronized (mListenerRefs) {
-            if (findTaskListener(l) == -1) {
-                mListenerRefs.add(new WeakReference<TaskListener>(l));
-            }
-        }
-    }
-
-    @Override
-    public void removeTaskListener(TaskListener l) {
-        synchronized (mListenerRefs) {
-            int i = findTaskListener(l);
-            if (i != -1) {
-                mListenerRefs.remove(i);
-            }
-        }
-    }
-
-    @Override
-    public int getTaskProgress(Uri uri) {
-        return 0;
-    }
-
-    private int findTaskListener(TaskListener listener) {
-        int index = -1;
-        for (int i = 0; i < mListenerRefs.size(); i++) {
-            TaskListener l = mListenerRefs.get(i).get();
-            if (l != null && l == listener) {
-                index = i;
-                break;
-            }
-        }
-        return index;
-    }
-
-    private Iterable<TaskListener> getListeners() {
-        return new Iterable<TaskListener>() {
-            @Override
-            public Iterator<TaskListener> iterator() {
-                return new ListenerIterator();
-            }
-        };
-    }
-
-    private class ListenerIterator implements Iterator<TaskListener> {
-        private int mIndex = 0;
-        private TaskListener mNext = null;
-
-        @Override
-        public boolean hasNext() {
-            while (mNext == null && mIndex < mListenerRefs.size()) {
-                mNext = mListenerRefs.get(mIndex).get();
-                if (mNext == null) {
-                    mListenerRefs.remove(mIndex);
-                }
-            }
-            return mNext != null;
-        }
-
-        @Override
-        public TaskListener next() {
-            hasNext(); // Populates mNext
-            mIndex++;
-            TaskListener next = mNext;
-            mNext = null;
-            return next;
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    public Session insertPlaceholder(String title, byte[] placeholder, long timestamp) {
-        if (title == null || placeholder == null) {
-            throw new IllegalArgumentException("Null argument passed to insertPlaceholder");
-        }
-
-        // Decode bounds
-        BitmapFactory.Options options = new BitmapFactory.Options();
-        options.inJustDecodeBounds = true;
-        BitmapFactory.decodeByteArray(placeholder, 0, placeholder.length, options);
-        int width = options.outWidth;
-        int height = options.outHeight;
-
-        if (width <= 0 || height <= 0) {
-            throw new IllegalArgumentException("Image had bad height/width");
-        }
-
-        Uri uri =
-                Storage.addImage(mContext.getContentResolver(), title, timestamp, null, 0, null,
-                        placeholder, width, height, PLACEHOLDER_MIME_TYPE);
-
-        if (uri == null) {
-            return null;
-        }
-
-        String filePath = uri.getPath();
-        synchronized (mListenerRefs) {
-            for (TaskListener l : getListeners()) {
-                l.onTaskQueued(filePath, uri);
-            }
-        }
-
-        return new Session(title, uri, timestamp);
-    }
-
-    public void replacePlaceholder(Session session, Location location, int orientation,
-            ExifInterface exif, byte[] jpeg, int width, int height, String mimeType) {
-
-        Storage.updateImage(session.outputUri, mContext.getContentResolver(), session.outputTitle,
-                session.time, location, orientation, exif, jpeg, width, height, mimeType);
-
-        synchronized (mListenerRefs) {
-            for (TaskListener l : getListeners()) {
-                l.onTaskDone(session.outputUri.getPath(), session.outputUri);
-            }
-        }
-        CameraUtil.broadcastNewPicture(mContext, session.outputUri);
-    }
-
-    public void removePlaceholder(Session session) {
-        Storage.deleteImage(mContext.getContentResolver(), session.outputUri);
-    }
-
-}
diff --git a/src/com/android/camera/data/CameraDataAdapter.java b/src/com/android/camera/data/CameraDataAdapter.java
index 95c1ea7..d22a9cd 100755
--- a/src/com/android/camera/data/CameraDataAdapter.java
+++ b/src/com/android/camera/data/CameraDataAdapter.java
@@ -29,7 +29,6 @@
 
 import com.android.camera.SDCard;
 import com.android.camera.Storage;
-import com.android.camera.app.PlaceholderManager;
 import com.android.camera.ui.FilmStripView.ImageData;
 
 import java.util.ArrayList;
@@ -309,11 +308,7 @@
                 while (true) {
                     LocalData data = LocalMediaData.PhotoData.buildFromCursor(c);
                     if (data != null) {
-                        if (data.getMimeType().equals(PlaceholderManager.PLACEHOLDER_MIME_TYPE)) {
-                            l.add(new InProgressDataWrapper(data, true));
-                        } else {
-                            l.add(data);
-                        }
+                        l.add(data);
                     } else {
                         Log.e(TAG, "Error loading data:"
                                 + c.getString(LocalMediaData.PhotoData.COL_DATA));
diff --git a/src/com/android/camera/data/InProgressDataWrapper.java b/src/com/android/camera/data/InProgressDataWrapper.java
deleted file mode 100644
index 3170434..0000000
--- a/src/com/android/camera/data/InProgressDataWrapper.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (C) 2013 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.data;
-
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.view.View;
-import android.widget.FrameLayout;
-
-import org.codeaurora.snapcam.R;
-
-/**
- * A wrapper class for in-progress data. Data that's still being processed
- * should not supporting any actions. Only methods related to actions like
- * {@link #isDataActionSupported(int)} and
- * {@link #isUIActionSupported(int)} are implemented by this class.
- */
-public class InProgressDataWrapper implements LocalData {
-
-    final LocalData mLocalData;
-    private boolean mHasProgressBar;
-
-    public InProgressDataWrapper(LocalData wrappedData) {
-        mLocalData = wrappedData;
-    }
-
-    public InProgressDataWrapper(LocalData wrappedData, boolean hasProgressBar) {
-        this(wrappedData);
-        mHasProgressBar = hasProgressBar;
-    }
-
-    @Override
-    public View getView(
-            Activity a, int width, int height,
-            Drawable placeHolder, LocalDataAdapter adapter) {
-        View v =  mLocalData.getView(a, width, height, placeHolder, adapter);
-
-        if (mHasProgressBar) {
-            // Return a framelayout with the progressbar and imageview.
-            FrameLayout frame = new FrameLayout(a);
-            frame.setLayoutParams(new FrameLayout.LayoutParams(width, height));
-            frame.addView(v);
-            a.getLayoutInflater()
-                    .inflate(R.layout.placeholder_progressbar, frame);
-            return frame;
-        }
-
-        return v;
-    }
-
-    @Override
-    public long getDateTaken() {
-        return mLocalData.getDateTaken();
-    }
-
-    @Override
-    public long getDateModified() {
-        return mLocalData.getLocalDataType();
-    }
-
-    @Override
-    public String getTitle() {
-        return mLocalData.getTitle();
-    }
-
-    @Override
-    public boolean isDataActionSupported(int actions) {
-        return false;
-    }
-
-    @Override
-    public boolean delete(Context c) {
-        // No actions are allowed to modify the wrapped data.
-        return false;
-    }
-
-    @Override
-    public boolean rotate90Degrees(
-            Context context, LocalDataAdapter adapter,
-            int currentDataId, boolean clockwise) {
-        // No actions are allowed to modify the wrapped data.
-        return false;
-    }
-
-    @Override
-    public void onFullScreen(boolean fullScreen) {
-        mLocalData.onFullScreen(fullScreen);
-    }
-
-    @Override
-    public boolean canSwipeInFullScreen() {
-        return mLocalData.canSwipeInFullScreen();
-    }
-
-    @Override
-    public String getPath() {
-        return mLocalData.getPath();
-    }
-
-    @Override
-    public String getMimeType() {
-        return mLocalData.getMimeType();
-    }
-
-    @Override
-    public MediaDetails getMediaDetails(Context context) {
-        return mLocalData.getMediaDetails(context);
-    }
-
-    @Override
-    public int getLocalDataType() {
-        // Force the data type to be in-progress data.
-        return LOCAL_IN_PROGRESS_DATA;
-    }
-
-    @Override
-    public long getSizeInBytes() {
-        return mLocalData.getSizeInBytes();
-    }
-
-    @Override
-    public LocalData refresh(ContentResolver resolver) {
-        return mLocalData.refresh(resolver);
-    }
-
-    @Override
-    public long getContentId() {
-        return mLocalData.getContentId();
-    }
-
-    @Override
-    public int getWidth() {
-        return mLocalData.getWidth();
-    }
-
-    @Override
-    public int getHeight() {
-        return mLocalData.getHeight();
-    }
-
-    @Override
-    public int getOrientation() {
-        return mLocalData.getOrientation();
-    }
-
-    @Override
-    public int getViewType() {
-        return mLocalData.getViewType();
-    }
-
-    @Override
-    public double[] getLatLong() {
-        return mLocalData.getLatLong();
-    }
-
-    @Override
-    public boolean isUIActionSupported(int action) {
-        return false;
-    }
-
-    @Override
-    public void prepare() {
-        mLocalData.prepare();
-    }
-
-    @Override
-    public void recycle() {
-        mLocalData.recycle();
-    }
-
-    @Override
-    public boolean isPhoto() {
-        return mLocalData.isPhoto();
-    }
-
-    @Override
-    public Uri getContentUri() {
-        return mLocalData.getContentUri();
-    }
-}
diff --git a/src/com/android/camera/ui/ModuleSwitcher.java b/src/com/android/camera/ui/ModuleSwitcher.java
index 85a8b4e..34d3b25 100644
--- a/src/com/android/camera/ui/ModuleSwitcher.java
+++ b/src/com/android/camera/ui/ModuleSwitcher.java
@@ -62,7 +62,6 @@
             R.drawable.ic_switch_pan,
             R.drawable.ic_cam_switcher_qr,
             R.drawable.ic_switch_photosphere,
-            R.drawable.ic_switch_gcam,
     };
 
     public interface ModuleSwitchListener {
@@ -111,9 +110,6 @@
             --numDrawIds;
         }
 
-        // Always decrement one because of GCam.
-        --numDrawIds;
-
         int[] drawids = new int[numDrawIds];
         int[] moduleids = new int[numDrawIds];
         int ix = 0;
@@ -121,9 +117,6 @@
             if (i == LIGHTCYCLE_MODULE_INDEX) {
                 continue; // not enabled, so don't add to UI
             }
-            if (i == GCAM_MODULE_INDEX) {
-                continue; // don't add to UI
-            }
             moduleids[ix] = i;
             drawids[ix++] = DRAW_IDS[i];
         }
@@ -137,11 +130,7 @@
 
     public void setCurrentIndex(int i) {
         mCurrentIndex = i;
-        if (i == GCAM_MODULE_INDEX) {
-          setImageResource(R.drawable.ic_switch_camera);
-        } else {
-          setImageResource(mDrawIds[i]);
-        }
+        setImageResource(mDrawIds[i]);
     }
 
     public void setSwitchListener(ModuleSwitchListener l) {
diff --git a/src_pd_gcam/com/android/camera/util/GcamHelper.java b/src_pd_gcam/com/android/camera/util/GcamHelper.java
deleted file mode 100644
index 9570f35..0000000
--- a/src_pd_gcam/com/android/camera/util/GcamHelper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2013 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.util;
-
-import android.content.ContentResolver;
-
-import com.android.camera.CameraModule;
-
-public class GcamHelper {
-
-    public static CameraModule createGcamModule() {
-        return null;
-    }
-
-    public static boolean hasGcamCapture() {
-        return false;
-    }
-
-    public static boolean hasGcamAsHDRMode() {
-        return false;
-    }
-
-    public static void init(ContentResolver contentResolver) {
-    }
-}