diff options
| -rw-r--r-- | core/java/android/os/VibratorInfo.java | 7 | ||||
| -rw-r--r-- | core/tests/vibrator/src/android/os/VibratorInfoTest.java | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/core/java/android/os/VibratorInfo.java b/core/java/android/os/VibratorInfo.java index 9419032c46f8..9dec8673f019 100644 --- a/core/java/android/os/VibratorInfo.java +++ b/core/java/android/os/VibratorInfo.java @@ -316,9 +316,7 @@ public class VibratorInfo implements Parcelable { * @return True if the hardware can control the frequency of the vibrations, otherwise false. */ public boolean hasFrequencyControl() { - // We currently can only control frequency of the vibration using the compose PWLE method. - return hasCapability( - IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS); + return hasCapability(IVibrator.CAP_FREQUENCY_CONTROL); } /** @@ -481,7 +479,8 @@ public class VibratorInfo implements Parcelable { * @return True if the hardware supports creating envelope effects, false otherwise. */ public boolean areEnvelopeEffectsSupported() { - return hasCapability(IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2); + return hasCapability( + IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2); } /** diff --git a/core/tests/vibrator/src/android/os/VibratorInfoTest.java b/core/tests/vibrator/src/android/os/VibratorInfoTest.java index 04945f38e319..9099918edb02 100644 --- a/core/tests/vibrator/src/android/os/VibratorInfoTest.java +++ b/core/tests/vibrator/src/android/os/VibratorInfoTest.java @@ -71,8 +71,7 @@ public class VibratorInfoTest { VibratorInfo noCapabilities = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build(); assertFalse(noCapabilities.hasFrequencyControl()); VibratorInfo composeAndFrequencyControl = new VibratorInfo.Builder(TEST_VIBRATOR_ID) - .setCapabilities( - IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS) + .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL) .build(); assertTrue(composeAndFrequencyControl.hasFrequencyControl()); } @@ -153,7 +152,8 @@ public class VibratorInfoTest { VibratorInfo noCapabilities = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build(); assertFalse(noCapabilities.areEnvelopeEffectsSupported()); VibratorInfo envelopeEffectCapability = new VibratorInfo.Builder(TEST_VIBRATOR_ID) - .setCapabilities(IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2) + .setCapabilities( + IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS_V2) .build(); assertTrue(envelopeEffectCapability.areEnvelopeEffectsSupported()); } |