1/* 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.2; 18 19import @1.0::EffectStrength; 20import @1.0::Status; 21import @1.1::IVibrator; 22 23interface IVibrator extends @1.1::IVibrator { 24 /** 25 * Fire off a predefined haptic event. 26 * 27 * @param event The type of haptic event to trigger. 28 * @return status Whether the effect was successfully performed or not. Must 29 * return Status::UNSUPPORTED_OPERATION is the effect is not supported. 30 * @return lengthMs The length of time the event is expected to take in 31 * milliseconds. This doesn't need to be perfectly accurate, but should be a reasonable 32 * approximation. Should be a positive, non-zero value if the returned status is Status::OK, 33 * and set to 0 otherwise. 34 */ 35 perform_1_2(Effect effect, EffectStrength strength) 36 generates (Status status, uint32_t lengthMs); 37}; 38