/*
 * 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.2;

import @1.0::EffectStrength;
import @1.0::Status;
import @1.1::IVibrator;

interface IVibrator extends @1.1::IVibrator {
  /**
   * 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 is 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_2(Effect effect, EffectStrength strength)
          generates (Status status, uint32_t lengthMs);
};
