-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chiron: Switch to OSS libnotifyaudiohal
Change-Id: Id392223e539716522d1c54efecae38ef72e38a1d
- Loading branch information
Showing
6 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,7 +331,8 @@ PRODUCT_COPY_FILES += \ | |
# Sensors | ||
PRODUCT_PACKAGES += \ | ||
[email protected]:64 \ | ||
[email protected] | ||
[email protected] \ | ||
libnotifyaudiohal:64 | ||
|
||
# Sdcard support | ||
PRODUCT_CHARACTERISTICS := nosdcard | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
allow hal_sensors_default audioserver_service:service_manager find; | ||
allow hal_sensors_default audioserver:binder { call transfer }; | ||
allow hal_sensors_default sound_device:chr_file { ioctl read open }; | ||
binder_use(hal_sensors_default) | ||
hal_client_domain(hal_sensors_default, hal_audio) | ||
set_prop(hal_sensors_default, vendor_sensors_prop); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
allow system_server fingerprint_sysfs:file rw_file_perms; | ||
allow system_server sound_device:chr_file rw_file_perms; | ||
get_prop(system_server, vendor_fp_prop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cc_library_shared { | ||
name: "libnotifyaudiohal", | ||
srcs: [ | ||
"libnotifyaudiohal.cpp", | ||
], | ||
shared_libs: [ | ||
"[email protected]", | ||
"libhidlbase", | ||
"liblog", | ||
"libutils", | ||
], | ||
vendor: true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (C) 2023 The LineageOS Project | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#define LOG_TAG "libnotifyaudiohal" | ||
|
||
#include <android/hardware/audio/6.0/IDevicesFactory.h> | ||
#include <log/log.h> | ||
#include <string.h> | ||
|
||
using android::sp; | ||
using android::hardware::audio::V6_0::IDevicesFactory; | ||
using android::hardware::audio::V6_0::IPrimaryDevice; | ||
using android::hardware::audio::V6_0::Result; | ||
|
||
void ultrasound_enable(int enable) { | ||
ALOGD("ultrasound_enable: %d", enable); | ||
auto factory = IDevicesFactory::getService(); | ||
factory->openPrimaryDevice([&](Result retval, const sp<IPrimaryDevice>& result) { | ||
if (retval == Result::OK) { | ||
result->setParameters({} /* context */, | ||
{ | ||
{"ultrasound-sensor", std::to_string(enable)}, | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
extern "C" void elliptic_notify_audio_hal(char* param) { | ||
ALOGD("elliptic_notify_audio_hal: %s", param); | ||
if (!strcmp(param, "ultrasound_enable=1")) { | ||
ultrasound_enable(1); | ||
} else if (!strcmp(param, "ultrasound_enable=0")) { | ||
ultrasound_enable(0); | ||
} | ||
} | ||
|
||
extern "C" void elliptic_ultrasound_supported() { | ||
return; | ||
} |