* changes: Revert "Revert "audiopolicy: engine: use apm XML config file for volume curves"" Revert "Revert "audiopolicy: moves Stream Volume Curves to Engine""gugelfrei
commit
ea69bfb0f5
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2018 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <system/audio.h>
|
||||
#include <Volume.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/String8.h>
|
||||
#include <vector>
|
||||
|
||||
namespace android {
|
||||
|
||||
class IVolumeCurves
|
||||
{
|
||||
public:
|
||||
virtual ~IVolumeCurves() = default;
|
||||
|
||||
virtual void clearCurrentVolumeIndex() = 0;
|
||||
virtual void addCurrentVolumeIndex(audio_devices_t device, int index) = 0;
|
||||
virtual bool canBeMuted() const = 0;
|
||||
virtual int getVolumeIndexMin() const = 0;
|
||||
virtual int getVolumeIndex(audio_devices_t device) const = 0;
|
||||
virtual int getVolumeIndexMax() const = 0;
|
||||
virtual float volIndexToDb(device_category device, int indexInUi) const = 0;
|
||||
virtual bool hasVolumeIndexForDevice(audio_devices_t device) const = 0;
|
||||
virtual status_t initVolume(int indexMin, int indexMax) = 0;
|
||||
virtual void dump(String8 *dst, int spaces = 0, bool curvePoints = false) const = 0;
|
||||
};
|
||||
|
||||
} // namespace android
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <system/audio.h>
|
||||
#include <Volume.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/String8.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
class IVolumeCurvesCollection
|
||||
{
|
||||
public:
|
||||
virtual ~IVolumeCurvesCollection() = default;
|
||||
|
||||
virtual void clearCurrentVolumeIndex(audio_stream_type_t stream) = 0;
|
||||
virtual void addCurrentVolumeIndex(audio_stream_type_t stream, audio_devices_t device,
|
||||
int index) = 0;
|
||||
virtual bool canBeMuted(audio_stream_type_t stream) = 0;
|
||||
virtual int getVolumeIndexMin(audio_stream_type_t stream) const = 0;
|
||||
virtual int getVolumeIndex(audio_stream_type_t stream, audio_devices_t device) = 0;
|
||||
virtual int getVolumeIndexMax(audio_stream_type_t stream) const = 0;
|
||||
virtual float volIndexToDb(audio_stream_type_t stream, device_category device,
|
||||
int indexInUi) const = 0;
|
||||
virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax) = 0;
|
||||
|
||||
virtual void initializeVolumeCurves(bool /*isSpeakerDrcEnabled*/) {}
|
||||
virtual void switchVolumeCurve(audio_stream_type_t src, audio_stream_type_t dst) = 0;
|
||||
virtual void restoreOriginVolumeCurve(audio_stream_type_t stream)
|
||||
{
|
||||
switchVolumeCurve(stream, stream);
|
||||
}
|
||||
virtual bool hasVolumeIndexForDevice(audio_stream_type_t stream,
|
||||
audio_devices_t device) const = 0;
|
||||
|
||||
virtual void dump(String8 *dst) const = 0;
|
||||
};
|
||||
|
||||
} // namespace android
|
@ -1,239 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IVolumeCurvesCollection.h"
|
||||
#include <policy.h>
|
||||
#include <utils/RefBase.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/SortedVector.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <system/audio.h>
|
||||
#include <cutils/config_utils.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace android {
|
||||
|
||||
struct CurvePoint
|
||||
{
|
||||
CurvePoint() {}
|
||||
CurvePoint(int index, int attenuationInMb) :
|
||||
mIndex(index), mAttenuationInMb(attenuationInMb) {}
|
||||
uint32_t mIndex;
|
||||
int mAttenuationInMb;
|
||||
};
|
||||
|
||||
inline bool operator< (const CurvePoint &lhs, const CurvePoint &rhs)
|
||||
{
|
||||
return lhs.mIndex < rhs.mIndex;
|
||||
}
|
||||
|
||||
// A volume curve for a given use case and device category
|
||||
// It contains of list of points of this curve expressing the attenuation in Millibels for
|
||||
// a given volume index from 0 to 100
|
||||
class VolumeCurve : public RefBase
|
||||
{
|
||||
public:
|
||||
VolumeCurve(device_category device, audio_stream_type_t stream) :
|
||||
mDeviceCategory(device), mStreamType(stream) {}
|
||||
|
||||
device_category getDeviceCategory() const { return mDeviceCategory; }
|
||||
audio_stream_type_t getStreamType() const { return mStreamType; }
|
||||
|
||||
void add(const CurvePoint &point) { mCurvePoints.add(point); }
|
||||
|
||||
float volIndexToDb(int indexInUi, int volIndexMin, int volIndexMax) const;
|
||||
|
||||
void dump(String8 *result) const;
|
||||
|
||||
private:
|
||||
SortedVector<CurvePoint> mCurvePoints;
|
||||
device_category mDeviceCategory;
|
||||
audio_stream_type_t mStreamType;
|
||||
};
|
||||
|
||||
// Volume Curves for a given use case indexed by device category
|
||||
class VolumeCurvesForStream : public KeyedVector<device_category, sp<VolumeCurve> >
|
||||
{
|
||||
public:
|
||||
VolumeCurvesForStream() : mIndexMin(0), mIndexMax(1), mCanBeMuted(true)
|
||||
{
|
||||
mIndexCur.add(AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME, 0);
|
||||
}
|
||||
|
||||
sp<VolumeCurve> getCurvesFor(device_category device) const
|
||||
{
|
||||
if (indexOfKey(device) < 0) {
|
||||
return 0;
|
||||
}
|
||||
return valueFor(device);
|
||||
}
|
||||
|
||||
int getVolumeIndex(audio_devices_t device) const
|
||||
{
|
||||
device = Volume::getDeviceForVolume(device);
|
||||
// there is always a valid entry for AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME
|
||||
if (mIndexCur.indexOfKey(device) < 0) {
|
||||
device = AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME;
|
||||
}
|
||||
return mIndexCur.valueFor(device);
|
||||
}
|
||||
|
||||
bool canBeMuted() const { return mCanBeMuted; }
|
||||
void clearCurrentVolumeIndex() { mIndexCur.clear(); }
|
||||
void addCurrentVolumeIndex(audio_devices_t device, int index) { mIndexCur.add(device, index); }
|
||||
|
||||
void setVolumeIndexMin(int volIndexMin) { mIndexMin = volIndexMin; }
|
||||
int getVolumeIndexMin() const { return mIndexMin; }
|
||||
|
||||
void setVolumeIndexMax(int volIndexMax) { mIndexMax = volIndexMax; }
|
||||
int getVolumeIndexMax() const { return mIndexMax; }
|
||||
|
||||
bool hasVolumeIndexForDevice(audio_devices_t device) const
|
||||
{
|
||||
device = Volume::getDeviceForVolume(device);
|
||||
return mIndexCur.indexOfKey(device) >= 0;
|
||||
}
|
||||
|
||||
const sp<VolumeCurve> getOriginVolumeCurve(device_category deviceCategory) const
|
||||
{
|
||||
ALOG_ASSERT(mOriginVolumeCurves.indexOfKey(deviceCategory) >= 0, "Invalid device category");
|
||||
return mOriginVolumeCurves.valueFor(deviceCategory);
|
||||
}
|
||||
void setVolumeCurve(device_category deviceCategory, const sp<VolumeCurve> &volumeCurve)
|
||||
{
|
||||
ALOG_ASSERT(indexOfKey(deviceCategory) >= 0, "Invalid device category for Volume Curve");
|
||||
replaceValueFor(deviceCategory, volumeCurve);
|
||||
}
|
||||
|
||||
ssize_t add(const sp<VolumeCurve> &volumeCurve)
|
||||
{
|
||||
device_category deviceCategory = volumeCurve->getDeviceCategory();
|
||||
ssize_t index = indexOfKey(deviceCategory);
|
||||
if (index < 0) {
|
||||
// Keep track of original Volume Curves per device category in order to switch curves.
|
||||
mOriginVolumeCurves.add(deviceCategory, volumeCurve);
|
||||
return KeyedVector::add(deviceCategory, volumeCurve);
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
float volIndexToDb(device_category deviceCat, int indexInUi) const
|
||||
{
|
||||
sp<VolumeCurve> vc = getCurvesFor(deviceCat);
|
||||
if (vc != 0) {
|
||||
return vc->volIndexToDb(indexInUi, mIndexMin, mIndexMax);
|
||||
} else {
|
||||
ALOGE("Invalid device category %d for Volume Curve", deviceCat);
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void dump(String8 *dst, int spaces, bool curvePoints = false) const;
|
||||
|
||||
private:
|
||||
KeyedVector<device_category, sp<VolumeCurve> > mOriginVolumeCurves;
|
||||
KeyedVector<audio_devices_t, int> mIndexCur; /**< current volume index per device. */
|
||||
int mIndexMin; /**< min volume index. */
|
||||
int mIndexMax; /**< max volume index. */
|
||||
bool mCanBeMuted; /**< true is the stream can be muted. */
|
||||
};
|
||||
|
||||
// Collection of Volume Curves indexed by use case
|
||||
class VolumeCurvesCollection : public KeyedVector<audio_stream_type_t, VolumeCurvesForStream>,
|
||||
public IVolumeCurvesCollection
|
||||
{
|
||||
public:
|
||||
VolumeCurvesCollection()
|
||||
{
|
||||
// Create an empty collection of curves
|
||||
for (ssize_t i = 0 ; i < AUDIO_STREAM_CNT; i++) {
|
||||
audio_stream_type_t stream = static_cast<audio_stream_type_t>(i);
|
||||
KeyedVector::add(stream, VolumeCurvesForStream());
|
||||
}
|
||||
}
|
||||
|
||||
// Once XML has been parsed, must be call first to sanity check table and initialize indexes
|
||||
virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax)
|
||||
{
|
||||
editValueAt(stream).setVolumeIndexMin(indexMin);
|
||||
editValueAt(stream).setVolumeIndexMax(indexMax);
|
||||
return NO_ERROR;
|
||||
}
|
||||
virtual void clearCurrentVolumeIndex(audio_stream_type_t stream)
|
||||
{
|
||||
editCurvesFor(stream).clearCurrentVolumeIndex();
|
||||
}
|
||||
virtual void addCurrentVolumeIndex(audio_stream_type_t stream, audio_devices_t device, int index)
|
||||
{
|
||||
editCurvesFor(stream).addCurrentVolumeIndex(device, index);
|
||||
}
|
||||
virtual bool canBeMuted(audio_stream_type_t stream) { return getCurvesFor(stream).canBeMuted(); }
|
||||
|
||||
virtual int getVolumeIndexMin(audio_stream_type_t stream) const
|
||||
{
|
||||
return getCurvesFor(stream).getVolumeIndexMin();
|
||||
}
|
||||
virtual int getVolumeIndexMax(audio_stream_type_t stream) const
|
||||
{
|
||||
return getCurvesFor(stream).getVolumeIndexMax();
|
||||
}
|
||||
virtual int getVolumeIndex(audio_stream_type_t stream, audio_devices_t device)
|
||||
{
|
||||
return getCurvesFor(stream).getVolumeIndex(device);
|
||||
}
|
||||
virtual void switchVolumeCurve(audio_stream_type_t streamSrc, audio_stream_type_t streamDst)
|
||||
{
|
||||
const VolumeCurvesForStream &sourceCurves = getCurvesFor(streamSrc);
|
||||
VolumeCurvesForStream &dstCurves = editCurvesFor(streamDst);
|
||||
ALOG_ASSERT(sourceCurves.size() == dstCurves.size(), "device category not aligned");
|
||||
for (size_t index = 0; index < sourceCurves.size(); index++) {
|
||||
device_category cat = sourceCurves.keyAt(index);
|
||||
dstCurves.setVolumeCurve(cat, sourceCurves.getOriginVolumeCurve(cat));
|
||||
}
|
||||
}
|
||||
virtual float volIndexToDb(audio_stream_type_t stream, device_category cat, int indexInUi) const
|
||||
{
|
||||
return getCurvesFor(stream).volIndexToDb(cat, indexInUi);
|
||||
}
|
||||
virtual bool hasVolumeIndexForDevice(audio_stream_type_t stream,
|
||||
audio_devices_t device) const
|
||||
{
|
||||
return getCurvesFor(stream).hasVolumeIndexForDevice(device);
|
||||
}
|
||||
|
||||
void dump(String8 *dst) const override;
|
||||
|
||||
ssize_t add(const sp<VolumeCurve> &volumeCurve)
|
||||
{
|
||||
audio_stream_type_t streamType = volumeCurve->getStreamType();
|
||||
return editCurvesFor(streamType).add(volumeCurve);
|
||||
}
|
||||
VolumeCurvesForStream &editCurvesFor(audio_stream_type_t stream)
|
||||
{
|
||||
ALOG_ASSERT(indexOfKey(stream) >= 0, "Invalid stream type for Volume Curve");
|
||||
return editValueAt(stream);
|
||||
}
|
||||
const VolumeCurvesForStream &getCurvesFor(audio_stream_type_t stream) const
|
||||
{
|
||||
ALOG_ASSERT(indexOfKey(stream) >= 0, "Invalid stream type for Volume Curve");
|
||||
return valueFor(stream);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace android
|
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (C) 2018 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <VolumeCurve.h>
|
||||
#include <map>
|
||||
|
||||
namespace android {
|
||||
|
||||
class StreamVolumeCurves
|
||||
{
|
||||
public:
|
||||
StreamVolumeCurves() = default;
|
||||
|
||||
/**
|
||||
* @brief switchVolumeCurve control API for Engine, allows to switch the volume curves
|
||||
* from one stream type to another.
|
||||
* @param src source stream type
|
||||
* @param dst destination stream type
|
||||
*/
|
||||
status_t switchVolumeCurve(audio_stream_type_t streamSrc, audio_stream_type_t streamDst)
|
||||
{
|
||||
if (!hasCurvesFor(streamSrc) || !hasCurvesFor(streamDst)) {
|
||||
ALOGE("%s: No curves defined for streams %d %d", __FUNCTION__, streamSrc, streamDst);
|
||||
return NO_INIT;
|
||||
}
|
||||
const VolumeCurves &sourceCurves = getCurvesFor(streamSrc);
|
||||
VolumeCurves &dstCurves = editCurvesFor(streamDst);
|
||||
return dstCurves.switchCurvesFrom(sourceCurves);
|
||||
}
|
||||
void dump(String8 *dst, int spaces = 0) const;
|
||||
|
||||
void add(const VolumeCurves &curves, audio_stream_type_t streamType)
|
||||
{
|
||||
mCurves.emplace(streamType, curves);
|
||||
}
|
||||
|
||||
bool hasCurvesFor(audio_stream_type_t stream)
|
||||
{
|
||||
return mCurves.find(stream) != end(mCurves);
|
||||
}
|
||||
|
||||
VolumeCurves &editCurvesFor(audio_stream_type_t stream)
|
||||
{
|
||||
ALOG_ASSERT(mCurves.find(stream) != end(mCurves), "Invalid stream type for Volume Curve");
|
||||
return mCurves[stream];
|
||||
}
|
||||
const VolumeCurves &getCurvesFor(audio_stream_type_t stream) const
|
||||
{
|
||||
ALOG_ASSERT(mCurves.find(stream) != end(mCurves), "Invalid stream type for Volume Curve");
|
||||
return mCurves.at(stream);
|
||||
}
|
||||
/**
|
||||
* @brief getVolumeCurvesForStream
|
||||
* @param stream type for which the volume curves interface is requested
|
||||
* @return the VolumeCurves for a given stream type.
|
||||
*/
|
||||
VolumeCurves &getVolumeCurvesForStream(audio_stream_type_t stream)
|
||||
{
|
||||
ALOG_ASSERT(mCurves.find(stream) != end(mCurves), "Invalid stream type for Volume Curve");
|
||||
return mCurves[stream];
|
||||
}
|
||||
/**
|
||||
* @brief restoreOriginVolumeCurve helper control API for engine to restore the original volume
|
||||
* curves for a given stream type
|
||||
* @param stream for which the volume curves will be restored.
|
||||
*/
|
||||
status_t restoreOriginVolumeCurve(audio_stream_type_t stream)
|
||||
{
|
||||
if (!hasCurvesFor(stream)) {
|
||||
ALOGE("%s: No curves defined for streams", __FUNCTION__);
|
||||
return NO_INIT;
|
||||
}
|
||||
return switchVolumeCurve(stream, stream);
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<audio_stream_type_t, VolumeCurves> mCurves;
|
||||
};
|
||||
|
||||
} // namespace android
|
@ -0,0 +1,192 @@
|
||||
/*
|
||||
* Copyright (C) 2015 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IVolumeCurves.h"
|
||||
#include <policy.h>
|
||||
#include <utils/RefBase.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/SortedVector.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <system/audio.h>
|
||||
#include <cutils/config_utils.h>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <utility>
|
||||
|
||||
namespace android {
|
||||
|
||||
struct CurvePoint
|
||||
{
|
||||
CurvePoint() {}
|
||||
CurvePoint(int index, int attenuationInMb) :
|
||||
mIndex(index), mAttenuationInMb(attenuationInMb) {}
|
||||
uint32_t mIndex;
|
||||
int mAttenuationInMb;
|
||||
};
|
||||
|
||||
inline bool operator< (const CurvePoint &lhs, const CurvePoint &rhs)
|
||||
{
|
||||
return lhs.mIndex < rhs.mIndex;
|
||||
}
|
||||
|
||||
// A volume curve for a given use case and device category
|
||||
// It contains of list of points of this curve expressing the attenuation in Millibels for
|
||||
// a given volume index from 0 to 100
|
||||
class VolumeCurve : public RefBase
|
||||
{
|
||||
public:
|
||||
VolumeCurve(device_category device) : mDeviceCategory(device) {}
|
||||
|
||||
void add(const CurvePoint &point) { mCurvePoints.add(point); }
|
||||
|
||||
float volIndexToDb(int indexInUi, int volIndexMin, int volIndexMax) const;
|
||||
|
||||
void dump(String8 *dst, int spaces = 0, bool curvePoints = false) const;
|
||||
|
||||
device_category getDeviceCategory() const { return mDeviceCategory; }
|
||||
|
||||
private:
|
||||
const device_category mDeviceCategory;
|
||||
SortedVector<CurvePoint> mCurvePoints;
|
||||
};
|
||||
|
||||
// Volume Curves for a given use case indexed by device category
|
||||
class VolumeCurves : public KeyedVector<device_category, sp<VolumeCurve> >,
|
||||
public IVolumeCurves
|
||||
{
|
||||
public:
|
||||
VolumeCurves(int indexMin = 0, int indexMax = 100) :
|
||||
mIndexMin(indexMin), mIndexMax(indexMax), mStream(AUDIO_STREAM_DEFAULT)
|
||||
{
|
||||
addCurrentVolumeIndex(AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME, 0);
|
||||
}
|
||||
VolumeCurves(audio_stream_type_t stream, int indexMin, int indexMax) :
|
||||
mIndexMin(indexMin), mIndexMax(indexMax), mStream(stream)
|
||||
{
|
||||
addCurrentVolumeIndex(AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME, 0);
|
||||
}
|
||||
|
||||
// Once XML has been parsed, must be call first to sanity check table and initialize indexes
|
||||
virtual status_t initVolume(int indexMin, int indexMax)
|
||||
{
|
||||
mIndexMin = indexMin;
|
||||
mIndexMax = indexMax;
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
sp<VolumeCurve> getCurvesFor(device_category device) const
|
||||
{
|
||||
if (indexOfKey(device) < 0) {
|
||||
return 0;
|
||||
}
|
||||
return valueFor(device);
|
||||
}
|
||||
|
||||
virtual int getVolumeIndex(audio_devices_t device) const
|
||||
{
|
||||
device = Volume::getDeviceForVolume(device);
|
||||
// there is always a valid entry for AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME
|
||||
if (mIndexCur.find(device) == end(mIndexCur)) {
|
||||
device = AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME;
|
||||
}
|
||||
return mIndexCur.at(device);
|
||||
}
|
||||
|
||||
virtual bool canBeMuted() const { return mCanBeMuted; }
|
||||
virtual void clearCurrentVolumeIndex() { mIndexCur.clear(); }
|
||||
void addCurrentVolumeIndex(audio_devices_t device, int index) override
|
||||
{
|
||||
mIndexCur[device] = index;
|
||||
}
|
||||
|
||||
int getVolumeIndexMin() const { return mIndexMin; }
|
||||
|
||||
int getVolumeIndexMax() const { return mIndexMax; }
|
||||
|
||||
bool hasVolumeIndexForDevice(audio_devices_t device) const
|
||||
{
|
||||
device = Volume::getDeviceForVolume(device);
|
||||
return mIndexCur.find(device) != end(mIndexCur);
|
||||
}
|
||||
|
||||
status_t switchCurvesFrom(const VolumeCurves &referenceCurves)
|
||||
{
|
||||
if (size() != referenceCurves.size()) {
|
||||
ALOGE("%s! device category not aligned, cannot switch", __FUNCTION__);
|
||||
return BAD_TYPE;
|
||||
}
|
||||
for (size_t index = 0; index < size(); index++) {
|
||||
device_category cat = keyAt(index);
|
||||
setVolumeCurve(cat, referenceCurves.getOriginVolumeCurve(cat));
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
status_t restoreOriginVolumeCurve()
|
||||
{
|
||||
return switchCurvesFrom(*this);
|
||||
}
|
||||
|
||||
const sp<VolumeCurve> getOriginVolumeCurve(device_category deviceCategory) const
|
||||
{
|
||||
ALOG_ASSERT(mOriginVolumeCurves.indexOfKey(deviceCategory) >= 0, "Invalid device category");
|
||||
return mOriginVolumeCurves.valueFor(deviceCategory);
|
||||
}
|
||||
void setVolumeCurve(device_category deviceCategory, const sp<VolumeCurve> &volumeCurve)
|
||||
{
|
||||
ALOG_ASSERT(indexOfKey(deviceCategory) >= 0, "Invalid device category for Volume Curve");
|
||||
replaceValueFor(deviceCategory, volumeCurve);
|
||||
}
|
||||
|
||||
ssize_t add(const sp<VolumeCurve> &volumeCurve)
|
||||
{
|
||||
device_category deviceCategory = volumeCurve->getDeviceCategory();
|
||||
ssize_t index = indexOfKey(deviceCategory);
|
||||
if (index < 0) {
|
||||
// Keep track of original Volume Curves per device category in order to switch curves.
|
||||
mOriginVolumeCurves.add(deviceCategory, volumeCurve);
|
||||
return KeyedVector::add(deviceCategory, volumeCurve);
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
virtual float volIndexToDb(device_category deviceCat, int indexInUi) const
|
||||
{
|
||||
sp<VolumeCurve> vc = getCurvesFor(deviceCat);
|
||||
if (vc != 0) {
|
||||
return vc->volIndexToDb(indexInUi, mIndexMin, mIndexMax);
|
||||
} else {
|
||||
ALOGE("Invalid device category %d for Volume Curve", deviceCat);
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
audio_stream_type_t getStreamType() const { return mStream; }
|
||||
|
||||
void dump(String8 *dst, int spaces = 0, bool curvePoints = false) const override;
|
||||
|
||||
private:
|
||||
KeyedVector<device_category, sp<VolumeCurve> > mOriginVolumeCurves;
|
||||
std::map<audio_devices_t, int> mIndexCur; /**< current volume index per device. */
|
||||
int mIndexMin; /**< min volume index. */
|
||||
int mIndexMax; /**< max volume index. */
|
||||
const bool mCanBeMuted = true; /**< true is the stream can be muted. */
|
||||
|
||||
const audio_stream_type_t mStream; /**< Keep it for legacy. */
|
||||
};
|
||||
|
||||
} // namespace android
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2018 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "APM::Engine::StreamVolumeCurves"
|
||||
//#define LOG_NDEBUG 0
|
||||
|
||||
#include "StreamVolumeCurves.h"
|
||||
#include <TypeConverter.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
void StreamVolumeCurves::dump(String8 *dst, int spaces) const
|
||||
{
|
||||
if (mCurves.empty()) {
|
||||
return;
|
||||
}
|
||||
dst->appendFormat("\n%*sStreams dump:\n", spaces, "");
|
||||
dst->appendFormat(
|
||||
"%*sStream Can be muted Index Min Index Max Index Cur [device : index]...\n", spaces + 2, "");
|
||||
for (const auto &streamCurve : mCurves) {
|
||||
streamCurve.second.dump(dst, spaces + 2, false);
|
||||
}
|
||||
dst->appendFormat("\n%*sVolume Curves for Use Cases (aka Stream types) dump:\n", spaces, "");
|
||||
for (const auto &streamCurve : mCurves) {
|
||||
std::string streamTypeLiteral;
|
||||
StreamTypeConverter::toString(streamCurve.first, streamTypeLiteral);
|
||||
dst->appendFormat(
|
||||
" %s (%02d): Curve points for device category (index, attenuation in millibel)\n",
|
||||
streamTypeLiteral.c_str(), streamCurve.first);
|
||||
streamCurve.second.dump(dst, spaces + 2, true);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace android
|
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (C) 2015 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.
|
||||
-->
|
||||
<!-- Default Volume Tables included by Audio Policy Configuration file -->
|
||||
<!-- Full Default Volume table for all device category -->
|
||||
<volumes>
|
||||
<reference name="FULL_SCALE_VOLUME_CURVE">
|
||||
<!-- Full Scale reference Volume Curve -->
|
||||
<point>0,0</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="SILENT_VOLUME_CURVE">
|
||||
<point>0,-9600</point>
|
||||
<point>100,-9600</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_SYSTEM_VOLUME_CURVE">
|
||||
<!-- Default System reference Volume Curve -->
|
||||
<point>1,-2400</point>
|
||||
<point>33,-1800</point>
|
||||
<point>66,-1200</point>
|
||||
<point>100,-600</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_MEDIA_VOLUME_CURVE">
|
||||
<!-- Default Media reference Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE">
|
||||
<!--Default Volume Curve -->
|
||||
<point>1,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE">
|
||||
<!-- Default is Speaker Media Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_SPEAKER_SYSTEM_VOLUME_CURVE">
|
||||
<!-- Default is Speaker System Volume Curve -->
|
||||
<point>1,-4680</point>
|
||||
<point>42,-2070</point>
|
||||
<point>85,-540</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE">
|
||||
<!--Default Volume Curve -->
|
||||
<point>1,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE">
|
||||
<!-- Default is Ext Media System Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-2100</point>
|
||||
<point>100,-1000</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_HEARING_AID_VOLUME_CURVE">
|
||||
<!-- Default Hearing Aid Volume Curve -->
|
||||
<point>1,-12700</point>
|
||||
<point>20,-8000</point>
|
||||
<point>60,-4000</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<!-- **************************************************************** -->
|
||||
<!-- Non-mutable default volume curves: -->
|
||||
<!-- * first point is always for index 0 -->
|
||||
<!-- * attenuation is small enough that stream can still be heard -->
|
||||
<reference name="DEFAULT_NON_MUTABLE_VOLUME_CURVE">
|
||||
<!-- Default non-mutable reference Volume Curve -->
|
||||
<!-- based on DEFAULT_MEDIA_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE">
|
||||
<!--Default non-mutable Volume Curve for headset -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE -->
|
||||
<point>0,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Speaker Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE">
|
||||
<!--Default non-mutable Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE -->
|
||||
<point>0,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Ext Media System Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-2100</point>
|
||||
<point>100,-1000</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Hearing Aid Volume Curve -->
|
||||
<!-- based on DEFAULT_HEARING_AID_VOLUME_CURVE -->
|
||||
<point>0,-12700</point>
|
||||
<point>20,-8000</point>
|
||||
<point>60,-4000</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
</volumes>
|
@ -0,0 +1,231 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (C) 2015 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.
|
||||
-->
|
||||
<!-- Volume section defines a volume curve for a given use case and device category.
|
||||
It contains a list of points of this curve expressing the attenuation in Millibels for a given
|
||||
volume index from 0 to 100.
|
||||
<volume stream=”AUDIO_STREAM_MUSIC” deviceCategory=””>
|
||||
<point>0,-9600</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
-->
|
||||
|
||||
<volumeGroups>
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_VOICE_CALL</stream>
|
||||
<indexMin>1</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>0,-2400</point>
|
||||
<point>33,-1600</point>
|
||||
<point>66,-800</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE">
|
||||
<point>0,-2700</point>
|
||||
<point>33,-1800</point>
|
||||
<point>66,-900</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_SYSTEM</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-5100</point>
|
||||
<point>57,-2800</point>
|
||||
<point>71,-2500</point>
|
||||
<point>85,-2300</point>
|
||||
<point>100,-2100</point>
|
||||
</volume>
|
||||
<!--volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/-->
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_RING</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_MUSIC</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>25</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_ALARM</stream>
|
||||
<indexMin>1</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_NOTIFICATION</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_BLUETOOTH_SCO</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>0,-2400</point>
|
||||
<point>33,-1600</point>
|
||||
<point>66,-800</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_ENFORCED_AUDIBLE</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-3400</point>
|
||||
<point>71,-2400</point>
|
||||
<point>100,-2000</point>
|
||||
</volume>
|
||||
<!--volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/-->
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_DTMF</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-4000</point>
|
||||
<point>71,-2400</point>
|
||||
<point>100,-1400</point>
|
||||
</volume>
|
||||
<!--volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/-->
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_TTS</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="SILENT_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_ACCESSIBILITY</stream>
|
||||
<indexMin>1</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_REROUTING</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>1</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_PATCH</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>1</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
</volumeGroups>
|
||||
|
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (C) 2015 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.
|
||||
-->
|
||||
<!-- Default Volume Tables included by Audio Policy Configuration file -->
|
||||
<!-- Full Default Volume table for all device category -->
|
||||
<volumes>
|
||||
<reference name="FULL_SCALE_VOLUME_CURVE">
|
||||
<!-- Full Scale reference Volume Curve -->
|
||||
<point>0,0</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="SILENT_VOLUME_CURVE">
|
||||
<point>0,-9600</point>
|
||||
<point>100,-9600</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_SYSTEM_VOLUME_CURVE">
|
||||
<!-- Default System reference Volume Curve -->
|
||||
<point>1,-2400</point>
|
||||
<point>33,-1800</point>
|
||||
<point>66,-1200</point>
|
||||
<point>100,-600</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_MEDIA_VOLUME_CURVE">
|
||||
<!-- Default Media reference Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE">
|
||||
<!--Default Volume Curve -->
|
||||
<point>1,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE">
|
||||
<!-- Default is Speaker Media Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_SPEAKER_SYSTEM_VOLUME_CURVE">
|
||||
<!-- Default is Speaker System Volume Curve -->
|
||||
<point>1,-4680</point>
|
||||
<point>42,-2070</point>
|
||||
<point>85,-540</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE">
|
||||
<!--Default Volume Curve -->
|
||||
<point>1,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE">
|
||||
<!-- Default is Ext Media System Volume Curve -->
|
||||
<point>1,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-2100</point>
|
||||
<point>100,-1000</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_HEARING_AID_VOLUME_CURVE">
|
||||
<!-- Default Hearing Aid Volume Curve -->
|
||||
<point>1,-12700</point>
|
||||
<point>20,-8000</point>
|
||||
<point>60,-4000</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<!-- **************************************************************** -->
|
||||
<!-- Non-mutable default volume curves: -->
|
||||
<!-- * first point is always for index 0 -->
|
||||
<!-- * attenuation is small enough that stream can still be heard -->
|
||||
<reference name="DEFAULT_NON_MUTABLE_VOLUME_CURVE">
|
||||
<!-- Default non-mutable reference Volume Curve -->
|
||||
<!-- based on DEFAULT_MEDIA_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE">
|
||||
<!--Default non-mutable Volume Curve for headset -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE -->
|
||||
<point>0,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Speaker Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE">
|
||||
<!--Default non-mutable Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE -->
|
||||
<point>0,-4950</point>
|
||||
<point>33,-3350</point>
|
||||
<point>66,-1700</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Ext Media System Volume Curve -->
|
||||
<!-- based on DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE -->
|
||||
<point>0,-5800</point>
|
||||
<point>20,-4000</point>
|
||||
<point>60,-2100</point>
|
||||
<point>100,-1000</point>
|
||||
</reference>
|
||||
<reference name="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE">
|
||||
<!-- Default non-mutable Hearing Aid Volume Curve -->
|
||||
<!-- based on DEFAULT_HEARING_AID_VOLUME_CURVE -->
|
||||
<point>0,-12700</point>
|
||||
<point>20,-8000</point>
|
||||
<point>60,-4000</point>
|
||||
<point>100,0</point>
|
||||
</reference>
|
||||
</volumes>
|
@ -0,0 +1,231 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (C) 2015 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.
|
||||
-->
|
||||
<!-- Volume section defines a volume curve for a given use case and device category.
|
||||
It contains a list of points of this curve expressing the attenuation in Millibels for a given
|
||||
volume index from 0 to 100.
|
||||
<volume stream=”AUDIO_STREAM_MUSIC” deviceCategory=””>
|
||||
<point>0,-9600</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
-->
|
||||
|
||||
<volumeGroups>
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_VOICE_CALL</stream>
|
||||
<indexMin>1</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>0,-2400</point>
|
||||
<point>33,-1600</point>
|
||||
<point>66,-800</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE">
|
||||
<point>0,-2700</point>
|
||||
<point>33,-1800</point>
|
||||
<point>66,-900</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_SYSTEM</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-5100</point>
|
||||
<point>57,-2800</point>
|
||||
<point>71,-2500</point>
|
||||
<point>85,-2300</point>
|
||||
<point>100,-2100</point>
|
||||
</volume>
|
||||
<!--volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/-->
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_RING</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_MUSIC</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>25</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_ALARM</stream>
|
||||
<indexMin>1</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_NOTIFICATION</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_BLUETOOTH_SCO</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>0,-2400</point>
|
||||
<point>33,-1600</point>
|
||||
<point>66,-800</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE">
|
||||
<point>0,-4200</point>
|
||||
<point>33,-2800</point>
|
||||
<point>66,-1400</point>
|
||||
<point>100,0</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_ENFORCED_AUDIBLE</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>7</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-3400</point>
|
||||
<point>71,-2400</point>
|
||||
<point>100,-2000</point>
|
||||
</volume>
|
||||
<!--volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/-->
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_DTMF</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET">
|
||||
<point>1,-3000</point>
|
||||
<point>33,-2600</point>
|
||||
<point>66,-2200</point>
|
||||
<point>100,-1800</point>
|
||||
</volume>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER">
|
||||
<point>1,-4000</point>
|
||||
<point>71,-2400</point>
|
||||
<point>100,-1400</point>
|
||||
</volume>
|
||||
<!--volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/-->
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_TTS</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="SILENT_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="SILENT_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_ACCESSIBILITY</stream>
|
||||
<indexMin>1</indexMin>
|
||||
<indexMax>15</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_REROUTING</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>1</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
|
||||
<volumeGroup>
|
||||
<stream>AUDIO_STREAM_PATCH</stream>
|
||||
<indexMin>0</indexMin>
|
||||
<indexMax>1</indexMax>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEADSET" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_SPEAKER" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
<volume deviceCategory="DEVICE_CATEGORY_HEARING_AID" ref="FULL_SCALE_VOLUME_CURVE"/>
|
||||
</volumeGroup>
|
||||
</volumeGroups>
|
||||
|
Loading…
Reference in new issue