Skip to content

Commit

Permalink
Initialize GCam with GServices values.
Browse files Browse the repository at this point in the history
  Bug: 11103065

Change-Id: Ic8d3c9825abdc5d79c5e4c7b0e96770ab0941036
  • Loading branch information
shaeberling committed Oct 10, 2013
1 parent c14bfe6 commit 048bf4d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/com/android/camera/CameraActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,8 @@ private boolean isCaptureIntent() {
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
GcamHelper.init(getContentResolver());

getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
setContentView(R.layout.camera_filmstrip);
mActionBar = getActionBar();
Expand Down
2 changes: 1 addition & 1 deletion src/com/android/camera/CameraSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private void initPreference(PreferenceGroup group) {
int frontCameraId = CameraHolder.instance().getFrontCameraId();
boolean isFrontCamera = (frontCameraId == mCameraId);
if (cameraHdrPlus != null && (!ApiHelper.HAS_CAMERA_HDR_PLUS ||
!GcamHelper.hasGcamAsHDRMode() || isFrontCamera)) {
!GcamHelper.hasGcamCapture() || isFrontCamera)) {
removePreference(group, cameraHdrPlus.getKey());
}
}
Expand Down
18 changes: 8 additions & 10 deletions src/com/android/camera/ui/ModuleSwitcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ public void initializeDrawables(Context context) {
--numDrawIds;
}

if (!GcamHelper.hasGcamCapture() || GcamHelper.hasGcamAsHDRMode()) {
--numDrawIds;
}
// Always decrement one because of GCam.
--numDrawIds;

int[] drawids = new int[numDrawIds];
int[] moduleids = new int[numDrawIds];
Expand All @@ -119,9 +118,8 @@ public void initializeDrawables(Context context) {
if (i == LIGHTCYCLE_MODULE_INDEX && !PhotoSphereHelper.hasLightCycleCapture(context)) {
continue; // not enabled, so don't add to UI
}
if (i == GCAM_MODULE_INDEX
&& (!GcamHelper.hasGcamCapture() || GcamHelper.hasGcamAsHDRMode())) {
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];
Expand All @@ -136,11 +134,11 @@ public void setIds(int[] moduleids, int[] drawids) {

public void setCurrentIndex(int i) {
mCurrentIndex = i;
if (i == GCAM_MODULE_INDEX && GcamHelper.hasGcamAsHDRMode()) {
setImageResource(R.drawable.ic_switch_camera);
return;
if (i == GCAM_MODULE_INDEX) {
setImageResource(R.drawable.ic_switch_camera);
} else {
setImageResource(mDrawIds[i]);
}
setImageResource(mDrawIds[i]);
}

public void setSwitchListener(ModuleSwitchListener l) {
Expand Down
4 changes: 3 additions & 1 deletion src_pd_gcam/com/android/camera/util/GcamHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.android.camera.util;

import android.content.Context;
import android.content.ContentResolver;

import com.android.camera.CameraModule;

Expand All @@ -33,4 +33,6 @@ public static boolean hasGcamAsHDRMode() {
return false;
}

public static void init(ContentResolver contentResolver) {
}
}

0 comments on commit 048bf4d

Please sign in to comment.