Home
last modified time | relevance | path

Searched refs:RampSegment (Results 1 – 23 of 23) sorted by relevance

/frameworks/base/core/tests/vibrator/src/android/os/vibrator/
DRampSegmentTest.java43 RampSegment ramp = new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 0, in testCreation()
55 RampSegment original = new RampSegment(0, 1, 10, 20.5f, 10); in testSerialization()
59 assertEquals(original, RampSegment.CREATOR.createFromParcel(parcel)); in testSerialization()
64 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 0, in testValidate()
67 new RampSegment(0, 0, 0, 0, 0).validate(); in testValidate()
70 () -> new RampSegment(DEFAULT_AMPLITUDE, 0, 0, 0, 0).validate()); in testValidate()
72 () -> new RampSegment(/* startAmplitude= */ -2, 0, 0, 0, 0).validate()); in testValidate()
74 () -> new RampSegment(0, /* endAmplitude= */ 2, 0, 0, 0).validate()); in testValidate()
76 () -> new RampSegment(0, 0, /* startFrequencyHz= */ -1, 0, 0).validate()); in testValidate()
78 () -> new RampSegment(0, 0, 0, /* endFrequencyHz= */ -3, 0).validate()); in testValidate()
[all …]
/frameworks/base/services/tests/vibrator/src/com/android/server/vibrator/
DRampDownAdapterTest.java25 import android.os.vibrator.RampSegment;
66 new RampSegment(/* startAmplitude= */ 0.8f, /* endAmplitude= */ 0.2f, in testRampAndStepSegments_withNoOffSegment_keepsListUnchanged()
83 new RampSegment(/* startAmplitude= */ 0.8f, /* endAmplitude= */ 0.2f, in testRampAndStepSegments_withNoRampDownDuration_keepsOriginalSteps()
85 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 0, in testRampAndStepSegments_withNoRampDownDuration_keepsOriginalSteps()
112 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 0, in testStepSegments_withLongZeroSegment_replaceWithStepsDownWithRemainingOffSegment()
202 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 0, in testStepSegments_withRepeatToShortZeroSegment_skipAndAppendRampDown()
206 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 0, in testStepSegments_withRepeatToShortZeroSegment_skipAndAppendRampDown()
242 new RampSegment(/* startAmplitude= */ 0.5f, /* endAmplitude*/ 0.5f, in testRampSegments_withShortZeroSegment_replaceWithRampDown()
244 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 0, in testRampSegments_withShortZeroSegment_replaceWithRampDown()
246 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 1, in testRampSegments_withShortZeroSegment_replaceWithRampDown()
[all …]
DDeviceAdapterTest.java32 import android.os.vibrator.RampSegment;
112 new RampSegment(1, 0.2f, 1, 300, 10), in testStepAndRampSegments_withoutPwleCapability_convertsRampsToSteps()
113 new RampSegment(0.8f, 0.2f, 0, 0, 100), in testStepAndRampSegments_withoutPwleCapability_convertsRampsToSteps()
114 new RampSegment(0.65f, 0.65f, 0, 1, 1000)), in testStepAndRampSegments_withoutPwleCapability_convertsRampsToSteps()
134 new RampSegment(1, 1, 50, 200, 50), in testStepAndRampSegments_withPwleCapability_convertsStepsToRamps()
135 new RampSegment(0.8f, 0.2f, 1000, 1, 20)), in testStepAndRampSegments_withPwleCapability_convertsStepsToRamps()
140 new RampSegment(0, 0, 175, 175, 10), in testStepAndRampSegments_withPwleCapability_convertsStepsToRamps()
141 new RampSegment(0.5f, 0.5f, 150, 150, 60), in testStepAndRampSegments_withPwleCapability_convertsStepsToRamps()
142 new RampSegment(0.08f, 0.64f, 50, 200, 50), in testStepAndRampSegments_withPwleCapability_convertsStepsToRamps()
143 new RampSegment(0.64f, 0.08f, 200, 50, 20)), in testStepAndRampSegments_withPwleCapability_convertsStepsToRamps()
[all …]
DStepToRampAdapterTest.java26 import android.os.vibrator.RampSegment;
59 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 0.2f, in testRampAndPrebakedAndPrimitiveSegments_returnsOriginalSegments()
79 new RampSegment(/* startAmplitude= */ 0.8f, /* endAmplitude= */ 0.2f, in testStepAndRampSegments_withoutPwleCapability_keepsListUnchanged()
95 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 1, in testStepAndRampSegments_withPwleCapabilityAndNoFrequency_keepsOriginalSteps()
97 new RampSegment(/* startAmplitude= */ 0.8f, /* endAmplitude= */ 0.2f, in testStepAndRampSegments_withPwleCapabilityAndNoFrequency_keepsOriginalSteps()
112 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 1, in testStepAndRampSegments_withPwleCapabilityAndStepNextToRamp_convertsStepsToRamps()
114 new RampSegment(/* startAmplitude= */ 0.8f, /* endAmplitude= */ 0.2f, in testStepAndRampSegments_withPwleCapabilityAndStepNextToRamp_convertsStepsToRamps()
119 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude*/ 0, in testStepAndRampSegments_withPwleCapabilityAndStepNextToRamp_convertsStepsToRamps()
121 new RampSegment(/* startAmplitude= */ 0.5f, /* endAmplitude= */ 0.5f, in testStepAndRampSegments_withPwleCapabilityAndStepNextToRamp_convertsStepsToRamps()
123 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 1, in testStepAndRampSegments_withPwleCapabilityAndStepNextToRamp_convertsStepsToRamps()
[all …]
DSplitSegmentsAdapterTest.java26 import android.os.vibrator.RampSegment;
85 new RampSegment(/* startAmplitude= */ 0.5f, /* endAmplitude*/ 0.5f, in testRampSegments_noPwleCapabilities_returnsOriginalSegments()
87 new RampSegment(/* startAmplitude= */ 0.2f, /* endAmplitude*/ 0.8f, in testRampSegments_noPwleCapabilities_returnsOriginalSegments()
103 new RampSegment(/* startAmplitude= */ 0.5f, /* endAmplitude*/ 0.5f, in testRampSegments_withPwleDurationLimit_splitsLongRampsAndPreserveOtherSegments()
105 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 1, in testRampSegments_withPwleDurationLimit_splitsLongRampsAndPreserveOtherSegments()
108 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude*/ 1, in testRampSegments_withPwleDurationLimit_splitsLongRampsAndPreserveOtherSegments()
112 new RampSegment(/* startAmplitude= */ 0.5f, /* endAmplitude*/ 0.5f, in testRampSegments_withPwleDurationLimit_splitsLongRampsAndPreserveOtherSegments()
114 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 0.32f, in testRampSegments_withPwleDurationLimit_splitsLongRampsAndPreserveOtherSegments()
116 new RampSegment(/* startAmplitude= */ 0.32f, /* endAmplitude= */ 0.64f, in testRampSegments_withPwleDurationLimit_splitsLongRampsAndPreserveOtherSegments()
119 new RampSegment(/* startAmplitude= */ 0.64f, /* endAmplitude= */ 1, in testRampSegments_withPwleDurationLimit_splitsLongRampsAndPreserveOtherSegments()
[all …]
DRampToStepAdapterTest.java26 import android.os.vibrator.RampSegment;
79 new RampSegment(/* startAmplitude= */ 0.8f, /* endAmplitude= */ 0.2f, in testRampSegments_withPwleCapability_keepsListUnchanged()
94 new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 0.2f, in testRampSegments_withoutPwleCapability_convertsRampsToSteps()
96 new RampSegment(/* startAmplitude= */ 0.8f, /* endAmplitude= */ 0.2f, in testRampSegments_withoutPwleCapability_convertsRampsToSteps()
98 new RampSegment(/* startAmplitude= */ 0.65f, /* endAmplitude= */ 0.65f, in testRampSegments_withoutPwleCapability_convertsRampsToSteps()
DVibratorControllerTest.java47 import android.os.vibrator.RampSegment;
228 RampSegment[] primitives = new RampSegment[]{ in on_withComposedPwle_performsEffect()
229 new RampSegment(/* startAmplitude= */ 0, /* endAmplitude= */ 1, in on_withComposedPwle_performsEffect()
DVibrationThreadTest.java61 import android.os.vibrator.RampSegment;
1863 return new RampSegment(startAmplitude, endAmplitude, startFrequencyHz, endFrequencyHz, in expectedRamp()
/frameworks/base/core/java/android/os/vibrator/
DRampSegment.java42 public final class RampSegment extends VibrationEffectSegment { class
49 RampSegment(@NonNull Parcel in) { in RampSegment() method in RampSegment
54 public RampSegment(float startAmplitude, float endAmplitude, float startFrequencyHz, in RampSegment() method in RampSegment
65 if (!(o instanceof RampSegment)) { in equals()
68 RampSegment other = (RampSegment) o; in equals()
139 public RampSegment resolve(int defaultAmplitude) { in resolve()
147 public RampSegment scale(float scaleFactor) { in scale()
154 return new RampSegment(newStartAmplitude, newEndAmplitude, mStartFrequencyHz, in scale()
162 public RampSegment scaleLinearly(float scaleFactor) { in scaleLinearly()
169 return new RampSegment(newStartAmplitude, newEndAmplitude, mStartFrequencyHz, in scaleLinearly()
[all …]
DVibrationEffectSegment.java207 return new RampSegment(in);
/frameworks/base/services/core/java/com/android/server/vibrator/
DRampDownAdapter.java20 import android.os.vibrator.RampSegment;
97 } else if (previousSegment instanceof RampSegment) { in addRampDownToZeroAmplitudeSegments()
98 float previousAmplitude = ((RampSegment) previousSegment).getEndAmplitude(); in addRampDownToZeroAmplitudeSegments()
99 float previousFrequency = ((RampSegment) previousSegment).getEndFrequencyHz(); in addRampDownToZeroAmplitudeSegments()
183 } else if (lastSegment instanceof RampSegment) { in addRampDownToLoop()
184 float previousAmplitude = ((RampSegment) lastSegment).getEndAmplitude(); in addRampDownToLoop()
185 float previousFrequency = ((RampSegment) lastSegment).getEndFrequencyHz(); in addRampDownToLoop()
207 private static RampSegment createRampDown(float amplitude, float frequency, long duration) { in createRampDown()
208 return new RampSegment(amplitude, /* endAmplitude= */ 0, frequency, frequency, in createRampDown()
214 if (segment instanceof RampSegment) { in updateDuration()
[all …]
DComposePwleVibratorStep.java21 import android.os.vibrator.RampSegment;
57 List<RampSegment> pwles = unrollRampSegments(effect, segmentIndex, in play()
71 RampSegment[] pwlesArray = pwles.toArray(new RampSegment[pwles.size()]); in play()
97 private List<RampSegment> unrollRampSegments(VibrationEffect.Composed effect, int startIndex, in unrollRampSegments()
99 List<RampSegment> segments = new ArrayList<>(limit); in unrollRampSegments()
118 if (segment instanceof RampSegment) { in unrollRampSegments()
119 RampSegment rampSegment = (RampSegment) segment; in unrollRampSegments()
144 private boolean isBetterBreakPosition(List<RampSegment> segments, in isBetterBreakPosition()
146 RampSegment lastSegment = segments.get(segments.size() - 1); in isBetterBreakPosition()
DSplitSegmentsAdapter.java21 import android.os.vibrator.RampSegment;
55 if (!(segments.get(i) instanceof RampSegment)) { in adaptToVibrator()
58 RampSegment ramp = (RampSegment) segments.get(i); in adaptToVibrator()
76 private static List<RampSegment> splitRampSegment(VibratorInfo info, RampSegment ramp, in splitRampSegment()
78 List<RampSegment> ramps = new ArrayList<>(splits); in splitRampSegment()
94 RampSegment rampSplit = new RampSegment( in splitRampSegment()
103 ramps.add(new RampSegment(previousAmplitude, ramp.getEndAmplitude(), previousFrequencyHz, in splitRampSegment()
DClippingAmplitudeAndFrequencyAdapter.java20 import android.os.vibrator.RampSegment;
43 if (segment instanceof RampSegment) { in adaptToVibrator()
44 segments.set(i, adaptToVibrator(info, (RampSegment) segment)); in adaptToVibrator()
50 private RampSegment adaptToVibrator(VibratorInfo info, RampSegment segment) { in adaptToVibrator()
53 return new RampSegment( in adaptToVibrator()
DStepToRampAdapter.java21 import android.os.vibrator.RampSegment;
56 if (segments.get(i) instanceof RampSegment) { in adaptToVibrator()
68 private static RampSegment convertStepToRamp(VibratorInfo info, StepSegment segment) { in convertStepToRamp()
70 return new RampSegment(segment.getAmplitude(), segment.getAmplitude(), in convertStepToRamp()
DRampToStepAdapter.java21 import android.os.vibrator.RampSegment;
55 if (!(segment instanceof RampSegment)) { in adaptToVibrator()
58 List<StepSegment> steps = convertRampToSteps(info, (RampSegment) segment); in adaptToVibrator()
71 private List<StepSegment> convertRampToSteps(VibratorInfo info, RampSegment ramp) { in convertRampToSteps()
DVibratorController.java28 import android.os.vibrator.RampSegment;
316 public long on(RampSegment[] primitives, long vibrationId) { in on()
433 private static native long performPwleEffect(long nativePtr, RampSegment[] effect, in performPwleEffect()
491 public long composePwle(RampSegment[] primitives, int braking, long vibrationId) { in composePwle()
DVibrationStats.java24 import android.os.vibrator.RampSegment;
266 void reportComposePwle(long halResult, RampSegment[] segments) { in reportComposePwle()
273 for (RampSegment ramp : segments) { in reportComposePwle()
DVibration.java28 import android.os.vibrator.RampSegment;
414 } else if (segment instanceof RampSegment) { in dumpEffect()
415 dumpEffect(proto, SegmentProto.RAMP, (RampSegment) segment); in dumpEffect()
432 private void dumpEffect(ProtoOutputStream proto, long fieldId, RampSegment segment) { in dumpEffect()
DVibrationStepConductor.java29 import android.os.vibrator.RampSegment;
148 if (segment instanceof RampSegment) { in nextVibrateStep()
/frameworks/base/services/tests/vibrator/utils/com/android/server/vibrator/
DFakeVibratorControllerProvider.java26 import android.os.vibrator.RampSegment;
153 public long composePwle(RampSegment[] primitives, int braking, long vibrationId) { in composePwle()
155 for (RampSegment primitive : primitives) { in composePwle()
/frameworks/base/core/java/android/os/
DVibrationEffect.java33 import android.os.vibrator.RampSegment;
1559 mSegments.add(new RampSegment(mLastAmplitude, targetAmplitude, in addTransitionSegment()
/frameworks/base/core/api/
Dtest-current.txt2724 public final class RampSegment extends android.os.vibrator.VibrationEffectSegment {
2732 …NonNull public static final android.os.Parcelable.Creator<android.os.vibrator.RampSegment> CREATOR;