blob: 1c870ee4cdb091a468c0c4ba7a9a1697c303612d [file] [log] [blame]
/*
* Copyright (C) 2018 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.vibrator@1.3;
import @1.0::EffectStrength;
import @1.0::Status;
import @1.2::IVibrator;
interface IVibrator extends @1.2::IVibrator {
/**
* Returns whether the vibrator supports control through an alternate interface.
*/
supportsExternalControl() generates (bool supports);
/**
* Enables/disables control override of vibrator to audio.
*
* When this API is set, the vibrator control should be ceded to audio system
* for haptic audio. While this is enabled, issuing of other commands to control
* the vibrator is unsupported and the resulting behavior is undefined. Amplitude
* control may or may not be supported and is reflected in the return value of
* supportsAmplitudeControl() while this is enabled. When this is disabled, the
* vibrator should resume to an off state.
*
* @param enabled Whether external control should be enabled or disabled.
* @return status Whether the command was successful or not. Must return
* Status::UNSUPPORTED_OPERATION if external control is
* not supported by the device.
*/
setExternalControl(bool enabled) generates (Status status);
/**
* Fire off a predefined haptic event.
*
* @param event The type of haptic event to trigger.
* @return status Whether the effect was successfully performed or not. Must
* return Status::UNSUPPORTED_OPERATION if the effect is not supported.
* @return lengthMs The length of time the event is expected to take in
* milliseconds. This doesn't need to be perfectly accurate, but should be a reasonable
* approximation. Should be a positive, non-zero value if the returned status is Status::OK,
* and set to 0 otherwise.
*/
perform_1_3(Effect effect, EffectStrength strength)
generates (Status status, uint32_t lengthMs);
};