From 220a5ee0bb6db76c3ad3992f65fe12cec1c39a07 Mon Sep 17 00:00:00 2001 From: Simon1511 Date: Fri, 9 Jun 2023 15:17:42 +0200 Subject: [PATCH] sm7125-common: audio: match policy with stock This reverts commit 9968055bb8d1459e982a3903c25f6c3ebf004ee6. Change-Id: Ieb31dd68364e6fee1167bfe777752c6b492e2a5e --- audio/SamsungAudio/Android.bp | 23 -- audio/SamsungAudio/AndroidManifest.xml | 28 --- .../hardware/media/BootCompletedReceiver.java | 34 --- .../hardware/media/SamsungAudioService.java | 89 ------- .../src/android/hardware/media/Utils.java | 40 --- audio/configs/audio_policy_configuration.xml | 118 ++++++--- audio/impl/Android.bp | 7 - audio/impl/ParametersUtil.cpp | 227 ------------------ common.mk | 3 +- sepolicy/public/property.te | 3 - sepolicy/vendor/hal_audio_default.te | 4 +- sepolicy/vendor/property_contexts | 1 - sepolicy/vendor/system_app.te | 5 +- 13 files changed, 89 insertions(+), 493 deletions(-) delete mode 100644 audio/SamsungAudio/Android.bp delete mode 100644 audio/SamsungAudio/AndroidManifest.xml delete mode 100644 audio/SamsungAudio/src/android/hardware/media/BootCompletedReceiver.java delete mode 100644 audio/SamsungAudio/src/android/hardware/media/SamsungAudioService.java delete mode 100644 audio/SamsungAudio/src/android/hardware/media/Utils.java diff --git a/audio/SamsungAudio/Android.bp b/audio/SamsungAudio/Android.bp deleted file mode 100644 index 449e01e..0000000 --- a/audio/SamsungAudio/Android.bp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (C) 2023 The LineageOS 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. -// - -android_app { - name: "SamsungAudio", - srcs: ["src/**/*.java"], - certificate: "platform", - platform_apis: true, - system_ext_specific: true, -} diff --git a/audio/SamsungAudio/AndroidManifest.xml b/audio/SamsungAudio/AndroidManifest.xml deleted file mode 100644 index 1e1d3d3..0000000 --- a/audio/SamsungAudio/AndroidManifest.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/audio/SamsungAudio/src/android/hardware/media/BootCompletedReceiver.java b/audio/SamsungAudio/src/android/hardware/media/BootCompletedReceiver.java deleted file mode 100644 index 3149c48..0000000 --- a/audio/SamsungAudio/src/android/hardware/media/BootCompletedReceiver.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2023 The LineageOS 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. - */ - -package android.hardware.media; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -public class BootCompletedReceiver extends BroadcastReceiver { - - private static final boolean DEBUG = false; - private static final String TAG = "SamsungAudio"; - - @Override - public void onReceive(final Context context, Intent intent) { - if (DEBUG) Log.d(TAG, "Received boot completed intent"); - Utils.startService(context); - } -} diff --git a/audio/SamsungAudio/src/android/hardware/media/SamsungAudioService.java b/audio/SamsungAudio/src/android/hardware/media/SamsungAudioService.java deleted file mode 100644 index 2e9ad1f..0000000 --- a/audio/SamsungAudio/src/android/hardware/media/SamsungAudioService.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2023 The LineageOS 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. - */ - -package android.hardware.media; - -import android.app.Service; -import android.content.Intent; -import android.content.Context; -import android.os.SystemProperties; -import android.os.IBinder; -import android.util.Log; -import android.os.Handler; -import android.media.AudioManager; -import android.media.AudioDeviceInfo; -import android.media.AudioSystem; - -public class SamsungAudioService extends Service { - private static final String TAG = "SamsungAudioService"; - private static final boolean DEBUG = false; - - private Handler mHandler; - private static Runnable mRunnable; - private AudioManager mAudioManager; - - @Override - public void onCreate() { - if (DEBUG) Log.d(TAG, "SamsungAudioService Started"); - - mAudioManager = getSystemService(AudioManager.class); - - mHandler = new Handler(); - mRunnable = new Runnable() { - public void run() { - if (DEBUG) Log.d(TAG, "onCreate: " + TAG + " is running"); - - if (mAudioManager.getMode() == AudioManager.MODE_IN_COMMUNICATION) { - - if (mAudioManager.getCommunicationDevice().getType() == AudioDeviceInfo.TYPE_BLUETOOTH_SCO - || mAudioManager.getCommunicationDevice().getType() == AudioDeviceInfo.TYPE_BLUETOOTH_A2DP - || mAudioManager.getCommunicationDevice().getType() == AudioDeviceInfo.TYPE_BLE_SPEAKER - || mAudioManager.getCommunicationDevice().getType() == AudioDeviceInfo.TYPE_BLE_HEADSET) { - if (DEBUG) Log.d(TAG, "Setting VoIP parameter for bluetooth"); - SystemProperties.set("vendor.audio.voip.device", "bluetooth"); - AudioSystem.setParameters("voip_call=1"); - } - - if (mAudioManager.getCommunicationDevice().getType() == AudioDeviceInfo.TYPE_BUILTIN_EARPIECE) { - if (DEBUG) Log.d(TAG, "Setting VoIP parameter for earpiece"); - SystemProperties.set("vendor.audio.voip.device", "earpiece"); - AudioSystem.setParameters("voip_call=1"); - } - - if (mAudioManager.getCommunicationDevice().getType() == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER) { - if (DEBUG) Log.d(TAG, "Setting VoIP parameter for speaker"); - SystemProperties.set("vendor.audio.voip.device", "speaker"); - AudioSystem.setParameters("voip_call=1"); - } - } - mHandler.postDelayed(mRunnable, 1000); - } - }; - - mHandler.postDelayed(mRunnable, 0); - } - - @Override - public int onStartCommand(Intent intent, int flags, int startId) { - if (DEBUG) Log.d(TAG, "Starting service"); - return START_STICKY; - } - - @Override - public IBinder onBind(Intent intent) { - return null; - } -} diff --git a/audio/SamsungAudio/src/android/hardware/media/Utils.java b/audio/SamsungAudio/src/android/hardware/media/Utils.java deleted file mode 100644 index a07af01..0000000 --- a/audio/SamsungAudio/src/android/hardware/media/Utils.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2023 The LineageOS 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. - */ - -package android.hardware.media; - -import android.content.Context; -import android.content.Intent; -import android.os.UserHandle; -import android.util.Log; - -public final class Utils { - - private static final String TAG = "SamsungAudioUtils"; - private static final boolean DEBUG = false; - - protected static void startService(Context context) { - if (DEBUG) Log.d(TAG, "Starting service"); - context.startServiceAsUser(new Intent(context, SamsungAudioService.class), - UserHandle.CURRENT); - } - - protected static void stopService(Context context) { - if (DEBUG) Log.d(TAG, "Stopping service"); - context.stopServiceAsUser(new Intent(context, SamsungAudioService.class), - UserHandle.CURRENT); - } -} diff --git a/audio/configs/audio_policy_configuration.xml b/audio/configs/audio_policy_configuration.xml index 81ca187..db530db 100644 --- a/audio/configs/audio_policy_configuration.xml +++ b/audio/configs/audio_policy_configuration.xml @@ -2,14 +2,14 @@ - + - + Earpiece - Telephony Tx Speaker + Telephony Tx Built-In Mic Built-In Back Mic Telephony Rx @@ -18,7 +18,7 @@ Speaker - + @@ -26,7 +26,49 @@ - + + + + + + + + + + + + + + + + + + + + @@ -46,6 +88,16 @@ + + + + + + - @@ -78,21 +129,21 @@ - + + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_IN_VOICE_UPLINK,AUDIO_CHANNEL_IN_VOICE_DNLINK"/> + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_IN_VOICE_UPLINK,AUDIO_CHANNEL_IN_VOICE_DNLINK"/> + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_IN_VOICE_UPLINK,AUDIO_CHANNEL_IN_VOICE_DNLINK"/> + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_IN_VOICE_UPLINK,AUDIO_CHANNEL_IN_VOICE_DNLINK"/> + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_IN_VOICE_UPLINK,AUDIO_CHANNEL_IN_VOICE_DNLINK"/> + samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000" + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_IN_VOICE_UPLINK,AUDIO_CHANNEL_IN_VOICE_DNLINK"/> - + + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_IN_VOICE_UPLINK,AUDIO_CHANNEL_IN_VOICE_DNLINK"/> @@ -154,35 +206,37 @@ + sources="primary output,deep_buffer,fast,compressed_offload"/> + sources="primary output,deep_buffer,fast,compressed_offload,mmap_no_irq_out"/> - + sources="primary output,deep_buffer,fast,compressed_offload,mmap_no_irq_out"/> + + sources="primary output,deep_buffer,fast,direct_pcm,compressed_offload,mmap_no_irq_out,hifi_playback"/> + sources="primary output,deep_buffer,fast,direct_pcm,compressed_offload,mmap_no_irq_out,hifi_playback"/> + sources="primary output,deep_buffer,fast,voip_rx"/> + sources="primary output,deep_buffer,fast,voip_rx"/> + sources="primary output,deep_buffer,fast,voip_rx"/> + sources="voice_tx,incall_music_uplink"/> - + sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,Bt Sco Headset Mic,Aux Device In,FM Tuner,USB Device In,USB Headset In"/> + + diff --git a/audio/impl/Android.bp b/audio/impl/Android.bp index 538cbb2..297c747 100644 --- a/audio/impl/Android.bp +++ b/audio/impl/Android.bp @@ -43,7 +43,6 @@ cc_defaults { "libmemunreachable", "libutils", "android.hardware.audio.common-util", - "libtinyalsa", ], header_libs: [ @@ -70,7 +69,6 @@ cc_library_shared { "android.hardware.audio.common@2.0", "android.hardware.audio.common@2.0-util", "libcutils", - "libtinyalsa", ], cflags: [ "-DMAJOR_VERSION=2", @@ -89,7 +87,6 @@ cc_library_shared { "android.hardware.audio.common@4.0", "android.hardware.audio.common@4.0-util", "libcutils", - "libtinyalsa", ], cflags: [ "-DMAJOR_VERSION=4", @@ -107,7 +104,6 @@ cc_library_shared { "android.hardware.audio.common@5.0", "android.hardware.audio.common@5.0-util", "libcutils", - "libtinyalsa", ], cflags: [ "-DMAJOR_VERSION=5", @@ -125,7 +121,6 @@ cc_library_shared { "android.hardware.audio.common@6.0", "android.hardware.audio.common@6.0-util", "libcutils", - "libtinyalsa", ], cflags: [ "-DMAJOR_VERSION=6", @@ -145,7 +140,6 @@ cc_library_shared { "android.hardware.audio.common@7.0-util", "libbase", "libcutils", - "libtinyalsa", ], cflags: [ "-DMAJOR_VERSION=7", @@ -166,7 +160,6 @@ cc_library_shared { "android.hardware.audio.common@7.1-util", "libbase", "libcutils", - "libtinyalsa", ], cflags: [ "-DMAJOR_VERSION=7", diff --git a/audio/impl/ParametersUtil.cpp b/audio/impl/ParametersUtil.cpp index 0bf4172..2844d03 100644 --- a/audio/impl/ParametersUtil.cpp +++ b/audio/impl/ParametersUtil.cpp @@ -21,9 +21,6 @@ #include -#include -#include - namespace android { namespace hardware { namespace audio { @@ -142,225 +139,6 @@ Result ParametersUtil::setParam(const char* name, float value) { return setParams(param); } -int getMixerValueByName(const char *name) { - const auto mixer = mixer_open(0); - const auto ctl = mixer_get_ctl_by_name(mixer, name); - int value = 0; - - if (mixer == nullptr) { - ALOGE("Failed to find mixer ctl for %s", name); - return 0; - } - - if (ctl == nullptr) { - ALOGE("Failed to find mixer ctl for %s", name); - return 0; - } - - value = mixer_ctl_get_value(ctl, 0); - - mixer_close(mixer); - - return value; -} - -const char *getMixerValueString(const char *name) { - const auto mixer = mixer_open(0); - const auto ctl = mixer_get_ctl_by_name(mixer, name); - int control_value = mixer_ctl_get_value(ctl, 0); - const char *value; - - if (mixer == nullptr) { - ALOGE("Failed to find mixer ctl for %s", name); - return "-1"; - } - - if (ctl == nullptr) { - ALOGE("Failed to find mixer ctl for %s", name); - return "-1"; - } - - value = mixer_ctl_get_enum_string(ctl, control_value); - - mixer_close(mixer); - - return value; -} - -void setMixerValueByName(mixer *mixer, const char *name, int value) { - const auto ctl = mixer_get_ctl_by_name(mixer, name); - - if (ctl == nullptr) { - ALOGE("Failed to find mixer ctl for %s", name); - return; - } - - if (mixer_ctl_set_value(ctl, 0, value) < 0) { - ALOGE("Failed to find mixer ctl for %s", name); - return; - } -} - -void setMixerValueByNameString(mixer *mixer, const char *name, const char *value) { - const auto ctl = mixer_get_ctl_by_name(mixer, name); - - if (ctl == nullptr) { - ALOGE("Failed to find mixer ctl for %s", name); - return; - } - - if (mixer_ctl_set_enum_by_string(ctl, value)) { - ALOGE("Failed to find mixer ctl for %s", name); - return; - } -} - -void setEarpieceVoipMixers(bool enabled) { - const auto mixer = mixer_open(0); - - if (mixer == nullptr) { - ALOGE("Failed to open mixer"); - return; - } - - if (enabled) { - setMixerValueByNameString(mixer, "TX SMIC MUX0", "ADC0"); - setMixerValueByNameString(mixer, "TX SMIC MUX1", "ADC2"); - setMixerValueByName(mixer, "MultiMedia2 Mixer QUIN_MI2S_TX", 0); - setMixerValueByNameString(mixer, "TAS256X ASI1 SEL RIGHT", "I2C offset"); - setMixerValueByName(mixer, "TAS256X ASI Right Switch", 0); - setMixerValueByNameString(mixer, "TAS256X ASI1 SEL LEFT", "LeftRightDiv2"); - setMixerValueByName(mixer, "TAS256X RECEIVER ENABLE LEFT", 1); - setMixerValueByName(mixer, "TAS256X ASI Left Switch", 1); - setMixerValueByName(mixer, "TAS256X AMP OUTPUT LVL LEFT", 8); - setMixerValueByName(mixer, "TAS256X PLAYBACK VOLUME LEFT", 55); - setMixerValueByName(mixer, "TAS256X PLAYBACK VOLUME RIGHT", 55); - setMixerValueByName(mixer, "SmartPA Mute", 0); - setMixerValueByNameString(mixer, "EC Reference Channels", "One"); - setMixerValueByNameString(mixer, "AUDIO_REF_EC_UL10 MUX", "QUIN_MI2S_RX"); - setMixerValueByName(mixer, "Voip_Tx Mixer SLIM_7_TX_Voip", 0); - setMixerValueByName(mixer, "SLIM_7_RX_Voice Mixer Voip", 0); - setMixerValueByName(mixer, "QUIN_MI2S_RX_Voice Mixer Voip", 1); - setMixerValueByName(mixer, "Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip", 1); - setMixerValueByName(mixer, "QUIN_MI2S_RX_Voice Mixer Voip", 0); - setMixerValueByName(mixer, "Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip", 0); - } - - mixer_close(mixer); -} - -void setSpeakerVoipMixers(bool enabled) { - const auto mixer = mixer_open(0); - - if (mixer == nullptr) { - ALOGE("Failed to open mixer"); - return; - } - - if (enabled) { - setMixerValueByNameString(mixer, "TX SMIC MUX0", "ADC2"); - setMixerValueByNameString(mixer, "TX SMIC MUX1", "ADC0"); - setMixerValueByName(mixer, "MultiMedia2 Mixer QUIN_MI2S_TX", 1); - setMixerValueByNameString(mixer, "TAS256X ASI1 SEL RIGHT", "Right"); - setMixerValueByName(mixer, "TAS256X ASI Right Switch", 1); - setMixerValueByNameString(mixer, "TAS256X ASI1 SEL LEFT", "Left"); - setMixerValueByName(mixer, "TAS256X RECEIVER ENABLE LEFT", 0); - setMixerValueByName(mixer, "TAS256X ASI Left Switch", 1); - setMixerValueByName(mixer, "TAS256X AMP OUTPUT LVL LEFT", 20); - setMixerValueByName(mixer, "TAS256X PLAYBACK VOLUME LEFT", 55); - setMixerValueByName(mixer, "TAS256X PLAYBACK VOLUME RIGHT", 55); - setMixerValueByName(mixer, "SmartPA Mute", 0); - setMixerValueByNameString(mixer, "EC Reference Channels", "Two"); - setMixerValueByNameString(mixer, "AUDIO_REF_EC_UL10 MUX", "QUIN_MI2S_RX"); - setMixerValueByName(mixer, "Voip_Tx Mixer SLIM_7_TX_Voip", 0); - setMixerValueByName(mixer, "SLIM_7_RX_Voice Mixer Voip", 0); - setMixerValueByName(mixer, "QUIN_MI2S_RX_Voice Mixer Voip", 1); - setMixerValueByName(mixer, "Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip", 1); - setMixerValueByName(mixer, "QUIN_MI2S_RX_Voice Mixer Voip", 0); - setMixerValueByName(mixer, "Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip", 0); - } - - mixer_close(mixer); -} - -void setBTVoipMixers(bool enabled) { - const auto mixer = mixer_open(0); - - if (mixer == nullptr) { - ALOGE("Failed to open mixer"); - return; - } - - if (enabled) { - setMixerValueByName(mixer, "TX_AIF1_CAP Mixer DEC0", 0); - setMixerValueByName(mixer, "TX_AIF1_CAP Mixer DEC1", 0); - setMixerValueByNameString(mixer, "TX SMIC MUX0", "ZERO"); - setMixerValueByNameString(mixer, "TX SMIC MUX1", "ZERO"); - setMixerValueByNameString(mixer, "TX DEC0 MUX", "MSM_DMIC"); - setMixerValueByNameString(mixer, "TX DEC1 MUX", "MSM_DMIC"); - setMixerValueByName(mixer, "TX_DEC0 Volume", 102); - setMixerValueByName(mixer, "TX_DEC1 Volume", 102); - setMixerValueByName(mixer, "Voip_Tx Mixer SLIM_7_TX_Voip", 1); - setMixerValueByName(mixer, "Voip_Tx Mixer TX_CDC_DMA_TX_3_Voip", 0); - setMixerValueByName(mixer, "SLIM_7_RX_Voice Mixer Voip", 1); - setMixerValueByName(mixer, "QUIN_MI2S_RX_Voice Mixer Voip", 0); - setMixerValueByName(mixer, "TAS256X IVSENSE ENABLE", 0); - setMixerValueByName(mixer, "TAS256X PLAYBACK VOLUME LEFT", 55); - setMixerValueByName(mixer, "TAS256X RECEIVER ENABLE LEFT", 0); - setMixerValueByName(mixer, "TAS256X AMP OUTPUT LVL LEFT", 20); - setMixerValueByName(mixer, "SmartPA Mute", 1); - setMixerValueByName(mixer, "ADC1 Volume", 12); - setMixerValueByName(mixer, "ADC3 Volume", 12); - setMixerValueByNameString(mixer, "TX_CDC_DMA_TX_3 Channels", "One"); - setMixerValueByName(mixer, "TAS256X ASI Left Switch", 0); - setMixerValueByNameString(mixer, "TAS256X ASI1 SEL LEFT", "I2C Offset"); - setMixerValueByName(mixer, "ADC3_MIXER Switch", 0); - } - - mixer_close(mixer); -} - -void fixupMixers() { - char simslot[92]; - char voipdevice[92]; - const char *ampstatus; - int voipstatus, btvoipstatus; - - property_get("vendor.calls.slotid", simslot, "-1"); - property_get("vendor.audio.voip.device", voipdevice, "none"); - - voipstatus = getMixerValueByName("QUIN_MI2S_RX_Voice Mixer Voip"); - ampstatus = getMixerValueString("TAS256X RECEIVER ENABLE LEFT"); - btvoipstatus = getMixerValueByName("SLIM_7_RX_Voice Mixer Voip"); - - ALOGD("ampstatus is %s", ampstatus); - ALOGD("voipstatus is %d", voipstatus); - ALOGD("bluetooth VoIP status is %d", btvoipstatus); - - // VoIP call - if (voipstatus == 1 || btvoipstatus == 1) { - ALOGD("In VoIP call"); - if (strcmp(voipdevice, "bluetooth") == 0 && btvoipstatus == 0) { - ALOGD("Setting bluetooth mixers"); - setBTVoipMixers(true); - } - - if (strcmp(voipdevice, "earpiece") == 0) { - if (btvoipstatus == 1 || strcmp(ampstatus, "DISABLE") == 0) { - ALOGD("Setting earpiece mixers"); - setEarpieceVoipMixers(true); - } - } - - if (strcmp(voipdevice, "speaker") == 0) { - if (btvoipstatus == 1 || strcmp(ampstatus, "ENABLE") == 0) { - ALOGD("Setting speaker mixers"); - setSpeakerVoipMixers(true); - } - } - } -} - Result ParametersUtil::setParametersImpl(const hidl_vec& context, const hidl_vec& parameters) { AudioParameter params; @@ -372,11 +150,6 @@ Result ParametersUtil::setParametersImpl(const hidl_vec& context params.add(String8("g_sco_samplerate"), String8(parameters[i].value == AudioParameter::valueOn ? "16000" : "8000")); } - if (parameters[i].key == "voip_call") { - if (parameters[i].value == "1") { - fixupMixers(); - } - } params.add(String8(parameters[i].key.c_str()), String8(parameters[i].value.c_str())); } return setParams(params); diff --git a/common.mk b/common.mk index 34734cc..8421d4c 100644 --- a/common.mk +++ b/common.mk @@ -75,8 +75,7 @@ PRODUCT_PACKAGES += \ libqcomvisualizer \ libqcomvoiceprocessing \ libqcompostprocbundle \ - libvolumelistener \ - SamsungAudio + libvolumelistener PRODUCT_COPY_FILES += \ $(COMMON_PATH)/audio/configs/audio_configs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_configs.xml \ diff --git a/sepolicy/public/property.te b/sepolicy/public/property.te index 9d4a034..7de6666 100644 --- a/sepolicy/public/property.te +++ b/sepolicy/public/property.te @@ -1,5 +1,2 @@ -# Audio -system_public_prop(vendor_samsung_audio_prop) - # Fingerprint system_public_prop(vendor_fingerprint_prop) diff --git a/sepolicy/vendor/hal_audio_default.te b/sepolicy/vendor/hal_audio_default.te index c94724a..28b8882 100644 --- a/sepolicy/vendor/hal_audio_default.te +++ b/sepolicy/vendor/hal_audio_default.te @@ -6,6 +6,4 @@ allow hal_audio_default imei_efs_file:file { read open getattr }; allow hal_audio_default efs_file:dir search; -get_prop(hal_audio_default, vendor_radio_prop) -get_prop(hal_audio_default, vendor_samsung_audio_prop) -set_prop(hal_audio_default, vendor_samsung_audio_prop) +get_prop(hal_audio_default, vendor_radio_prop) \ No newline at end of file diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index bca79e4..e6528cd 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -1,6 +1,5 @@ # audio vendor.audio_hal. u:object_r:vendor_audio_prop:s0 -vendor.audio.voip.device u:object_r:vendor_samsung_audio_prop:s0 # Bluetooth vendor.bluetooth_fw_ver u:object_r:vendor_bluetooth_prop:s0 diff --git a/sepolicy/vendor/system_app.te b/sepolicy/vendor/system_app.te index 7a43bdd..edef2d6 100644 --- a/sepolicy/vendor/system_app.te +++ b/sepolicy/vendor/system_app.te @@ -13,7 +13,4 @@ allow system_app sysfs_mdnie_writable:file { open write getattr }; # UDFPS set_prop(system_app, vendor_fingerprint_prop) -get_prop(system_app, vendor_fingerprint_prop) - -set_prop(system_app, vendor_samsung_audio_prop) -get_prop(system_app, vendor_samsung_audio_prop) +get_prop(system_app, vendor_fingerprint_prop) \ No newline at end of file