Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <stdio.h> |
| 18 | |
| 19 | #define LOG_TAG "DeviceHalHidl" |
| 20 | //#define LOG_NDEBUG 0 |
| 21 | |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 22 | #include <cutils/native_handle.h> |
Jiabin Huang | ebe6410 | 2021-09-07 20:01:07 +0000 | [diff] [blame] | 23 | #include <cutils/properties.h> |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 24 | #include <hwbinder/IPCThreadState.h> |
jiabin | daf4995 | 2019-11-22 14:10:57 -0800 | [diff] [blame] | 25 | #include <media/AudioContainers.h> |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 26 | #include <mediautils/TimeCheck.h> |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 27 | #include <utils/Log.h> |
| 28 | |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 29 | #include PATH(android/hardware/audio/FILE_VERSION/IPrimaryDevice.h) |
| 30 | #include <HidlUtils.h> |
Kevin Rocard | b9cfbf1 | 2018-02-23 19:11:06 -0800 | [diff] [blame] | 31 | #include <common/all-versions/VersionUtils.h> |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 32 | #include <util/CoreUtils.h> |
Kevin Rocard | b9cfbf1 | 2018-02-23 19:11:06 -0800 | [diff] [blame] | 33 | |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 34 | #include "DeviceHalHidl.h" |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 35 | #include "ParameterUtils.h" |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 36 | #include "StreamHalHidl.h" |
| 37 | |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 38 | using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::implementation::HidlUtils; |
Kevin Rocard | 7a9f05a | 2018-11-28 16:52:25 -0800 | [diff] [blame] | 39 | using ::android::hardware::audio::common::utils::EnumBitfield; |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 40 | using ::android::hardware::audio::CORE_TYPES_CPP_VERSION::implementation::CoreUtils; |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 41 | using ::android::hardware::hidl_string; |
| 42 | using ::android::hardware::hidl_vec; |
| 43 | |
| 44 | namespace android { |
| 45 | |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 46 | using namespace ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION; |
| 47 | using namespace ::android::hardware::audio::CORE_TYPES_CPP_VERSION; |
Mikhail Naganov | 9ccaa16 | 2018-12-12 10:27:29 -0800 | [diff] [blame] | 48 | |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 49 | DeviceHalHidl::DeviceHalHidl(const sp<::android::hardware::audio::CPP_VERSION::IDevice>& device) |
Mikhail Naganov | 288a343 | 2022-03-25 00:29:56 +0000 | [diff] [blame] | 50 | : CoreConversionHelperHidl("DeviceHalHidl"), mDevice(device) { |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 51 | } |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 52 | |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 53 | DeviceHalHidl::DeviceHalHidl( |
| 54 | const sp<::android::hardware::audio::CPP_VERSION::IPrimaryDevice>& device) |
Mikhail Naganov | 288a343 | 2022-03-25 00:29:56 +0000 | [diff] [blame] | 55 | : CoreConversionHelperHidl("DeviceHalHidl"), |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 56 | #if MAJOR_VERSION <= 6 || (MAJOR_VERSION == 7 && MINOR_VERSION == 0) |
| 57 | mDevice(device), |
| 58 | #endif |
| 59 | mPrimaryDevice(device) { |
| 60 | #if MAJOR_VERSION == 7 && MINOR_VERSION == 1 |
| 61 | auto getDeviceRet = mPrimaryDevice->getDevice(); |
| 62 | if (getDeviceRet.isOk()) { |
| 63 | mDevice = getDeviceRet; |
| 64 | } else { |
| 65 | ALOGE("Call to IPrimaryDevice.getDevice has failed: %s", |
| 66 | getDeviceRet.description().c_str()); |
| 67 | } |
| 68 | #endif |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | DeviceHalHidl::~DeviceHalHidl() { |
| 72 | if (mDevice != 0) { |
Mikhail Naganov | 3355e44 | 2019-11-20 14:20:01 -0800 | [diff] [blame] | 73 | #if MAJOR_VERSION <= 5 |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 74 | mDevice.clear(); |
| 75 | hardware::IPCThreadState::self()->flushCommands(); |
Mikhail Naganov | 3355e44 | 2019-11-20 14:20:01 -0800 | [diff] [blame] | 76 | #elif MAJOR_VERSION >= 6 |
| 77 | mDevice->close(); |
| 78 | #endif |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 79 | } |
| 80 | } |
| 81 | |
Mikhail Naganov | f83b974 | 2023-04-24 13:06:04 -0700 | [diff] [blame^] | 82 | status_t DeviceHalHidl::getAudioPorts( |
| 83 | std::vector<media::audio::common::AudioPort> *ports __unused) { |
| 84 | return INVALID_OPERATION; |
| 85 | } |
| 86 | |
| 87 | status_t DeviceHalHidl::getAudioRoutes(std::vector<media::AudioRoute> *routes __unused) { |
| 88 | return INVALID_OPERATION; |
| 89 | } |
| 90 | |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 91 | status_t DeviceHalHidl::getSupportedDevices(uint32_t*) { |
| 92 | // Obsolete. |
| 93 | return INVALID_OPERATION; |
| 94 | } |
| 95 | |
| 96 | status_t DeviceHalHidl::initCheck() { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 97 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 98 | if (mDevice == 0) return NO_INIT; |
| 99 | return processReturn("initCheck", mDevice->initCheck()); |
| 100 | } |
| 101 | |
| 102 | status_t DeviceHalHidl::setVoiceVolume(float volume) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 103 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 104 | if (mDevice == 0) return NO_INIT; |
| 105 | if (mPrimaryDevice == 0) return INVALID_OPERATION; |
| 106 | return processReturn("setVoiceVolume", mPrimaryDevice->setVoiceVolume(volume)); |
| 107 | } |
| 108 | |
| 109 | status_t DeviceHalHidl::setMasterVolume(float volume) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 110 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 111 | if (mDevice == 0) return NO_INIT; |
Mikhail Naganov | ae1f662 | 2019-02-21 15:20:05 -0800 | [diff] [blame] | 112 | return processReturn("setMasterVolume", mDevice->setMasterVolume(volume)); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | status_t DeviceHalHidl::getMasterVolume(float *volume) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 116 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 117 | if (mDevice == 0) return NO_INIT; |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 118 | Result retval; |
Mikhail Naganov | ae1f662 | 2019-02-21 15:20:05 -0800 | [diff] [blame] | 119 | Return<void> ret = mDevice->getMasterVolume( |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 120 | [&](Result r, float v) { |
| 121 | retval = r; |
| 122 | if (retval == Result::OK) { |
| 123 | *volume = v; |
| 124 | } |
| 125 | }); |
| 126 | return processReturn("getMasterVolume", ret, retval); |
| 127 | } |
| 128 | |
| 129 | status_t DeviceHalHidl::setMode(audio_mode_t mode) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 130 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 131 | if (mDevice == 0) return NO_INIT; |
| 132 | if (mPrimaryDevice == 0) return INVALID_OPERATION; |
| 133 | return processReturn("setMode", mPrimaryDevice->setMode(AudioMode(mode))); |
| 134 | } |
| 135 | |
| 136 | status_t DeviceHalHidl::setMicMute(bool state) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 137 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 138 | if (mDevice == 0) return NO_INIT; |
| 139 | return processReturn("setMicMute", mDevice->setMicMute(state)); |
| 140 | } |
| 141 | |
| 142 | status_t DeviceHalHidl::getMicMute(bool *state) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 143 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 144 | if (mDevice == 0) return NO_INIT; |
| 145 | Result retval; |
| 146 | Return<void> ret = mDevice->getMicMute( |
| 147 | [&](Result r, bool mute) { |
| 148 | retval = r; |
| 149 | if (retval == Result::OK) { |
| 150 | *state = mute; |
| 151 | } |
| 152 | }); |
| 153 | return processReturn("getMicMute", ret, retval); |
| 154 | } |
| 155 | |
| 156 | status_t DeviceHalHidl::setMasterMute(bool state) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 157 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 158 | if (mDevice == 0) return NO_INIT; |
| 159 | return processReturn("setMasterMute", mDevice->setMasterMute(state)); |
| 160 | } |
| 161 | |
| 162 | status_t DeviceHalHidl::getMasterMute(bool *state) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 163 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 164 | if (mDevice == 0) return NO_INIT; |
| 165 | Result retval; |
| 166 | Return<void> ret = mDevice->getMasterMute( |
| 167 | [&](Result r, bool mute) { |
| 168 | retval = r; |
| 169 | if (retval == Result::OK) { |
| 170 | *state = mute; |
| 171 | } |
| 172 | }); |
| 173 | return processReturn("getMasterMute", ret, retval); |
| 174 | } |
| 175 | |
| 176 | status_t DeviceHalHidl::setParameters(const String8& kvPairs) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 177 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 178 | if (mDevice == 0) return NO_INIT; |
| 179 | hidl_vec<ParameterValue> hidlParams; |
| 180 | status_t status = parametersFromHal(kvPairs, &hidlParams); |
| 181 | if (status != OK) return status; |
Kevin Rocard | b9cfbf1 | 2018-02-23 19:11:06 -0800 | [diff] [blame] | 182 | // TODO: change the API so that context and kvPairs are separated |
| 183 | return processReturn("setParameters", |
| 184 | utils::setParameters(mDevice, {} /* context */, hidlParams)); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | status_t DeviceHalHidl::getParameters(const String8& keys, String8 *values) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 188 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 189 | values->clear(); |
| 190 | if (mDevice == 0) return NO_INIT; |
| 191 | hidl_vec<hidl_string> hidlKeys; |
| 192 | status_t status = keysFromHal(keys, &hidlKeys); |
| 193 | if (status != OK) return status; |
| 194 | Result retval; |
Kevin Rocard | b9cfbf1 | 2018-02-23 19:11:06 -0800 | [diff] [blame] | 195 | Return<void> ret = utils::getParameters(mDevice, |
| 196 | {} /* context */, |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 197 | hidlKeys, |
| 198 | [&](Result r, const hidl_vec<ParameterValue>& parameters) { |
| 199 | retval = r; |
| 200 | if (retval == Result::OK) { |
| 201 | parametersToHal(parameters, values); |
| 202 | } |
| 203 | }); |
| 204 | return processReturn("getParameters", ret, retval); |
| 205 | } |
| 206 | |
| 207 | status_t DeviceHalHidl::getInputBufferSize( |
| 208 | const struct audio_config *config, size_t *size) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 209 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 210 | if (mDevice == 0) return NO_INIT; |
| 211 | AudioConfig hidlConfig; |
Mikhail Naganov | 05e0319 | 2020-12-14 23:19:54 +0000 | [diff] [blame] | 212 | HidlUtils::audioConfigFromHal(*config, true /*isInput*/, &hidlConfig); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 213 | Result retval; |
| 214 | Return<void> ret = mDevice->getInputBufferSize( |
| 215 | hidlConfig, |
| 216 | [&](Result r, uint64_t bufferSize) { |
| 217 | retval = r; |
| 218 | if (retval == Result::OK) { |
| 219 | *size = static_cast<size_t>(bufferSize); |
| 220 | } |
| 221 | }); |
| 222 | return processReturn("getInputBufferSize", ret, retval); |
| 223 | } |
| 224 | |
| 225 | status_t DeviceHalHidl::openOutputStream( |
| 226 | audio_io_handle_t handle, |
jiabin | 4381040 | 2019-10-24 14:58:31 -0700 | [diff] [blame] | 227 | audio_devices_t deviceType, |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 228 | audio_output_flags_t flags, |
| 229 | struct audio_config *config, |
| 230 | const char *address, |
| 231 | sp<StreamOutHalInterface> *outStream) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 232 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 233 | if (mDevice == 0) return NO_INIT; |
| 234 | DeviceAddress hidlDevice; |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 235 | if (status_t status = CoreUtils::deviceAddressFromHal(deviceType, address, &hidlDevice); |
| 236 | status != OK) { |
| 237 | return status; |
| 238 | } |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 239 | AudioConfig hidlConfig; |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 240 | if (status_t status = HidlUtils::audioConfigFromHal(*config, false /*isInput*/, &hidlConfig); |
| 241 | status != OK) { |
| 242 | return status; |
| 243 | } |
Eric Laurent | e28c66d | 2022-01-21 13:40:41 +0100 | [diff] [blame] | 244 | |
| 245 | #if !(MAJOR_VERSION == 7 && MINOR_VERSION == 1) |
| 246 | //TODO: b/193496180 use spatializer flag at audio HAL when available |
| 247 | if ((flags & AUDIO_OUTPUT_FLAG_SPATIALIZER) != 0) { |
| 248 | flags = (audio_output_flags_t)(flags & ~AUDIO_OUTPUT_FLAG_SPATIALIZER); |
| 249 | flags = (audio_output_flags_t) |
| 250 | (flags | AUDIO_OUTPUT_FLAG_FAST | AUDIO_OUTPUT_FLAG_DEEP_BUFFER); |
| 251 | } |
| 252 | #endif |
| 253 | |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 254 | CoreUtils::AudioOutputFlags hidlFlags; |
| 255 | if (status_t status = CoreUtils::audioOutputFlagsFromHal(flags, &hidlFlags); status != OK) { |
| 256 | return status; |
| 257 | } |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 258 | Result retval = Result::NOT_INITIALIZED; |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 259 | #if MAJOR_VERSION == 7 && MINOR_VERSION == 1 |
| 260 | Return<void> ret = mDevice->openOutputStream_7_1( |
| 261 | #else |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 262 | Return<void> ret = mDevice->openOutputStream( |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 263 | #endif |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 264 | handle, hidlDevice, hidlConfig, hidlFlags, |
Kevin Rocard | 3d48dce | 2018-11-08 17:16:57 -0800 | [diff] [blame] | 265 | #if MAJOR_VERSION >= 4 |
Kevin Rocard | b9cfbf1 | 2018-02-23 19:11:06 -0800 | [diff] [blame] | 266 | {} /* metadata */, |
Kevin Rocard | 070e751 | 2018-05-22 09:29:13 -0700 | [diff] [blame] | 267 | #endif |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 268 | [&](Result r, const sp<::android::hardware::audio::CPP_VERSION::IStreamOut>& result, |
| 269 | const AudioConfig& suggestedConfig) { |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 270 | retval = r; |
| 271 | if (retval == Result::OK) { |
| 272 | *outStream = new StreamOutHalHidl(result); |
| 273 | } |
| 274 | HidlUtils::audioConfigToHal(suggestedConfig, config); |
| 275 | }); |
| 276 | return processReturn("openOutputStream", ret, retval); |
| 277 | } |
| 278 | |
| 279 | status_t DeviceHalHidl::openInputStream( |
| 280 | audio_io_handle_t handle, |
| 281 | audio_devices_t devices, |
| 282 | struct audio_config *config, |
| 283 | audio_input_flags_t flags, |
| 284 | const char *address, |
| 285 | audio_source_t source, |
Mikhail Naganov | b4e037e | 2019-01-14 15:56:33 -0800 | [diff] [blame] | 286 | audio_devices_t outputDevice, |
| 287 | const char *outputDeviceAddress, |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 288 | sp<StreamInHalInterface> *inStream) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 289 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 290 | if (mDevice == 0) return NO_INIT; |
| 291 | DeviceAddress hidlDevice; |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 292 | if (status_t status = CoreUtils::deviceAddressFromHal(devices, address, &hidlDevice); |
| 293 | status != OK) { |
| 294 | return status; |
| 295 | } |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 296 | AudioConfig hidlConfig; |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 297 | if (status_t status = HidlUtils::audioConfigFromHal(*config, true /*isInput*/, &hidlConfig); |
| 298 | status != OK) { |
| 299 | return status; |
| 300 | } |
| 301 | CoreUtils::AudioInputFlags hidlFlags; |
Dean Wheatley | ea18634 | 2021-03-12 16:49:47 +1100 | [diff] [blame] | 302 | #if MAJOR_VERSION <= 5 |
| 303 | // Some flags were specific to framework and must not leak to the HAL. |
| 304 | flags = static_cast<audio_input_flags_t>(flags & ~AUDIO_INPUT_FLAG_DIRECT); |
| 305 | #endif |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 306 | if (status_t status = CoreUtils::audioInputFlagsFromHal(flags, &hidlFlags); status != OK) { |
| 307 | return status; |
| 308 | } |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 309 | Result retval = Result::NOT_INITIALIZED; |
Kevin Rocard | 070e751 | 2018-05-22 09:29:13 -0700 | [diff] [blame] | 310 | #if MAJOR_VERSION == 2 |
Mikhail Naganov | d9499eb | 2018-12-17 16:23:22 -0800 | [diff] [blame] | 311 | auto sinkMetadata = AudioSource(source); |
Kevin Rocard | 3d48dce | 2018-11-08 17:16:57 -0800 | [diff] [blame] | 312 | #elif MAJOR_VERSION >= 4 |
Kevin Rocard | b9cfbf1 | 2018-02-23 19:11:06 -0800 | [diff] [blame] | 313 | // TODO: correctly propagate the tracks sources and volume |
| 314 | // for now, only send the main source at 1dbfs |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 315 | AudioSource hidlSource; |
| 316 | if (status_t status = HidlUtils::audioSourceFromHal(source, &hidlSource); status != OK) { |
| 317 | return status; |
| 318 | } |
| 319 | SinkMetadata sinkMetadata = {{{ .source = std::move(hidlSource), .gain = 1 }}}; |
Kevin Rocard | 070e751 | 2018-05-22 09:29:13 -0700 | [diff] [blame] | 320 | #endif |
Mikhail Naganov | b4e037e | 2019-01-14 15:56:33 -0800 | [diff] [blame] | 321 | #if MAJOR_VERSION < 5 |
| 322 | (void)outputDevice; |
| 323 | (void)outputDeviceAddress; |
| 324 | #else |
Mikhail Naganov | c425880 | 2021-02-08 17:14:17 -0800 | [diff] [blame] | 325 | #if MAJOR_VERSION >= 7 |
| 326 | (void)HidlUtils::audioChannelMaskFromHal( |
| 327 | AUDIO_CHANNEL_NONE, true /*isInput*/, &sinkMetadata.tracks[0].channelMask); |
| 328 | #endif |
Mikhail Naganov | b4e037e | 2019-01-14 15:56:33 -0800 | [diff] [blame] | 329 | if (outputDevice != AUDIO_DEVICE_NONE) { |
| 330 | DeviceAddress hidlOutputDevice; |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 331 | if (status_t status = CoreUtils::deviceAddressFromHal( |
| 332 | outputDevice, outputDeviceAddress, &hidlOutputDevice); status != OK) { |
| 333 | return status; |
| 334 | } |
Mikhail Naganov | b4e037e | 2019-01-14 15:56:33 -0800 | [diff] [blame] | 335 | sinkMetadata.tracks[0].destination.device(std::move(hidlOutputDevice)); |
| 336 | } |
| 337 | #endif |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 338 | Return<void> ret = mDevice->openInputStream( |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 339 | handle, hidlDevice, hidlConfig, hidlFlags, sinkMetadata, |
Mikhail Naganov | accbe8a | 2022-02-03 23:45:36 +0000 | [diff] [blame] | 340 | [&](Result r, |
| 341 | const sp<::android::hardware::audio::CORE_TYPES_CPP_VERSION::IStreamIn>& result, |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 342 | const AudioConfig& suggestedConfig) { |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 343 | retval = r; |
| 344 | if (retval == Result::OK) { |
| 345 | *inStream = new StreamInHalHidl(result); |
| 346 | } |
| 347 | HidlUtils::audioConfigToHal(suggestedConfig, config); |
| 348 | }); |
| 349 | return processReturn("openInputStream", ret, retval); |
| 350 | } |
| 351 | |
| 352 | status_t DeviceHalHidl::supportsAudioPatches(bool *supportsPatches) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 353 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 354 | if (mDevice == 0) return NO_INIT; |
| 355 | return processReturn("supportsAudioPatches", mDevice->supportsAudioPatches(), supportsPatches); |
| 356 | } |
| 357 | |
| 358 | status_t DeviceHalHidl::createAudioPatch( |
| 359 | unsigned int num_sources, |
| 360 | const struct audio_port_config *sources, |
| 361 | unsigned int num_sinks, |
| 362 | const struct audio_port_config *sinks, |
| 363 | audio_patch_handle_t *patch) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 364 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 365 | if (mDevice == 0) return NO_INIT; |
Eric Laurent | 8711cfd | 2019-06-10 18:06:33 -0700 | [diff] [blame] | 366 | if (patch == nullptr) return BAD_VALUE; |
| 367 | |
Mikhail Naganov | 73bdf57 | 2019-12-11 12:34:15 -0800 | [diff] [blame] | 368 | #if MAJOR_VERSION < 6 |
Eric Laurent | 8711cfd | 2019-06-10 18:06:33 -0700 | [diff] [blame] | 369 | if (*patch != AUDIO_PATCH_HANDLE_NONE) { |
| 370 | status_t status = releaseAudioPatch(*patch); |
| 371 | ALOGW_IF(status != NO_ERROR, "%s error %d releasing patch handle %d", |
| 372 | __func__, status, *patch); |
Mikhail Naganov | 73bdf57 | 2019-12-11 12:34:15 -0800 | [diff] [blame] | 373 | *patch = AUDIO_PATCH_HANDLE_NONE; |
Eric Laurent | 8711cfd | 2019-06-10 18:06:33 -0700 | [diff] [blame] | 374 | } |
Mikhail Naganov | 73bdf57 | 2019-12-11 12:34:15 -0800 | [diff] [blame] | 375 | #endif |
Eric Laurent | 8711cfd | 2019-06-10 18:06:33 -0700 | [diff] [blame] | 376 | |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 377 | hidl_vec<AudioPortConfig> hidlSources, hidlSinks; |
| 378 | HidlUtils::audioPortConfigsFromHal(num_sources, sources, &hidlSources); |
| 379 | HidlUtils::audioPortConfigsFromHal(num_sinks, sinks, &hidlSinks); |
Mikhail Naganov | 73bdf57 | 2019-12-11 12:34:15 -0800 | [diff] [blame] | 380 | Result retval = Result::OK; |
| 381 | Return<void> ret; |
| 382 | std::string methodName = "createAudioPatch"; |
| 383 | if (*patch == AUDIO_PATCH_HANDLE_NONE) { // always true for MAJOR_VERSION < 6 |
| 384 | ret = mDevice->createAudioPatch( |
| 385 | hidlSources, hidlSinks, |
| 386 | [&](Result r, AudioPatchHandle hidlPatch) { |
| 387 | retval = r; |
| 388 | if (retval == Result::OK) { |
| 389 | *patch = static_cast<audio_patch_handle_t>(hidlPatch); |
| 390 | } |
| 391 | }); |
| 392 | } else { |
| 393 | #if MAJOR_VERSION >= 6 |
| 394 | ret = mDevice->updateAudioPatch( |
| 395 | *patch, |
| 396 | hidlSources, hidlSinks, |
| 397 | [&](Result r, AudioPatchHandle hidlPatch) { |
| 398 | retval = r; |
| 399 | if (retval == Result::OK) { |
| 400 | *patch = static_cast<audio_patch_handle_t>(hidlPatch); |
| 401 | } |
| 402 | }); |
| 403 | methodName = "updateAudioPatch"; |
| 404 | #endif |
| 405 | } |
| 406 | return processReturn(methodName.c_str(), ret, retval); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 407 | } |
| 408 | |
| 409 | status_t DeviceHalHidl::releaseAudioPatch(audio_patch_handle_t patch) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 410 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 411 | if (mDevice == 0) return NO_INIT; |
| 412 | return processReturn("releaseAudioPatch", mDevice->releaseAudioPatch(patch)); |
| 413 | } |
| 414 | |
Mikhail Naganov | 720cc43 | 2021-03-24 20:42:49 -0700 | [diff] [blame] | 415 | template <typename HalPort> |
| 416 | status_t DeviceHalHidl::getAudioPortImpl(HalPort *port) { |
Mikhail Naganov | f83b974 | 2023-04-24 13:06:04 -0700 | [diff] [blame^] | 417 | using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioPort; |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 418 | if (mDevice == 0) return NO_INIT; |
| 419 | AudioPort hidlPort; |
| 420 | HidlUtils::audioPortFromHal(*port, &hidlPort); |
| 421 | Result retval; |
| 422 | Return<void> ret = mDevice->getAudioPort( |
| 423 | hidlPort, |
| 424 | [&](Result r, const AudioPort& p) { |
| 425 | retval = r; |
| 426 | if (retval == Result::OK) { |
| 427 | HidlUtils::audioPortToHal(p, port); |
| 428 | } |
| 429 | }); |
| 430 | return processReturn("getAudioPort", ret, retval); |
| 431 | } |
| 432 | |
Mikhail Naganov | 720cc43 | 2021-03-24 20:42:49 -0700 | [diff] [blame] | 433 | status_t DeviceHalHidl::getAudioPort(struct audio_port *port) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 434 | TIME_CHECK(); |
Mikhail Naganov | 720cc43 | 2021-03-24 20:42:49 -0700 | [diff] [blame] | 435 | return getAudioPortImpl(port); |
| 436 | } |
| 437 | |
jiabin | b4fed19 | 2020-09-22 14:45:40 -0700 | [diff] [blame] | 438 | status_t DeviceHalHidl::getAudioPort(struct audio_port_v7 *port) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 439 | TIME_CHECK(); |
jiabin | b4fed19 | 2020-09-22 14:45:40 -0700 | [diff] [blame] | 440 | #if MAJOR_VERSION >= 7 |
Mikhail Naganov | 720cc43 | 2021-03-24 20:42:49 -0700 | [diff] [blame] | 441 | return getAudioPortImpl(port); |
jiabin | b4fed19 | 2020-09-22 14:45:40 -0700 | [diff] [blame] | 442 | #else |
| 443 | struct audio_port audioPort = {}; |
Mikhail Naganov | 720cc43 | 2021-03-24 20:42:49 -0700 | [diff] [blame] | 444 | status_t result = NO_ERROR; |
| 445 | if (!audio_populate_audio_port(port, &audioPort)) { |
| 446 | ALOGE("Failed to populate legacy audio port from audio_port_v7"); |
| 447 | result = BAD_VALUE; |
| 448 | } |
| 449 | status_t status = getAudioPort(&audioPort); |
jiabin | b4fed19 | 2020-09-22 14:45:40 -0700 | [diff] [blame] | 450 | if (status == NO_ERROR) { |
| 451 | audio_populate_audio_port_v7(&audioPort, port); |
Mikhail Naganov | 720cc43 | 2021-03-24 20:42:49 -0700 | [diff] [blame] | 452 | } else { |
| 453 | result = status; |
jiabin | b4fed19 | 2020-09-22 14:45:40 -0700 | [diff] [blame] | 454 | } |
Mikhail Naganov | 720cc43 | 2021-03-24 20:42:49 -0700 | [diff] [blame] | 455 | return result; |
jiabin | b4fed19 | 2020-09-22 14:45:40 -0700 | [diff] [blame] | 456 | #endif |
jiabin | b4fed19 | 2020-09-22 14:45:40 -0700 | [diff] [blame] | 457 | } |
| 458 | |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 459 | status_t DeviceHalHidl::setAudioPortConfig(const struct audio_port_config *config) { |
Mikhail Naganov | f83b974 | 2023-04-24 13:06:04 -0700 | [diff] [blame^] | 460 | using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioPortConfig; |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 461 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 462 | if (mDevice == 0) return NO_INIT; |
| 463 | AudioPortConfig hidlConfig; |
| 464 | HidlUtils::audioPortConfigFromHal(*config, &hidlConfig); |
| 465 | return processReturn("setAudioPortConfig", mDevice->setAudioPortConfig(hidlConfig)); |
| 466 | } |
| 467 | |
Kevin Rocard | 070e751 | 2018-05-22 09:29:13 -0700 | [diff] [blame] | 468 | #if MAJOR_VERSION == 2 |
| 469 | status_t DeviceHalHidl::getMicrophones( |
Shunkai Yao | 5120250 | 2022-12-12 06:11:46 +0000 | [diff] [blame] | 470 | std::vector<audio_microphone_characteristic_t> *microphonesInfo __unused) { |
Kevin Rocard | 070e751 | 2018-05-22 09:29:13 -0700 | [diff] [blame] | 471 | if (mDevice == 0) return NO_INIT; |
| 472 | return INVALID_OPERATION; |
| 473 | } |
Kevin Rocard | 3d48dce | 2018-11-08 17:16:57 -0800 | [diff] [blame] | 474 | #elif MAJOR_VERSION >= 4 |
Shunkai Yao | 5120250 | 2022-12-12 06:11:46 +0000 | [diff] [blame] | 475 | status_t DeviceHalHidl::getMicrophones( |
| 476 | std::vector<audio_microphone_characteristic_t> *microphonesInfo) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 477 | TIME_CHECK(); |
jiabin | 9ff780e | 2018-03-19 18:19:52 -0700 | [diff] [blame] | 478 | if (mDevice == 0) return NO_INIT; |
| 479 | Result retval; |
| 480 | Return<void> ret = mDevice->getMicrophones( |
| 481 | [&](Result r, hidl_vec<MicrophoneInfo> micArrayHal) { |
| 482 | retval = r; |
| 483 | for (size_t k = 0; k < micArrayHal.size(); k++) { |
| 484 | audio_microphone_characteristic_t dst; |
| 485 | //convert |
Mikhail Naganov | 247b5f9 | 2021-01-15 19:16:12 +0000 | [diff] [blame] | 486 | (void)CoreUtils::microphoneInfoToHal(micArrayHal[k], &dst); |
Shunkai Yao | 5120250 | 2022-12-12 06:11:46 +0000 | [diff] [blame] | 487 | microphonesInfo->push_back(dst); |
jiabin | 9ff780e | 2018-03-19 18:19:52 -0700 | [diff] [blame] | 488 | } |
| 489 | }); |
| 490 | return processReturn("getMicrophones", ret, retval); |
| 491 | } |
Kevin Rocard | 070e751 | 2018-05-22 09:29:13 -0700 | [diff] [blame] | 492 | #endif |
jiabin | 9ff780e | 2018-03-19 18:19:52 -0700 | [diff] [blame] | 493 | |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 494 | #if MAJOR_VERSION >= 6 |
| 495 | status_t DeviceHalHidl::addDeviceEffect( |
| 496 | audio_port_handle_t device, sp<EffectHalInterface> effect) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 497 | TIME_CHECK(); |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 498 | if (mDevice == 0) return NO_INIT; |
| 499 | return processReturn("addDeviceEffect", mDevice->addDeviceEffect( |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 500 | static_cast<AudioPortHandle>(device), effect->effectId())); |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 501 | } |
| 502 | #else |
| 503 | status_t DeviceHalHidl::addDeviceEffect( |
| 504 | audio_port_handle_t device __unused, sp<EffectHalInterface> effect __unused) { |
| 505 | return INVALID_OPERATION; |
| 506 | } |
| 507 | #endif |
| 508 | |
| 509 | #if MAJOR_VERSION >= 6 |
| 510 | status_t DeviceHalHidl::removeDeviceEffect( |
| 511 | audio_port_handle_t device, sp<EffectHalInterface> effect) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 512 | TIME_CHECK(); |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 513 | if (mDevice == 0) return NO_INIT; |
| 514 | return processReturn("removeDeviceEffect", mDevice->removeDeviceEffect( |
Mikhail Naganov | 6718c39 | 2022-01-27 22:17:21 +0000 | [diff] [blame] | 515 | static_cast<AudioPortHandle>(device), effect->effectId())); |
Eric Laurent | b82e6b7 | 2019-11-22 17:25:04 -0800 | [diff] [blame] | 516 | } |
| 517 | #else |
| 518 | status_t DeviceHalHidl::removeDeviceEffect( |
| 519 | audio_port_handle_t device __unused, sp<EffectHalInterface> effect __unused) { |
| 520 | return INVALID_OPERATION; |
| 521 | } |
| 522 | #endif |
| 523 | |
Mikhail Naganov | 516d398 | 2022-02-01 23:53:59 +0000 | [diff] [blame] | 524 | status_t DeviceHalHidl::setConnectedState(const struct audio_port_v7 *port, bool connected) { |
Mikhail Naganov | f83b974 | 2023-04-24 13:06:04 -0700 | [diff] [blame^] | 525 | using ::android::hardware::audio::common::COMMON_TYPES_CPP_VERSION::AudioPort; |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 526 | TIME_CHECK(); |
Mikhail Naganov | 516d398 | 2022-02-01 23:53:59 +0000 | [diff] [blame] | 527 | if (mDevice == 0) return NO_INIT; |
| 528 | #if MAJOR_VERSION == 7 && MINOR_VERSION == 1 |
| 529 | if (supportsSetConnectedState7_1) { |
| 530 | AudioPort hidlPort; |
| 531 | if (status_t result = HidlUtils::audioPortFromHal(*port, &hidlPort); result != NO_ERROR) { |
| 532 | return result; |
| 533 | } |
| 534 | Return<Result> ret = mDevice->setConnectedState_7_1(hidlPort, connected); |
| 535 | if (!ret.isOk() || ret != Result::NOT_SUPPORTED) { |
| 536 | return processReturn("setConnectedState_7_1", ret); |
| 537 | } else if (ret == Result::OK) { |
| 538 | return NO_ERROR; |
| 539 | } |
| 540 | supportsSetConnectedState7_1 = false; |
| 541 | } |
| 542 | #endif |
| 543 | DeviceAddress hidlAddress; |
| 544 | if (status_t result = CoreUtils::deviceAddressFromHal( |
| 545 | port->ext.device.type, port->ext.device.address, &hidlAddress); |
| 546 | result != NO_ERROR) { |
| 547 | return result; |
| 548 | } |
| 549 | return processReturn("setConnectedState", mDevice->setConnectedState(hidlAddress, connected)); |
| 550 | } |
| 551 | |
Ytai Ben-Tsvi | 48287b5 | 2021-12-01 15:07:11 -0800 | [diff] [blame] | 552 | error::Result<audio_hw_sync_t> DeviceHalHidl::getHwAvSync() { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 553 | TIME_CHECK(); |
Ytai Ben-Tsvi | 48287b5 | 2021-12-01 15:07:11 -0800 | [diff] [blame] | 554 | if (mDevice == 0) return NO_INIT; |
| 555 | audio_hw_sync_t value; |
| 556 | Result result; |
| 557 | Return<void> ret = mDevice->getHwAvSync([&value, &result](Result r, audio_hw_sync_t v) { |
| 558 | value = v; |
| 559 | result = r; |
| 560 | }); |
| 561 | RETURN_IF_ERROR(processReturn("getHwAvSync", ret, result)); |
| 562 | return value; |
| 563 | } |
| 564 | |
Andy Hung | 61589a4 | 2021-06-16 09:37:53 -0700 | [diff] [blame] | 565 | status_t DeviceHalHidl::dump(int fd, const Vector<String16>& args) { |
Andy Hung | 224f82f | 2022-03-22 00:00:49 -0700 | [diff] [blame] | 566 | TIME_CHECK(); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 567 | if (mDevice == 0) return NO_INIT; |
| 568 | native_handle_t* hidlHandle = native_handle_create(1, 0); |
| 569 | hidlHandle->data[0] = fd; |
Andy Hung | 61589a4 | 2021-06-16 09:37:53 -0700 | [diff] [blame] | 570 | hidl_vec<hidl_string> hidlArgs; |
| 571 | argsFromHal(args, &hidlArgs); |
| 572 | Return<void> ret = mDevice->debug(hidlHandle, hidlArgs); |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 573 | native_handle_delete(hidlHandle); |
Andy Hung | e72ff02 | 2021-08-16 10:16:15 -0700 | [diff] [blame] | 574 | |
| 575 | // TODO(b/111997867, b/177271958) Workaround - remove when fixed. |
| 576 | // A Binder transmitted fd may not close immediately due to a race condition b/111997867 |
| 577 | // when the remote binder thread removes the last refcount to the fd blocks in the |
| 578 | // kernel for binder activity. We send a Binder ping() command to unblock the thread |
| 579 | // and complete the fd close / release. |
| 580 | // |
| 581 | // See DeviceHalHidl::dump(), EffectHalHidl::dump(), StreamHalHidl::dump(), |
| 582 | // EffectsFactoryHalHidl::dumpEffects(). |
| 583 | |
| 584 | (void)mDevice->ping(); // synchronous Binder call |
| 585 | |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 586 | return processReturn("dump", ret); |
| 587 | } |
| 588 | |
Kevin Rocard | 4bcd67f | 2018-02-28 14:33:38 -0800 | [diff] [blame] | 589 | } // namespace android |