summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/android/camera/CameraHolder.java24
-rw-r--r--src/com/android/camera/app/CameraApp.java8
2 files changed, 32 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraHolder.java b/src/com/android/camera/CameraHolder.java
index d5167af5b..6d5ef1ab8 100755
--- a/src/com/android/camera/CameraHolder.java
+++ b/src/com/android/camera/CameraHolder.java
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 The Android Open Source Project
+ * 2015 The CyanogenMod Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,8 +31,11 @@ import android.os.Looper;
import android.os.Message;
import android.util.Log;
+import com.android.camera.app.CameraApp;
import com.android.camera.CameraManager.CameraProxy;
+import org.codeaurora.snapcam.R;
+
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -233,6 +237,9 @@ public class CameraHolder {
public synchronized CameraProxy open(
Handler handler, int cameraId,
CameraManager.CameraOpenErrorCallback cb) {
+
+ Context context = CameraApp.getContext();
+
if (DEBUG_OPEN_RELEASE) {
collectState(cameraId, mCameraDevice);
if (mCameraOpened) {
@@ -265,6 +272,23 @@ public class CameraHolder {
}
mCameraId = cameraId;
mParameters = mCameraDevice.getCamera().getParameters();
+
+ // Manufacturer specific key values
+ String manufacturerKeyValues =
+ context.getResources().getString(R.string.manufacturer_key_values);
+ if (manufacturerKeyValues != null && !manufacturerKeyValues.isEmpty()) {
+ String[] keyValuesArray = manufacturerKeyValues.split(";");
+ for (String kvPair : keyValuesArray) {
+ String[] manufacturerParamPair = kvPair.split("=");
+ if (!manufacturerParamPair[0].isEmpty() &&
+ !manufacturerParamPair[1].isEmpty()) {
+ Log.d(TAG, "Set manufacturer specific parameter " +
+ manufacturerParamPair[0] + "=" + manufacturerParamPair[1]);
+ mParameters.set(manufacturerParamPair[0], manufacturerParamPair[1]);
+ }
+ }
+ mCameraDevice.setParameters(mParameters);
+ }
} else {
if (!mCameraDevice.reconnect(handler, cb)) {
Log.e(TAG, "fail to reconnect Camera:" + mCameraId + ", aborting.");
diff --git a/src/com/android/camera/app/CameraApp.java b/src/com/android/camera/app/CameraApp.java
index 837e22cd1..dc5825cb1 100644
--- a/src/com/android/camera/app/CameraApp.java
+++ b/src/com/android/camera/app/CameraApp.java
@@ -18,6 +18,7 @@ package com.android.camera.app;
import android.app.ActivityManager;
import android.app.Application;
+import android.content.Context;
import com.android.camera.SDCard;
import com.android.camera.util.CameraUtil;
@@ -28,9 +29,12 @@ public class CameraApp extends Application {
private static long mMaxSystemMemory;
public static boolean mIsLowMemoryDevice = false;
private static final long LOW_MEMORY_DEVICE_THRESHOLD = 2L*1024*1024*1024;
+ private static Application mApp = null;
+
@Override
public void onCreate() {
super.onCreate();
+ mApp = this;
ActivityManager actManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
@@ -43,5 +47,9 @@ public class CameraApp extends Application {
CameraUtil.initialize(this);
SDCard.initialize(this);
}
+
+ public static Context getContext() {
+ return mApp.getApplicationContext();
+ }
}