Merge "Native libraries on SD" into gingerbread
diff --git a/api/current.xml b/api/current.xml
index 89d769e..c04134f 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -76023,17 +76023,6 @@
visibility="public"
>
</method>
-<method name="getMeteringMode"
- return="java.lang.String"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</method>
<method name="getMinExposureCompensation"
return="int"
abstract="false"
@@ -76179,17 +76168,6 @@
visibility="public"
>
</method>
-<method name="getSupportedMeteringModes"
- return="java.util.List<java.lang.String>"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</method>
<method name="getSupportedPictureFormats"
return="java.util.List<java.lang.Integer>"
abstract="false"
@@ -76569,19 +76547,6 @@
<parameter name="height" type="int">
</parameter>
</method>
-<method name="setMeteringMode"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="value" type="java.lang.String">
-</parameter>
-</method>
<method name="setPictureFormat"
return="void"
abstract="false"
@@ -77028,39 +76993,6 @@
visibility="public"
>
</field>
-<field name="METERING_MODE_CENTER_WEIGHTED"
- type="java.lang.String"
- transient="false"
- volatile="false"
- value=""center-weighted""
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="METERING_MODE_FRAME_AVERAGE"
- type="java.lang.String"
- transient="false"
- volatile="false"
- value=""frame-average""
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="METERING_MODE_SPOT"
- type="java.lang.String"
- transient="false"
- volatile="false"
- value=""spot""
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="PREVIEW_FPS_MAX_INDEX"
type="int"
transient="false"
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 21cb3a8..3cc89e5 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -993,7 +993,6 @@
private static final String KEY_ZOOM_SUPPORTED = "zoom-supported";
private static final String KEY_SMOOTH_ZOOM_SUPPORTED = "smooth-zoom-supported";
private static final String KEY_FOCUS_DISTANCES = "focus-distances";
- private static final String KEY_METERING_MODE = "metering-mode";
// Parameter key suffix for supported values.
private static final String SUPPORTED_VALUES_SUFFIX = "-values";
@@ -1203,24 +1202,6 @@
public static final int FOCUS_DISTANCE_FAR_INDEX = 2;
/**
- * The camera determines the exposure by giving more weight to the
- * central part of the scene.
- */
- public static final String METERING_MODE_CENTER_WEIGHTED = "center-weighted";
-
- /**
- * The camera determines the exposure by averaging the entire scene,
- * giving no weighting to any particular area.
- */
- public static final String METERING_MODE_FRAME_AVERAGE = "frame-average";
-
- /**
- * The camera determines the exposure by a very small area of the scene,
- * typically the center.
- */
- public static final String METERING_MODE_SPOT = "spot";
-
- /**
* The array index of minimum preview fps for use with {@link
* #getPreviewFpsRange(int[])} or {@link
* #getSupportedPreviewFpsRange()}.
@@ -2263,42 +2244,6 @@
splitFloat(get(KEY_FOCUS_DISTANCES), output);
}
- /**
- * Gets the supported metering modes.
- *
- * @return a list of supported metering modes. null if metering mode
- * setting is not supported.
- * @see #getMeteringMode()
- */
- public List<String> getSupportedMeteringModes() {
- String str = get(KEY_METERING_MODE + SUPPORTED_VALUES_SUFFIX);
- return split(str);
- }
-
- /**
- * Gets the current metering mode, which affects how camera determines
- * exposure.
- *
- * @return current metering mode. If the camera does not support
- * metering setting, this should return null.
- * @see #METERING_MODE_CENTER_WEIGHTED
- * @see #METERING_MODE_FRAME_AVERAGE
- * @see #METERING_MODE_SPOT
- */
- public String getMeteringMode() {
- return get(KEY_METERING_MODE);
- }
-
- /**
- * Sets the metering mode.
- *
- * @param value metering mode.
- * @see #getMeteringMode()
- */
- public void setMeteringMode(String value) {
- set(KEY_METERING_MODE, value);
- }
-
// Splits a comma delimited string to an ArrayList of String.
// Return null if the passing string is null or the size is 0.
private ArrayList<String> split(String str) {
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index a5c7874..7c5371a 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -286,13 +286,6 @@
// Example value: "yuv420sp" or PIXEL_FORMAT_XXX constants. Read only.
static const char KEY_VIDEO_FRAME_FORMAT[];
- // Metering mode. This affects how camera determines exposure.
- // Example value: "spot" or METERING_MODE_XXX constants. Read/write.
- static const char KEY_METERING_MODE[];
- // Supported metering modes.
- // Example value: "center-weighted,frame-average,spot". Read only.
- static const char KEY_SUPPORTED_METERING_MODES[];
-
// Value for KEY_ZOOM_SUPPORTED or KEY_SMOOTH_ZOOM_SUPPORTED.
static const char TRUE[];
@@ -394,16 +387,6 @@
// focus, applications should change the focus mode to other modes.
static const char FOCUS_MODE_CONTINUOUS[];
- // The camera determines the exposure by giving more weight to the
- // central part of the scene.
- static const char METERING_MODE_CENTER_WEIGHTED[];
- // The camera determines the exposure by averaging the entire scene,
- // giving no weighting to any particular area.
- static const char METERING_MODE_FRAME_AVERAGE[];
- // The camera determines the exposure by a very small area of the scene,
- // typically the center.
- static const char METERING_MODE_SPOT[];
-
private:
DefaultKeyedVector<String8,String8> mMap;
};
diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp
index d0ed7df..362d9ee 100644
--- a/libs/camera/CameraParameters.cpp
+++ b/libs/camera/CameraParameters.cpp
@@ -73,8 +73,6 @@
const char CameraParameters::KEY_SMOOTH_ZOOM_SUPPORTED[] = "smooth-zoom-supported";
const char CameraParameters::KEY_FOCUS_DISTANCES[] = "focus-distances";
const char CameraParameters::KEY_VIDEO_FRAME_FORMAT[] = "video-frame-format";
-const char CameraParameters::KEY_METERING_MODE[] = "metering-mode";
-const char CameraParameters::KEY_SUPPORTED_METERING_MODES[] = "metering-mode-values";
const char CameraParameters::TRUE[] = "true";
const char CameraParameters::FOCUS_DISTANCE_INFINITY[] = "Infinity";
@@ -146,11 +144,6 @@
const char CameraParameters::FOCUS_MODE_EDOF[] = "edof";
const char CameraParameters::FOCUS_MODE_CONTINUOUS[] = "continuous";
-// Values for metering mode settings.
-const char CameraParameters::METERING_MODE_CENTER_WEIGHTED[] = "center-weighted";
-const char CameraParameters::METERING_MODE_FRAME_AVERAGE[] = "frame-average";
-const char CameraParameters::METERING_MODE_SPOT[] = "spot";
-
CameraParameters::CameraParameters()
: mMap()
{
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index b5972e7..aba5f52 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -737,8 +737,8 @@
if (!strncasecmp(url, "rtsp://", 7)) {
char value[PROPERTY_VALUE_MAX];
- if (!property_get("media.stagefright.enable-rtsp", value, NULL)
- || (strcmp(value, "1") && strcasecmp(value, "true"))) {
+ if (property_get("media.stagefright.enable-rtsp", value, NULL)
+ && (strcmp(value, "1") && strcasecmp(value, "true"))) {
// For now, we're going to use PV for rtsp-based playback
// by default until we can clear up a few more issues.
return PV_PLAYER;
diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp
index 73862c3..19915f1 100644
--- a/media/libmediaplayerservice/MediaRecorderClient.cpp
+++ b/media/libmediaplayerservice/MediaRecorderClient.cpp
@@ -295,8 +295,8 @@
mPid = pid;
char value[PROPERTY_VALUE_MAX];
- if (property_get("media.stagefright.enable-record", value, NULL)
- && (!strcmp(value, "1") || !strcasecmp(value, "true"))) {
+ if (!property_get("media.stagefright.enable-record", value, NULL)
+ || !strcmp(value, "1") || !strcasecmp(value, "true")) {
mRecorder = new StagefrightRecorder;
} else
#ifndef NO_OPENCORE
diff --git a/services/audioflinger/AudioPolicyManagerBase.cpp b/services/audioflinger/AudioPolicyManagerBase.cpp
index 1d87c0d..425ca31 100644
--- a/services/audioflinger/AudioPolicyManagerBase.cpp
+++ b/services/audioflinger/AudioPolicyManagerBase.cpp
@@ -133,7 +133,7 @@
// request routing change if necessary
uint32_t newDevice = getNewDevice(mHardwareOutput, false);
#ifdef WITH_A2DP
- checkOutputForAllStrategies(newDevice);
+ checkOutputForAllStrategies();
// A2DP outputs must be closed after checkOutputForAllStrategies() is executed
if (state == AudioSystem::DEVICE_STATE_UNAVAILABLE && AudioSystem::isA2dpDevice(device)) {
closeA2dpOutputs();
@@ -274,7 +274,7 @@
// check for device and output changes triggered by new phone state
newDevice = getNewDevice(mHardwareOutput, false);
#ifdef WITH_A2DP
- checkOutputForAllStrategies(newDevice);
+ checkOutputForAllStrategies();
// suspend A2DP output if a SCO device is present.
if (mA2dpOutput != 0 && mScoDeviceAddress != "") {
if (oldState == AudioSystem::MODE_NORMAL) {
@@ -386,13 +386,28 @@
// check for device and output changes triggered by new phone state
uint32_t newDevice = getNewDevice(mHardwareOutput, false);
#ifdef WITH_A2DP
- checkOutputForAllStrategies(newDevice);
+ checkOutputForAllStrategies();
#endif
updateDeviceForStrategy();
setOutputDevice(mHardwareOutput, newDevice);
if (forceVolumeReeval) {
applyStreamVolumes(mHardwareOutput, newDevice);
}
+
+ audio_io_handle_t activeInput = getActiveInput();
+ if (activeInput != 0) {
+ AudioInputDescriptor *inputDesc = mInputs.valueFor(activeInput);
+ newDevice = getDeviceForInputSource(inputDesc->mInputSource);
+ if (newDevice != inputDesc->mDevice) {
+ LOGV("setForceUse() changing device from %x to %x for input %d",
+ inputDesc->mDevice, newDevice, activeInput);
+ inputDesc->mDevice = newDevice;
+ AudioParameter param = AudioParameter();
+ param.addInt(String8(AudioParameter::keyRouting), (int)newDevice);
+ mpClientInterface->setParameters(activeInput, param.toString());
+ }
+ }
+
}
AudioSystem::forced_config AudioPolicyManagerBase::getForceUse(AudioSystem::force_use usage)
@@ -1382,7 +1397,7 @@
}
}
-void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy, uint32_t &newDevice)
+void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy)
{
uint32_t prevDevice = getDeviceForStrategy(strategy);
uint32_t curDevice = getDeviceForStrategy(strategy, false);
@@ -1401,12 +1416,6 @@
LOGV("checkOutputForStrategy() moving strategy %d from a2dp", strategy);
srcOutput = mA2dpOutput;
}
-
- // do not change newDevice if it was already set before this call by a previous call to
- // getNewDevice() or checkOutputForStrategy() for a strategy with higher priority
- if (newDevice == 0 && mOutputs.valueFor(mHardwareOutput)->isUsedByStrategy(strategy)) {
- newDevice = getDeviceForStrategy(strategy, false);
- }
}
if (a2dpIsUsed && !a2dpWasUsed) {
bool dupUsed = a2dpUsedForSonification() && a2dpIsUsed && (AudioSystem::popCount(curDevice) == 2);
@@ -1441,15 +1450,12 @@
}
}
-void AudioPolicyManagerBase::checkOutputForAllStrategies(uint32_t &newDevice)
+void AudioPolicyManagerBase::checkOutputForAllStrategies()
{
- // Check strategies in order of priority so that once newDevice is set
- // for a given strategy it is not modified by subsequent calls to
- // checkOutputForStrategy()
- checkOutputForStrategy(STRATEGY_PHONE, newDevice);
- checkOutputForStrategy(STRATEGY_SONIFICATION, newDevice);
- checkOutputForStrategy(STRATEGY_MEDIA, newDevice);
- checkOutputForStrategy(STRATEGY_DTMF, newDevice);
+ checkOutputForStrategy(STRATEGY_PHONE);
+ checkOutputForStrategy(STRATEGY_SONIFICATION);
+ checkOutputForStrategy(STRATEGY_MEDIA);
+ checkOutputForStrategy(STRATEGY_DTMF);
}
#endif