summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-05-19 12:50:27 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-05-19 12:50:27 +0000
commitc5efbf1dba294e2d684f987077749c730bdd1b23 (patch)
treeb387f48a330a75f568f1cb19087964e47d240766
parentb987babf5eac750c7dcfdbdcc8147b656aa5902b (diff)
parenta8bef3d4842172ec14616772940dcea418ac3e75 (diff)
Merge "Add hasExternalControl hidden API to Vibrator" into sc-dev
-rw-r--r--core/java/android/os/Vibrator.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/os/Vibrator.java b/core/java/android/os/Vibrator.java
index 95962c82a611..12538e6cd46b 100644
--- a/core/java/android/os/Vibrator.java
+++ b/core/java/android/os/Vibrator.java
@@ -227,6 +227,17 @@ public abstract class Vibrator {
}
/**
+ * Check whether the vibrator can be controlled by an external service with the
+ * {@link IExternalVibratorService}.
+ *
+ * @return True if the hardware can be controlled by an external service, otherwise false.
+ * @hide
+ */
+ public boolean hasExternalControl() {
+ return getInfo().hasCapability(IVibrator.CAP_EXTERNAL_CONTROL);
+ }
+
+ /**
* Gets the resonant frequency of the vibrator.
*
* @return the resonant frequency of the vibrator, or {@link Float#NaN NaN} if it's unknown or