1// Copyright (C) 2020 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15// HapticGenerator library 16package { 17 // See: http://go/android-license-faq 18 // A large-scale-change added 'default_applicable_licenses' to import 19 // all of the 'license_kinds' from "frameworks_av_license" 20 // to get the below license kinds: 21 // SPDX-license-identifier-Apache-2.0 22 default_applicable_licenses: ["frameworks_av_license"], 23} 24 25cc_defaults { 26 name: "hapticgeneratordefaults", 27 srcs: [ 28 "Processors.cpp", 29 ], 30 shared_libs: [ 31 "libaudioutils", 32 "libbase", 33 "liblog", 34 "libutils", 35 "libvibratorutils", 36 ], 37 header_libs: [ 38 "libaudioeffects", 39 ], 40 cflags: [ 41 // This is needed for the non-zero coefficients optimization for 42 // BiquadFilter. Try the biquad_filter_benchmark test in audio_utils 43 // with/without `-ffast-math` for more context. 44 "-ffast-math", 45 "-fhonor-infinities", 46 "-fhonor-nans", 47 ], 48 relative_install_path: "soundfx", 49} 50 51cc_library_shared { 52 name: "libhapticgenerator", 53 54 vendor: true, 55 56 srcs: [ 57 "EffectHapticGenerator.cpp", 58 ], 59 60 defaults: [ 61 "hapticgeneratordefaults", 62 ], 63 64 cflags: [ 65 // Turning on the optimization in order to reduce effect processing time. 66 // The latency is around 1/5 less than without the optimization. 67 "-O2", 68 "-Wall", 69 "-Werror", 70 "-fvisibility=hidden", 71 ], 72} 73 74cc_library_shared { 75 name: "libhapticgeneratoraidl", 76 77 srcs: [ 78 ":effectCommonFile", 79 "aidl/EffectHapticGenerator.cpp", 80 "aidl/HapticGeneratorContext.cpp", 81 ], 82 83 defaults: [ 84 "aidlaudioeffectservice_defaults", 85 "hapticgeneratordefaults", 86 ], 87 88 cflags: [ 89 "-Wthread-safety", 90 ], 91 92 visibility: [ 93 "//hardware/interfaces/audio/aidl/default:__subpackages__", 94 ], 95} 96