This reverts commit 64b507b1cf
.
Additionally, stop using delays as that can cause audioserver to crash
Change-Id: If77eef84d04039b79ea1390dc81f89e5f01f354f
parent
1ef977c734
commit
3462aad493
@ -1,30 +0,0 @@ |
|||||||
// |
|
||||||
// Copyright (C) 2023 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. |
|
||||||
|
|
||||||
cc_binary { |
|
||||||
name: "audio_parameter_service.samsung_sm7125", |
|
||||||
init_rc: ["audio_parameter_service.rc"], |
|
||||||
system_ext_specific: true, |
|
||||||
srcs: [ |
|
||||||
"audio_parameter_service.cpp", |
|
||||||
], |
|
||||||
shared_libs: [ |
|
||||||
"libbase", |
|
||||||
"libutils", |
|
||||||
"libhidlbase", |
|
||||||
"liblog", |
|
||||||
"android.hardware.audio@7.0", |
|
||||||
], |
|
||||||
} |
|
@ -1,55 +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. |
|
||||||
*/ |
|
||||||
|
|
||||||
#include <android-base/properties.h> |
|
||||||
#include <android-base/logging.h> |
|
||||||
#include <android/hardware/audio/7.0/IDevicesFactory.h> |
|
||||||
|
|
||||||
using android::base::GetProperty; |
|
||||||
using android::base::SetProperty; |
|
||||||
using android::sp; |
|
||||||
using ::android::hardware::hidl_string; |
|
||||||
|
|
||||||
int main() { |
|
||||||
sp<::android::hardware::audio::V7_0::IDevice> audioDevice; |
|
||||||
|
|
||||||
LOG(DEBUG) << "Passing g_call_sim_slot parameter"; |
|
||||||
|
|
||||||
if (!audioDevice) { |
|
||||||
::android::hardware::audio::V7_0::IDevicesFactory::getService()->openDevice( |
|
||||||
"primary", [&](::android::hardware::audio::V7_0::Result, const sp<::android::hardware::audio::V7_0::IDevice>& result) { |
|
||||||
audioDevice = result; |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
if (audioDevice != nullptr) { |
|
||||||
std::string value = ""; |
|
||||||
|
|
||||||
if (strcmp(GetProperty("vendor.calls.slotid", "-1").c_str(), "1") == 0) { |
|
||||||
// SIM 2
|
|
||||||
value = "0x02"; |
|
||||||
} |
|
||||||
|
|
||||||
audioDevice->setParameters({}, {{"g_call_sim_slot", value}}); |
|
||||||
} |
|
||||||
|
|
||||||
if (audioDevice != nullptr) |
|
||||||
audioDevice->close(); |
|
||||||
|
|
||||||
SetProperty("vendor.calls.parameter_state", "1"); |
|
||||||
|
|
||||||
return 0; |
|
||||||
} |
|
@ -1,16 +0,0 @@ |
|||||||
service audio_parameter_service /system_ext/bin/audio_parameter_service.samsung_sm7125 |
|
||||||
oneshot |
|
||||||
disabled |
|
||||||
|
|
||||||
on boot |
|
||||||
setprop vendor.calls.parameter_state 0 |
|
||||||
|
|
||||||
on property:vendor.calls.slotid=1 && property:vendor.calls.parameter_state=0 |
|
||||||
stop audioserver |
|
||||||
start audioserver |
|
||||||
start audio_parameter_service |
|
||||||
|
|
||||||
on property:vendor.calls.slotid=-1 && property:vendor.calls.parameter_state=1 |
|
||||||
setprop vendor.calls.parameter_state 0 |
|
||||||
stop audioserver |
|
||||||
start audioserver |
|
@ -1,8 +0,0 @@ |
|||||||
type audio_parameter_service, domain, coredomain; |
|
||||||
type audio_parameter_service_exec, system_file_type, exec_type, file_type; |
|
||||||
|
|
||||||
init_daemon_domain(audio_parameter_service) |
|
||||||
|
|
||||||
hal_client_domain(audio_parameter_service, hal_audio) |
|
||||||
|
|
||||||
set_prop(audio_parameter_service, vendor_call_prop) |
|
@ -1 +0,0 @@ |
|||||||
/(system_ext|system/system_ext)/bin/audio_parameter_service.samsung_sm7125 u:object_r:audio_parameter_service_exec:s0 |
|
@ -1 +0,0 @@ |
|||||||
system_public_prop(vendor_call_prop) |
|
Loading…
Reference in new issue