| callback | AsyncCallback<void> | Yes | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. If the vibration starts, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
**Error codes**
For details about the error codes, see [Vibrator Error Codes](../errorcodes/errorcode-vibrator.md).
For details about the error codes, see [Vibrator Error Codes](../errorcodes/errorcode-vibrator.md).
Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
Stops vibration in the specified mode. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.VIBRATE
**Required permissions**: ohos.permission.VIBRATE
...
@@ -127,21 +127,41 @@ Stops the vibration with the specified **stopMode**. This API uses a promise to
...
@@ -127,21 +127,41 @@ Stops the vibration with the specified **stopMode**. This API uses a promise to
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration. |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration. |
| callback | AsyncCallback<void> | Yes | Callback used to the result. If the vibration stops, **err** is **undefined**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. If the vibration stops, **err** is **undefined**; otherwise, **err** is an error object.|
Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
Stops vibration in the specified mode. This API uses a promise to return the result.
**Required permissions**: ohos.permission.VIBRATE
**Required permissions**: ohos.permission.VIBRATE
...
@@ -171,25 +191,43 @@ Stops the vibration with the specified **stopMode**. This API uses a promise to
...
@@ -171,25 +191,43 @@ Stops the vibration with the specified **stopMode**. This API uses a promise to
| VIBRATOR_STOP_MODE_TIME | "time" | The vibration to stop is in **duration** mode. This vibration is triggered with the parameter **duration** of the **number** type.|
| VIBRATOR_STOP_MODE_TIME | "time" | The vibration to stop is in **duration** mode.|
| VIBRATOR_STOP_MODE_PRESET | "preset" | The vibration to stop is in **EffectId** mode. This vibration is triggered with the parameter **effectId** of the **EffectId** type.|
| VIBRATOR_STOP_MODE_PRESET | "preset" | The vibration to stop is in **EffectId** mode.|
## VibrateEffect<sup>9+</sup>
## VibrateEffect<sup>9+</sup>
...
@@ -220,7 +258,7 @@ Describes the vibration with the specified duration.
...
@@ -220,7 +258,7 @@ Describes the vibration with the specified duration.
| duration | number | Yes | Vibration duration, in ms. |
| duration | number | Yes | Vibration duration, in ms. |
| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | No | Callback used to return the result. If the vibration starts, **err** is **undefined**; otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration starts, **err** is **undefined**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | No | Callback used to return the result. If the vibration starts, **err** is **undefined**; otherwise, **err** is an error object.|
Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
Stops vibration in the specified mode. This API uses a promise to return the result.
This API is deprecated since API version 9. You are advised to use [vibrator.stopVibration](#vibratorstopvibration9-1) instead.
This API is deprecated since API version 9. You are advised to use [vibrator.stopVibration](#vibratorstopvibration9-1) instead.
...
@@ -425,9 +463,18 @@ This API is deprecated since API version 9. You are advised to use [vibrator.sto
...
@@ -425,9 +463,18 @@ This API is deprecated since API version 9. You are advised to use [vibrator.sto
Stops the vibration with the specified **stopMode**. This API uses a promise to return the result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
Stops vibration in the specified mode. This API uses an asynchronous callback to return the result.
This API is deprecated since API version 9. You are advised to use [vibrator.stopVibration](#vibratorstopvibration9) instead.
This API is deprecated since API version 9. You are advised to use [vibrator.stopVibration](#vibratorstopvibration9) instead.
...
@@ -450,15 +497,24 @@ This API is deprecated since API version 9. You are advised to use [vibrator.sto
...
@@ -450,15 +497,24 @@ This API is deprecated since API version 9. You are advised to use [vibrator.sto
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration. |
| stopMode | [VibratorStopMode](#vibratorstopmode) | Yes | Mode to stop the vibration. |
| callback | AsyncCallback<void> | No | Callback used to the result. If the vibration stops, **err** is **undefined**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | No | Callback used to return the result. If the vibration stops, **err** is **undefined**; otherwise, **err** is an error object.|