Home
last modified time | relevance | path

Searched refs:segments (Results 1 – 25 of 28) sorted by relevance

12

/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/vibrator/
H A DRampDownAdapterTest.java67 assertEquals(originalSegments, segments); in testPrebakedAndPrimitiveSegments_keepsListUnchanged()
81 assertEquals(originalSegments, segments); in testRampAndStepSegments_withNoOffSegment_keepsListUnchanged()
99 assertEquals(originalSegments, segments); in testRampAndStepSegments_withNoRampDownDuration_keepsOriginalSteps()
113 assertEquals(expectedSegments, segments); in testStepSegments_withShortZeroSegment_replaceWithStepsDown()
132 assertEquals(expectedSegments, segments); in testStepSegments_withLongZeroSegment_replaceWithStepsDownWithRemainingOffSegment()
151 assertEquals(expectedSegments, segments); in testStepSegments_withZeroSegmentBeforeRepeat_fixesRepeat()
167 assertEquals(expectedSegments, segments); in testStepSegments_withZeroSegmentAfterRepeat_preservesRepeat()
192 assertEquals(expectedSegments, segments); in testStepSegments_withZeroSegmentAtRepeat_fixesRepeatAndAppendOriginalToListEnd()
204 assertEquals(originalSegments, segments); in testStepSegments_withRepeatToNonZeroSegment_keepsOriginalSteps()
223 assertEquals(expectedSegments, segments); in testStepSegments_withRepeatToShortZeroSegment_skipAndAppendRampDown()
[all …]
H A DStepToRampAdapterTest.java74 assertEquals(originalSegments, segments); in testRampAndPrebakedAndPrimitiveSegments_returnsOriginalSegments()
106 assertEquals(4, mAdapter.apply(segments, 2, vibratorInfo)); in testRampSegments_withPwleDurationLimit_splitsLongRamps()
107 assertEquals(expectedSegments, segments); in testRampSegments_withPwleDurationLimit_splitsLongRamps()
121 assertEquals(originalSegments, segments); in testStepAndRampSegments_withoutPwleCapability_keepsListUnchanged()
137 assertEquals(-1, mAdapter.apply(segments, -1, vibratorInfo)); in testStepAndRampSegments_withPwleCapabilityAndNoFrequency_keepsOriginalSteps()
138 assertEquals(3, mAdapter.apply(segments, 3, vibratorInfo)); in testStepAndRampSegments_withPwleCapabilityAndNoFrequency_keepsOriginalSteps()
140 assertEquals(originalSegments, segments); in testStepAndRampSegments_withPwleCapabilityAndNoFrequency_keepsOriginalSteps()
168 assertEquals(2, mAdapter.apply(segments, 2, vibratorInfo)); in testStepAndRampSegments_withPwleCapabilityAndStepNextToRamp_convertsStepsToRamps()
170 assertEquals(expectedSegments, segments); in testStepAndRampSegments_withPwleCapabilityAndStepNextToRamp_convertsStepsToRamps()
186 assertEquals(0, mAdapter.apply(segments, 0, vibratorInfo)); in testStepSegments_withPwleCapabilityAndFrequency_convertsStepsToRamps()
[all …]
H A DRampToStepAdapterTest.java64 List<VibrationEffectSegment> segments = new ArrayList<>(Arrays.asList( in testStepAndPrebakedAndPrimitiveSegments_keepsListUnchanged() local
71 assertEquals(-1, mAdapter.apply(segments, -1, createVibratorInfo())); in testStepAndPrebakedAndPrimitiveSegments_keepsListUnchanged()
72 assertEquals(1, mAdapter.apply(segments, 1, createVibratorInfo())); in testStepAndPrebakedAndPrimitiveSegments_keepsListUnchanged()
74 assertEquals(originalSegments, segments); in testStepAndPrebakedAndPrimitiveSegments_keepsListUnchanged()
79 List<VibrationEffectSegment> segments = new ArrayList<>(Arrays.asList( in testRampSegments_withPwleCapability_keepsListUnchanged() local
86 assertEquals(-1, mAdapter.apply(segments, -1, vibratorInfo)); in testRampSegments_withPwleCapability_keepsListUnchanged()
87 assertEquals(0, mAdapter.apply(segments, 0, vibratorInfo)); in testRampSegments_withPwleCapability_keepsListUnchanged()
89 assertEquals(originalSegments, segments); in testRampSegments_withPwleCapability_keepsListUnchanged()
94 List<VibrationEffectSegment> segments = new ArrayList<>(Arrays.asList( in testRampSegments_withoutPwleCapability_convertsRampsToSteps() local
119 assertEquals(4, mAdapter.apply(segments, 3, createVibratorInfo())); in testRampSegments_withoutPwleCapability_convertsRampsToSteps()
[all …]
H A DVibrationThreadTest.java699 List<VibrationEffectSegment> segments = in vibrate_singleVibratorComposedWithFallback_replacedInTheMiddleOfComposition() local
701 assertTrue("Wrong segments: " + segments, segments.size() >= 4); in vibrate_singleVibratorComposedWithFallback_replacedInTheMiddleOfComposition()
702 assertTrue(segments.get(0) instanceof PrebakedSegment); in vibrate_singleVibratorComposedWithFallback_replacedInTheMiddleOfComposition()
703 assertTrue(segments.get(1) instanceof PrimitiveSegment); in vibrate_singleVibratorComposedWithFallback_replacedInTheMiddleOfComposition()
704 for (int i = 2; i < segments.size() - 1; i++) { in vibrate_singleVibratorComposedWithFallback_replacedInTheMiddleOfComposition()
706 assertTrue(segments.get(i) instanceof StepSegment); in vibrate_singleVibratorComposedWithFallback_replacedInTheMiddleOfComposition()
708 assertTrue(segments.get(segments.size() - 1) instanceof PrimitiveSegment); in vibrate_singleVibratorComposedWithFallback_replacedInTheMiddleOfComposition()
H A DVibratorManagerServiceTest.java1460 List<VibrationEffectSegment> segments = mVibratorProviders.get(1).getAllEffectSegments(); in vibrate_prebakedAndComposedVibrationsWithFallbacks_playsFallbackOnlyForPredefined() local
1462 assertTrue(segments.size() > 2); in vibrate_prebakedAndComposedVibrationsWithFallbacks_playsFallbackOnlyForPredefined()
1464 assertTrue(segments.get(0) instanceof PrebakedSegment); in vibrate_prebakedAndComposedVibrationsWithFallbacks_playsFallbackOnlyForPredefined()
1467 for (int i = 1; i < segments.size() - 1; i++) { in vibrate_prebakedAndComposedVibrationsWithFallbacks_playsFallbackOnlyForPredefined()
1468 assertTrue(segments.get(i) instanceof StepSegment); in vibrate_prebakedAndComposedVibrationsWithFallbacks_playsFallbackOnlyForPredefined()
1471 assertTrue(segments.get(segments.size() - 1) instanceof PrimitiveSegment); in vibrate_prebakedAndComposedVibrationsWithFallbacks_playsFallbackOnlyForPredefined()
/aosp14/frameworks/base/services/core/java/com/android/server/vibrator/
H A DStepToRampAdapter.java45 convertStepsToRamps(info, segments); in apply()
51 int segmentCount = segments.size(); in convertStepsToRamps()
54 VibrationEffectSegment segment = segments.get(i); in convertStepsToRamps()
62 if (segments.get(i) instanceof RampSegment) { in convertStepsToRamps()
64 segments.set(j, convertStepToRamp(info, (StepSegment) segments.get(j))); in convertStepsToRamps()
67 segments.set(j, convertStepToRamp(info, (StepSegment) segments.get(j))); in convertStepsToRamps()
85 int segmentCount = segments.size(); in splitLongRampSegments()
87 if (!(segments.get(i) instanceof RampSegment)) { in splitLongRampSegments()
90 RampSegment ramp = (RampSegment) segments.get(i); in splitLongRampSegments()
95 segments.remove(i); in splitLongRampSegments()
[all …]
H A DRampDownAdapter.java62 repeatIndex = addRampDownToLoop(segments, repeatIndex); in apply()
80 int segmentCount = segments.size(); in addRampDownToZeroAmplitudeSegments()
82 VibrationEffectSegment previousSegment = segments.get(i - 1); in addRampDownToZeroAmplitudeSegments()
83 if (!isOffSegment(segments.get(i)) in addRampDownToZeroAmplitudeSegments()
89 long offDuration = segments.get(i).getDuration(); in addRampDownToZeroAmplitudeSegments()
119 segments.addAll(i, replacementSegments); in addRampDownToZeroAmplitudeSegments()
124 segments.add(originalOffSegment); in addRampDownToZeroAmplitudeSegments()
155 int segmentCount = segments.size(); in addRampDownToLoop()
156 if (!endsWithNonZeroAmplitude(segments.get(segmentCount - 1)) in addRampDownToLoop()
157 || !isOffSegment(segments.get(repeatIndex))) { in addRampDownToLoop()
[all …]
H A DComposePwleVibratorStep.java100 List<RampSegment> segments = new ArrayList<>(limit); in unrollRampSegments() local
109 for (int i = startIndex; segments.size() <= limit; i++) { in unrollRampSegments()
121 segments.add(rampSegment); in unrollRampSegments()
123 if (isBetterBreakPosition(segments, bestBreakAmplitude, limit)) { in unrollRampSegments()
126 bestBreakPosition = segments.size(); // Break after this ramp ends. in unrollRampSegments()
134 return segments.size() > limit in unrollRampSegments()
136 ? segments.subList(0, bestBreakPosition) in unrollRampSegments()
138 : segments; in unrollRampSegments()
145 private boolean isBetterBreakPosition(List<RampSegment> segments, in isBetterBreakPosition() argument
147 RampSegment lastSegment = segments.get(segments.size() - 1); in isBetterBreakPosition()
[all …]
H A DClippingAmplitudeAndFrequencyAdapter.java39 public int apply(List<VibrationEffectSegment> segments, int repeatIndex, VibratorInfo info) { in apply() argument
40 int segmentCount = segments.size(); in apply()
42 VibrationEffectSegment segment = segments.get(i); in apply()
44 segments.set(i, apply((StepSegment) segment, info)); in apply()
46 segments.set(i, apply((RampSegment) segment, info)); in apply()
H A DRampToStepAdapter.java44 public int apply(List<VibrationEffectSegment> segments, int repeatIndex, in apply() argument
50 int segmentCount = segments.size(); in apply()
52 VibrationEffectSegment segment = segments.get(i); in apply()
57 segments.remove(i); in apply()
58 segments.addAll(i, steps); in apply()
H A DComposePrimitivesVibratorStep.java100 List<PrimitiveSegment> segments = new ArrayList<>(limit); in unrollPrimitiveSegments() local
104 for (int i = startIndex; segments.size() < limit; i++) { in unrollPrimitiveSegments()
115 segments.add((PrimitiveSegment) segment); in unrollPrimitiveSegments()
122 return segments; in unrollPrimitiveSegments()
H A DSetAmplitudeVibratorStep.java174 List<VibrationEffectSegment> segments = effect.getSegments(); in getVibratorOnDuration() local
175 int segmentCount = segments.size(); in getVibratorOnDuration()
180 VibrationEffectSegment segment = segments.get(i); in getVibratorOnDuration()
H A DVibrationStats.java254 void reportComposePwle(long halResult, RampSegment[] segments) { in reportComposePwle() argument
256 mVibrationPwleTotalSize += segments.length; in reportComposePwle()
261 for (RampSegment ramp : segments) { in reportComposePwle()
H A DVibrationEffectAdapters.java50 int apply(List<VibrationEffectSegment> segments, int repeatIndex, T modifier); in apply() argument
/aosp14/frameworks/base/core/java/android/text/
H A DSegmentFinder.java90 public PrescribedSegmentFinder(@NonNull int[] segments) { in PrescribedSegmentFinder() argument
91 checkSegmentsValid(segments); in PrescribedSegmentFinder()
92 mSegments = segments; in PrescribedSegmentFinder()
196 private static void checkSegmentsValid(int[] segments) { in checkSegmentsValid() argument
197 Objects.requireNonNull(segments); in checkSegmentsValid()
198 Preconditions.checkArgument(segments.length % 2 == 0, in checkSegmentsValid()
200 if (segments.length == 0) return; in checkSegmentsValid()
202 for (int index = 0; index < segments.length; index += 2) { in checkSegmentsValid()
203 if (segments[index] < lastSegmentEnd) { in checkSegmentsValid()
206 if (segments[index] >= segments[index + 1]) { in checkSegmentsValid()
[all …]
/aosp14/frameworks/base/cmds/uiautomator/library/core-src/com/android/uiautomator/core/
H A DInteractionController.java475 public boolean swipe(Point[] segments, int segmentSteps) {
486 if(segments.length == 0)
490 ret = touchDown(segments[0].x, segments[0].y);
491 for(int seg = 0; seg < segments.length; seg++) {
492 if(seg + 1 < segments.length) {
494 xStep = ((double)(segments[seg+1].x - segments[seg].x)) / segmentSteps;
495 yStep = ((double)(segments[seg+1].y - segments[seg].y)) / segmentSteps;
498 ret &= touchMove(segments[seg].x + (int)(xStep * i),
499 segments[seg].y + (int)(yStep * i));
510 ret &= touchUp(segments[segments.length - 1].x, segments[segments.length -1].y);
H A DUiDevice.java466 public boolean swipe(Point[] segments, int segmentSteps) { in swipe() argument
467 Tracer.trace(segments, segmentSteps); in swipe()
468 return getAutomatorBridge().getInteractionController().swipe(segments, segmentSteps); in swipe()
/aosp14/frameworks/base/core/java/android/content/
H A DContentUris.java133 final List<String> segments = contentUri.getPathSegments(); in removeId() local
136 for (int i = 0; i < segments.size() - 1; i++) { in removeId()
137 builder.appendPath(segments.get(i)); in removeId()
/aosp14/frameworks/base/core/java/android/net/
H A DUri.java1016 final String[] segments; field in Uri.PathSegments
1020 this.segments = segments; in PathSegments()
1029 return segments[index]; in get()
1042 String[] segments; field in Uri.PathSegmentsBuilder
1046 if (segments == null) { in add()
1050 System.arraycopy(segments, 0, expanded, 0, segments.length); in add()
1051 segments = expanded; in add()
1054 segments[size++] = segment; in add()
1058 if (segments == null) { in build()
1066 segments = null; in build()
[all …]
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/people/data/
H A DMmsQueryHelperTest.java166 List<String> segments = uri.getPathSegments(); in query() local
167 if (segments.size() == 2 && "addr".equals(segments.get(1))) { in query()
168 int messageId = Integer.valueOf(segments.get(0)); in query()
/aosp14/frameworks/base/core/java/android/os/
H A DVibrationEffect.java284 List<StepSegment> segments = new ArrayList<>(); in createWaveform() local
288 segments.add(new StepSegment(parsedAmplitude, /* frequencyHz= */ 0, (int) timings[i])); in createWaveform()
290 VibrationEffect effect = new Composed(segments, repeat); in createWaveform()
671 public Composed(@NonNull List<? extends VibrationEffectSegment> segments, int repeatIndex) { in Composed() argument
673 mSegments = new ArrayList<>(segments); in Composed()
695 List<VibrationEffectSegment> segments = getSegments(); in computeCreateWaveformOffOnTimingsOrNull() local
704 long[] patternBuffer = new long[segments.size() + 1]; in computeCreateWaveformOffOnTimingsOrNull()
707 for (int i = 0; i < segments.size(); i++) { in computeCreateWaveformOffOnTimingsOrNull()
709 castToValidStepSegmentForOffOnTimingsOrNull(segments.get(i)); in computeCreateWaveformOffOnTimingsOrNull()
H A DEnvironment.java1553 public static File[] buildPaths(File[] base, String... segments) { in buildPaths() argument
1556 result[i] = buildPath(base[i], segments); in buildPaths()
1567 public static File buildPath(File base, String... segments) { in buildPath() argument
1569 for (String segment : segments) { in buildPath()
/aosp14/frameworks/base/services/core/java/com/android/server/am/
H A DSettingsToPropertiesMapper.java215 String[] segments = property_name.split("\\."); in getResetNativeCategories() local
216 if (segments.length < 3) { in getResetNativeCategories()
220 categories.add(segments[2]); in getResetNativeCategories()
/aosp14/frameworks/base/services/core/java/com/android/server/slice/
H A DSliceClientPermissions.java291 final String[] segments = mPaths.valueAt(i); in writeTo() local
292 if (segments != null) { in writeTo()
294 out.text(encodeSegments(segments)); in writeTo()
/aosp14/frameworks/base/core/proto/android/server/vibrator/
H A Dvibratormanagerservice.proto65 optional SegmentProto segments = 1; field

12