diff options
| author | Scott Randolph <randolphs@google.com> | 2018-02-06 09:34:40 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-02-06 09:34:40 +0000 |
| commit | d17343bdbdd665f2dab4b33ab589c3ef977f9af0 (patch) | |
| tree | 439561881b4c4c4d7049861a8ba39e22f6df73fd /automotive/audiocontrol | |
| parent | b8d6acac7e121815c535168f29f64f5fc028ec70 (diff) | |
| parent | 786879b1390d83e586dcf28978c0516e5813c2ab (diff) | |
| download | android_hardware_interfaces-d17343bdbdd665f2dab4b33ab589c3ef977f9af0.tar.gz android_hardware_interfaces-d17343bdbdd665f2dab4b33ab589c3ef977f9af0.tar.bz2 android_hardware_interfaces-d17343bdbdd665f2dab4b33ab589c3ef977f9af0.zip | |
Merge "Remove IAudioControlCallback for P"
Diffstat (limited to 'automotive/audiocontrol')
| -rw-r--r-- | automotive/audiocontrol/1.0/Android.bp | 2 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/IAudioControl.hal | 11 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/IAudioControlCallback.hal | 57 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/default/Android.bp | 1 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/default/AudioControl.cpp | 9 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/default/AudioControl.h | 4 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/default/AudioControlCallback.cpp | 31 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/default/AudioControlCallback.h | 41 | ||||
| -rw-r--r-- | automotive/audiocontrol/1.0/types.hal | 9 |
9 files changed, 0 insertions, 165 deletions
diff --git a/automotive/audiocontrol/1.0/Android.bp b/automotive/audiocontrol/1.0/Android.bp index a9670492c..9335a6c46 100644 --- a/automotive/audiocontrol/1.0/Android.bp +++ b/automotive/audiocontrol/1.0/Android.bp @@ -9,13 +9,11 @@ hidl_interface { srcs: [ "types.hal", "IAudioControl.hal", - "IAudioControlCallback.hal", ], interfaces: [ "android.hidl.base@1.0", ], types: [ - "AudioResult", "ContextNumber", ], gen_java: true, diff --git a/automotive/audiocontrol/1.0/IAudioControl.hal b/automotive/audiocontrol/1.0/IAudioControl.hal index fe9ea8e93..c02949962 100644 --- a/automotive/audiocontrol/1.0/IAudioControl.hal +++ b/automotive/audiocontrol/1.0/IAudioControl.hal @@ -16,8 +16,6 @@ package android.hardware.automotive.audiocontrol@1.0; -import IAudioControlCallback; - /** * Interacts with the car's audio subsystem to manage audio sources and volumes @@ -25,15 +23,6 @@ import IAudioControlCallback; interface IAudioControl { /** - * Registers the required callback object so that we can be notified when the state - * of the car's audio system changes. This call must be made when the interface is - * initialized. - */ - setCallback(IAudioControlCallback notificationObject) - generates (AudioResult result); - - - /** * Called at startup once per context to get the mapping from ContextNumber to * busAddress. This lets the car tell the framework to which physical output stream * each context should be routed. diff --git a/automotive/audiocontrol/1.0/IAudioControlCallback.hal b/automotive/audiocontrol/1.0/IAudioControlCallback.hal deleted file mode 100644 index f5c227e20..000000000 --- a/automotive/audiocontrol/1.0/IAudioControlCallback.hal +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2017 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. - */ - -package android.hardware.automotive.audiocontrol@1.0; - - -/** - * Implemented on client (framework) side to receive asynchronous updates from the car. - */ -interface IAudioControlCallback { - - /** - * When the HAL makes this call, any apps currently playing must be asked to - * temporarily suspend playback (via an AudioManager::AUDIOFOCUS_LOSS_TRANSIENT event). - * - * This is only a suggestion. Apps may be slow to react or even ignore this message - * entirely. Enforcement, if necessary, must be done at the AudioHAL level as the - * samples are delivered. In most instances, this is the way a car should ask for - * quiet if it needs it for some important situation, such as warning alarms or chimes. - */ - oneway suggestPausePlayers(); - - - /** - * When the HAL makes this case, any apps currently playing must be asked to stop - * playing (via an AudioManager::AUDIOFOCUS_LOSS event). Once stopped, the apps must - * not resume their playback. - * - * It should be noted that not all apps or sound sources honor this request, but this - * at least gives an app the chance to do the right thing. - * Because it premanently stops media, this call is expected to be used only rarely. - * Perhaps in the event of an E-call, where resuming music might be undesirable assuming - * the driver is now dealing with whatever the emergency is? - */ - oneway suggestStopPlayers(); - - - /** - * Receives calls from the HAL when Android should resume normal operations. If the previous - * action was a requestPausePlayers, then things that were paused must be told they may - * resume. - */ - oneway resumePlayers(); -}; diff --git a/automotive/audiocontrol/1.0/default/Android.bp b/automotive/audiocontrol/1.0/default/Android.bp index 614c58b0e..0e074dd86 100644 --- a/automotive/audiocontrol/1.0/default/Android.bp +++ b/automotive/audiocontrol/1.0/default/Android.bp @@ -19,7 +19,6 @@ cc_binary { relative_install_path: "hw", srcs: [ "AudioControl.cpp", - "AudioControlCallback.cpp", "service.cpp" ], init_rc: ["android.hardware.automotive.audiocontrol@1.0-service.rc"], diff --git a/automotive/audiocontrol/1.0/default/AudioControl.cpp b/automotive/audiocontrol/1.0/default/AudioControl.cpp index 419225d20..b40f2ae7b 100644 --- a/automotive/audiocontrol/1.0/default/AudioControl.cpp +++ b/automotive/audiocontrol/1.0/default/AudioControl.cpp @@ -36,15 +36,6 @@ AudioControl::AudioControl() { }; -// Methods from ::android::hardware::automotive::audiocontrol::V1_0::IAudioControl follow. -Return<AudioResult> AudioControl::setCallback(const sp<IAudioControlCallback>& notificationObject) { - // Hang onto the provided callback object for future use - callback = notificationObject; - - return AudioResult::OK; -} - - Return<int32_t> AudioControl::getBusForContext(uint32_t contextNumber) { if (contextNumber > sContextNumberMax) { ALOGE("Unexpected context number %d (max expected is %d)", contextNumber, sContextCount); diff --git a/automotive/audiocontrol/1.0/default/AudioControl.h b/automotive/audiocontrol/1.0/default/AudioControl.h index 33838755d..89e41f9d0 100644 --- a/automotive/audiocontrol/1.0/default/AudioControl.h +++ b/automotive/audiocontrol/1.0/default/AudioControl.h @@ -23,16 +23,12 @@ using ::android::sp; struct AudioControl : public IAudioControl { public: // Methods from ::android::hardware::automotive::audiocontrol::V1_0::IAudioControl follow. - Return<AudioResult> setCallback(const sp<IAudioControlCallback>& notificationObject) override; Return<int32_t> getBusForContext(uint32_t contextNumber) override; Return<void> setBalanceTowardRight(float value) override; Return<void> setFadeTowardFront(float value) override; // Implementation details AudioControl(); - -private: - sp<IAudioControlCallback> callback; }; } // namespace implementation diff --git a/automotive/audiocontrol/1.0/default/AudioControlCallback.cpp b/automotive/audiocontrol/1.0/default/AudioControlCallback.cpp deleted file mode 100644 index ea79cada0..000000000 --- a/automotive/audiocontrol/1.0/default/AudioControlCallback.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "AudioControlCallback.h" - -namespace android { -namespace hardware { -namespace automotive { -namespace audiocontrol { -namespace V1_0 { -namespace implementation { - -// Methods from ::android::hardware::automotive::audiocontrol::V1_0::IAudioControlCallback follow. -Return<void> AudioControlCallback::suggestPausePlayers() { - // TODO implement in framework (this is called by the HAL implementation when needed) - return Void(); -} - -Return<void> AudioControlCallback::suggestStopPlayers() { - // TODO implement in framework (this is called by the HAL implementation when needed) - return Void(); -} - -Return<void> AudioControlCallback::resumePlayers() { - // TODO implement in framework (this is called by the HAL implementation when needed) - return Void(); -} - -} // namespace implementation -} // namespace V1_0 -} // namespace audiocontrol -} // namespace automotive -} // namespace hardware -} // namespace android diff --git a/automotive/audiocontrol/1.0/default/AudioControlCallback.h b/automotive/audiocontrol/1.0/default/AudioControlCallback.h deleted file mode 100644 index 10545485e..000000000 --- a/automotive/audiocontrol/1.0/default/AudioControlCallback.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ANDROID_HARDWARE_AUTOMOTIVE_AUDIOCONTROL_V1_0_AUDIOCONTROLCALLBACK_H -#define ANDROID_HARDWARE_AUTOMOTIVE_AUDIOCONTROL_V1_0_AUDIOCONTROLCALLBACK_H - -#include <android/hardware/automotive/audiocontrol/1.0/IAudioControlCallback.h> -#include <hidl/MQDescriptor.h> -#include <hidl/Status.h> - -namespace android { -namespace hardware { -namespace automotive { -namespace audiocontrol { -namespace V1_0 { -namespace implementation { - -using ::android::hardware::hidl_array; -using ::android::hardware::hidl_memory; -using ::android::hardware::hidl_string; -using ::android::hardware::hidl_vec; -using ::android::hardware::Return; -using ::android::hardware::Void; -using ::android::sp; - -// TODO: Move this into packages/services/Car... -struct AudioControlCallback : public IAudioControlCallback { - // Methods from ::android::hardware::automotive::audiocontrol::V1_0::IAudioControlCallback follow. - Return<void> suggestPausePlayers() override; - Return<void> suggestStopPlayers() override; - Return<void> resumePlayers() override; - - // Methods from ::android::hidl::base::V1_0::IBase follow. - -}; - -} // namespace implementation -} // namespace V1_0 -} // namespace audiocontrol -} // namespace automotive -} // namespace hardware -} // namespace android - -#endif // ANDROID_HARDWARE_AUTOMOTIVE_AUDIOCONTROL_V1_0_AUDIOCONTROLCALLBACK_H diff --git a/automotive/audiocontrol/1.0/types.hal b/automotive/audiocontrol/1.0/types.hal index 6301d3a4e..04d8d358c 100644 --- a/automotive/audiocontrol/1.0/types.hal +++ b/automotive/audiocontrol/1.0/types.hal @@ -33,12 +33,3 @@ enum ContextNumber : uint32_t { NOTIFICATION, /* Notifications */ SYSTEM_SOUND, /* User interaction sounds (button clicks, etc) */ }; - - -/** Error codes used in AudioControl HAL interface. */ -enum AudioResult : uint32_t { - OK = 0, - NOT_AVAILABLE, - INVALID_ARGUMENT, - UNDERLYING_SERVICE_ERROR, -}; |
