blob: 01c2801720e4b754f45dfe7af6d5e93ba627c08f [file] [log] [blame]
Harpreet "Eli" Sangha1f153262018-12-14 12:06:34 +09001/*
2 * Copyright (C) 2018 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
17package android.hardware.vibrator@1.3;
18
19import @1.0::Status;
20import @1.2::IVibrator;
21
22interface IVibrator extends @1.2::IVibrator {
23 /**
24 * Returns whether the vibrator supports control through an alternate interface.
25 */
26 supportsExternalControl() generates (bool supports);
27
28 /**
29 * Enables/disables control override of vibrator to audio.
30 *
31 * When this API is set, the vibrator control should be ceded to audio system
32 * for haptic audio. While this is enabled, issuing of other commands to control
33 * the vibrator is unsupported and the resulting behavior is undefined. Amplitude
34 * control may or may not be supported and is reflected in the return value of
35 * supportsAmplitudeControl() while this is enabled. When this is disabled, the
36 * vibrator should resume to an off state.
37 *
38 * @param enabled Whether external control should be enabled or disabled.
39 * @return status Whether the command was successful or not. Must return
40 * Status::UNSUPPORTED_OPERATION if external control is
41 * not supported by the device.
42 */
43 setExternalControl(bool enabled) generates (Status status);
44};