Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4645927

Browse files
authored
Google java format relocation and formatting update (#53118)
Fixes flutter/flutter#149319 Caused by #52582 Follow up required to add a flag that fails on missing jar files instead of skipping missing jar files.
1 parent fa30658 commit 4645927

File tree

6 files changed

+27
-33
lines changed

6 files changed

+27
-33
lines changed

ci/bin/format.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ class JavaFormatChecker extends FormatChecker {
475475
path.absolute(
476476
path.join(
477477
srcDir.absolute.path,
478+
'flutter',
478479
'third_party',
479480
'android_tools',
480481
'google-java-format',

shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,12 +646,12 @@ void onStop() {
646646
// See https://github.com/flutter/flutter/issues/93276
647647
previousVisibility = flutterView.getVisibility();
648648
flutterView.setVisibility(View.GONE);
649-
if (flutterEngine != null) {
650-
// When an Activity is stopped it won't have its onTrimMemory callback invoked. Normally,
651-
// this isn't a problem but because of a bug in some builds of Android 14 we must act as
652-
// if the onTrimMemory callback has been called.
653-
flutterEngine.getRenderer().onTrimMemory(ComponentCallbacks2.TRIM_MEMORY_BACKGROUND);
654-
}
649+
if (flutterEngine != null) {
650+
// When an Activity is stopped it won't have its onTrimMemory callback invoked. Normally,
651+
// this isn't a problem but because of a bug in some builds of Android 14 we must act as
652+
// if the onTrimMemory callback has been called.
653+
flutterEngine.getRenderer().onTrimMemory(ComponentCallbacks2.TRIM_MEMORY_BACKGROUND);
654+
}
655655
}
656656

657657
/**

shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformViewsChannel.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,11 @@ public static class PlatformViewTouch {
502502
/** The number of pointers (e.g, fingers) involved in the touch event. */
503503
public final int pointerCount;
504504
/**
505-
* Properties for each pointer, encoded in a raw format.
506-
* Expected to be formatted as a List[List[Integer]], where each inner list has two items:
507-
* - An id, at index 0, corresponding to {@link android.view.MotionEvent.PointerProperties#id}
508-
* - A tool type, at index 1, corresponding to {@link android.view.MotionEvent.PointerProperties#toolType}.
509-
* */
505+
* Properties for each pointer, encoded in a raw format. Expected to be formatted as a
506+
* List[List[Integer]], where each inner list has two items: - An id, at index 0, corresponding
507+
* to {@link android.view.MotionEvent.PointerProperties#id} - A tool type, at index 1,
508+
* corresponding to {@link android.view.MotionEvent.PointerProperties#toolType}.
509+
*/
510510
@NonNull public final Object rawPointerPropertiesList;
511511
/** Coordinates for each pointer, encoded in a raw format. */
512512
@NonNull public final Object rawPointerCoords;

shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -371,28 +371,21 @@ private MotionEvent makePlatformViewTouchAndInvokeToMotionEvent(
371371
// Construct a PlatformViewTouch.rawPointerPropertiesList by doing the inverse of
372372
// PlatformViewsController.parsePointerPropertiesList.
373373
List<List<Integer>> pointerProperties =
374-
Arrays.asList(
375-
Arrays.asList(
376-
original.getPointerId(0),
377-
original.getToolType(0)
378-
)
379-
);
374+
Arrays.asList(Arrays.asList(original.getPointerId(0), original.getToolType(0)));
380375
// Construct a PlatformViewTouch.rawPointerCoords by doing the inverse of
381376
// PlatformViewsController.parsePointerCoordsList.
382377
List<List<Double>> pointerCoordinates =
378+
Arrays.asList(
383379
Arrays.asList(
384-
Arrays.asList(
385-
(double) original.getOrientation(),
386-
(double) original.getPressure(),
387-
(double) original.getSize(),
388-
(double) original.getToolMajor(),
389-
(double) original.getToolMinor(),
390-
(double) original.getTouchMajor(),
391-
(double) original.getTouchMinor(),
392-
(double) original.getX(),
393-
(double) original.getY()
394-
)
395-
);
380+
(double) original.getOrientation(),
381+
(double) original.getPressure(),
382+
(double) original.getSize(),
383+
(double) original.getToolMajor(),
384+
(double) original.getToolMinor(),
385+
(double) original.getTouchMajor(),
386+
(double) original.getTouchMinor(),
387+
(double) original.getX(),
388+
(double) original.getY()));
396389
// Make a platform view touch from the motion event.
397390
PlatformViewTouch frameWorkTouchNonVd =
398391
new PlatformViewTouch(

tools/engine_tool/lib/src/commands/format_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class _FormatStreamer {
124124
return;
125125
}
126126
final String l = line.trim();
127-
if (l == 'To fix, run `et format` or:') {
127+
if (l == 'To fix, run `et format --all` or:') {
128128
inADiff = true;
129129
}
130130
if (l.isNotEmpty && (!inADiff || dryRun)) {

tools/engine_tool/test/format_command_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void main() {
159159
final FakeProcessManager manager = _formatProcessManager(
160160
expectedFlags: <String>['--fix'],
161161
stdout: <String>[
162-
'To fix, run `et format` or:',
162+
'To fix, run `et format --all` or:',
163163
'many',
164164
'lines',
165165
'of',
@@ -185,7 +185,7 @@ void main() {
185185
final FakeProcessManager manager = _formatProcessManager(
186186
expectedFlags: <String>[],
187187
stdout: <String>[
188-
'To fix, run `et format` or:',
188+
'To fix, run `et format --all` or:',
189189
'many',
190190
'lines',
191191
'of',
@@ -206,7 +206,7 @@ void main() {
206206
expect(
207207
stringsFromLogs(testLogs),
208208
equals(<String>[
209-
'To fix, run `et format` or:\n',
209+
'To fix, run `et format --all` or:\n',
210210
'many\n',
211211
'lines\n',
212212
'of\n',

0 commit comments

Comments
 (0)