Loading core/java/android/os/VibratorInfo.java +3 −4 Original line number Diff line number Diff line Loading @@ -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); } /** Loading Loading @@ -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); } /** Loading core/tests/vibrator/src/android/os/VibratorInfoTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading Loading @@ -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()); } Loading Loading
core/java/android/os/VibratorInfo.java +3 −4 Original line number Diff line number Diff line Loading @@ -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); } /** Loading Loading @@ -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); } /** Loading
core/tests/vibrator/src/android/os/VibratorInfoTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading Loading @@ -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()); } Loading