|
| 1 | +From db49e8681b4a8b952a4c92b4298964359c78ebf8 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Xu Bing <bing.xu@intel.com> |
| 3 | +Date: Mon, 16 Jun 2025 14:58:30 +0800 |
| 4 | +Subject: [PATCH] Fix the error of sound output disorder |
| 5 | + |
| 6 | +System will reuse the ringtone on multi-passenger mode when the ringtone |
| 7 | +has been used, but the sould will be closed when finishing to play, |
| 8 | +the sould will be played on remote and on another zone. so we always |
| 9 | +stop old sound and start to play new sound when adjusting the sound |
| 10 | +volumn. |
| 11 | + |
| 12 | +Tracked-On: OAM-133048 |
| 13 | +Signed-off-by: Xu Bing <bing.xu@intel.com> |
| 14 | +--- |
| 15 | + ...x-the-error-of-sound-output-disorder.patch | 65 +++++++++++++++++++ |
| 16 | + 1 file changed, 65 insertions(+) |
| 17 | + create mode 100644 aosp_diff/aaos_iasw/packages/apps/Car/Settings/0001-Fix-the-error-of-sound-output-disorder.patch |
| 18 | + |
| 19 | +diff --git a/aosp_diff/aaos_iasw/packages/apps/Car/Settings/0001-Fix-the-error-of-sound-output-disorder.patch b/aosp_diff/aaos_iasw/packages/apps/Car/Settings/0001-Fix-the-error-of-sound-output-disorder.patch |
| 20 | +new file mode 100644 |
| 21 | +index 0000000..d95c5d6 |
| 22 | +--- /dev/null |
| 23 | ++++ b/aosp_diff/aaos_iasw/packages/apps/Car/Settings/0001-Fix-the-error-of-sound-output-disorder.patch |
| 24 | +@@ -0,0 +1,65 @@ |
| 25 | ++From 112effcca0369045f950ad8618f2501b0f0b77e7 Mon Sep 17 00:00:00 2001 |
| 26 | ++From: Xu Bing <bing.xu@intel.com> |
| 27 | ++Date: Mon, 16 Jun 2025 14:19:29 +0800 |
| 28 | ++Subject: [PATCH] Fix the error of sound output disorder |
| 29 | ++ |
| 30 | ++System will reuse the ringtone on multi-passenger mode when the ringtone |
| 31 | ++has been used, but the sould will be closed when finishing to play, |
| 32 | ++the sould will be played on remote and on another zone. so we always |
| 33 | ++stop old sound and start to play new sound when adjusting the sound |
| 34 | ++volumn. |
| 35 | ++ |
| 36 | ++Tracked-On: OAM-133048 |
| 37 | ++Signed-off-by: Xu Bing <bing.xu@intel.com> |
| 38 | ++--- |
| 39 | ++ .../sound/VolumeSettingsRingtoneManager.java | 32 +++++++++++-------- |
| 40 | ++ 1 file changed, 18 insertions(+), 14 deletions(-) |
| 41 | ++ |
| 42 | ++diff --git a/src/com/android/car/settings/sound/VolumeSettingsRingtoneManager.java b/src/com/android/car/settings/sound/VolumeSettingsRingtoneManager.java |
| 43 | ++index 8a6d0d0b7..e5bf0f1c6 100644 |
| 44 | ++--- a/src/com/android/car/settings/sound/VolumeSettingsRingtoneManager.java |
| 45 | +++++ b/src/com/android/car/settings/sound/VolumeSettingsRingtoneManager.java |
| 46 | ++@@ -113,22 +113,26 @@ public class VolumeSettingsRingtoneManager { |
| 47 | ++ |
| 48 | ++ /** If we have already seen this ringtone, use it. Otherwise load when requested. */ |
| 49 | ++ private Ringtone lazyLoadRingtone(int group, int usage) { |
| 50 | ++- if (!mGroupToRingtoneMap.containsKey(group)) { |
| 51 | ++- Ringtone ringtone = RingtoneManager.getRingtone(mContext, getRingtoneUri(usage)); |
| 52 | ++- if (ringtone == null) { |
| 53 | ++- return null; |
| 54 | ++- } |
| 55 | ++- |
| 56 | ++- AudioAttributes.Builder builder = new AudioAttributes.Builder(); |
| 57 | ++- if (AudioAttributes.isSystemUsage(usage)) { |
| 58 | ++- builder.setSystemUsage(usage); |
| 59 | ++- } else { |
| 60 | ++- builder.setUsage(usage); |
| 61 | ++- } |
| 62 | +++ //Remove the group and recreate because mLocalPlayer is stopped on multi-zone |
| 63 | +++ if (mGroupToRingtoneMap.containsKey(group)) { |
| 64 | +++ stopCurrentRingtone(); |
| 65 | +++ mGroupToRingtoneMap.remove(group); |
| 66 | +++ } |
| 67 | +++ Ringtone ringtone = RingtoneManager.getRingtone(mContext, getRingtoneUri(usage)); |
| 68 | +++ if (ringtone == null) { |
| 69 | +++ return null; |
| 70 | +++ } |
| 71 | ++ |
| 72 | ++- ringtone.setAudioAttributes(builder.build()); |
| 73 | ++- mGroupToRingtoneMap.put(group, ringtone); |
| 74 | +++ AudioAttributes.Builder builder = new AudioAttributes.Builder(); |
| 75 | +++ if (AudioAttributes.isSystemUsage(usage)) { |
| 76 | +++ builder.setSystemUsage(usage); |
| 77 | +++ } else { |
| 78 | +++ builder.setUsage(usage); |
| 79 | ++ } |
| 80 | +++ |
| 81 | +++ ringtone.setAudioAttributes(builder.build()); |
| 82 | +++ mGroupToRingtoneMap.put(group, ringtone); |
| 83 | +++ |
| 84 | ++ return mGroupToRingtoneMap.get(group); |
| 85 | ++ } |
| 86 | ++ |
| 87 | ++-- |
| 88 | ++2.34.1 |
| 89 | ++ |
| 90 | +-- |
| 91 | +2.34.1 |
| 92 | + |
0 commit comments