41 lines
1.7 KiB
Diff
41 lines
1.7 KiB
Diff
From c3bd3dc63c34de7c688b24999769f7eb504784a3 Mon Sep 17 00:00:00 2001
|
|
From: Pierre-Hugues Husson <phh@phh.me>
|
|
Date: Sun, 28 Mar 2021 14:48:49 +0200
|
|
Subject: [PATCH 37/38] Use a fake volume policy when none has been found
|
|
|
|
This is useful, because on Samsung devices, the "real"
|
|
(=non-gsi-cheating) audio policy doesn't have any volume policy.
|
|
|
|
This requires actually adding the fake audio policy xml file (done in
|
|
device/phh/treble)
|
|
---
|
|
services/audiopolicy/engine/config/src/EngineConfig.cpp | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/services/audiopolicy/engine/config/src/EngineConfig.cpp b/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
|
index 4842cb282f..e8d6917754 100644
|
|
--- a/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
|
+++ b/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
|
@@ -717,11 +717,17 @@ android::status_t parseLegacyVolumes(VolumeGroups &volumeGroups) {
|
|
snprintf(audioPolicyXmlConfigFile, sizeof(audioPolicyXmlConfigFile),
|
|
"%s/%s", path.c_str(), fileName);
|
|
ret = parseLegacyVolumeFile(audioPolicyXmlConfigFile, volumeGroups);
|
|
- if (ret == NO_ERROR) {
|
|
+ ALOGE("Parsing volume for %s gave %zu", audioPolicyXmlConfigFile, volumeGroups.size());
|
|
+ if (ret == NO_ERROR && volumeGroups.size() > 0) {
|
|
return ret;
|
|
}
|
|
}
|
|
}
|
|
+ ret = parseLegacyVolumeFile("/system/etc/fake_audio_policy_volume.xml", volumeGroups);
|
|
+ ALOGE("Parsing volume for /system/etc/fake_audio_policy_volume.xml gave %zu", volumeGroups.size());
|
|
+ if (ret == NO_ERROR && volumeGroups.size() == 0) {
|
|
+ return ret;
|
|
+ }
|
|
return BAD_VALUE;
|
|
}
|
|
|
|
--
|
|
2.25.1
|
|
|