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

Google java format relocation and formatting update #53118

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/bin/format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ class JavaFormatChecker extends FormatChecker {
path.absolute(
path.join(
srcDir.absolute.path,
'flutter',
'third_party',
'android_tools',
'google-java-format',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,12 @@ void onStop() {
// See https://github.com/flutter/flutter/issues/93276
previousVisibility = flutterView.getVisibility();
flutterView.setVisibility(View.GONE);
if (flutterEngine != null) {
// When an Activity is stopped it won't have its onTrimMemory callback invoked. Normally,
// this isn't a problem but because of a bug in some builds of Android 14 we must act as
// if the onTrimMemory callback has been called.
flutterEngine.getRenderer().onTrimMemory(ComponentCallbacks2.TRIM_MEMORY_BACKGROUND);
}
if (flutterEngine != null) {
// When an Activity is stopped it won't have its onTrimMemory callback invoked. Normally,
// this isn't a problem but because of a bug in some builds of Android 14 we must act as
// if the onTrimMemory callback has been called.
flutterEngine.getRenderer().onTrimMemory(ComponentCallbacks2.TRIM_MEMORY_BACKGROUND);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,11 @@ public static class PlatformViewTouch {
/** The number of pointers (e.g, fingers) involved in the touch event. */
public final int pointerCount;
/**
* Properties for each pointer, encoded in a raw format.
* Expected to be formatted as a List[List[Integer]], where each inner list has two items:
* - An id, at index 0, corresponding to {@link android.view.MotionEvent.PointerProperties#id}
* - A tool type, at index 1, corresponding to {@link android.view.MotionEvent.PointerProperties#toolType}.
* */
* Properties for each pointer, encoded in a raw format. Expected to be formatted as a
* List[List[Integer]], where each inner list has two items: - An id, at index 0, corresponding
* to {@link android.view.MotionEvent.PointerProperties#id} - A tool type, at index 1,
* corresponding to {@link android.view.MotionEvent.PointerProperties#toolType}.
*/
@NonNull public final Object rawPointerPropertiesList;
/** Coordinates for each pointer, encoded in a raw format. */
@NonNull public final Object rawPointerCoords;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,28 +371,21 @@ private MotionEvent makePlatformViewTouchAndInvokeToMotionEvent(
// Construct a PlatformViewTouch.rawPointerPropertiesList by doing the inverse of
// PlatformViewsController.parsePointerPropertiesList.
List<List<Integer>> pointerProperties =
Arrays.asList(
Arrays.asList(
original.getPointerId(0),
original.getToolType(0)
)
);
Arrays.asList(Arrays.asList(original.getPointerId(0), original.getToolType(0)));
// Construct a PlatformViewTouch.rawPointerCoords by doing the inverse of
// PlatformViewsController.parsePointerCoordsList.
List<List<Double>> pointerCoordinates =
Arrays.asList(
Arrays.asList(
Arrays.asList(
(double) original.getOrientation(),
(double) original.getPressure(),
(double) original.getSize(),
(double) original.getToolMajor(),
(double) original.getToolMinor(),
(double) original.getTouchMajor(),
(double) original.getTouchMinor(),
(double) original.getX(),
(double) original.getY()
)
);
(double) original.getOrientation(),
(double) original.getPressure(),
(double) original.getSize(),
(double) original.getToolMajor(),
(double) original.getToolMinor(),
(double) original.getTouchMajor(),
(double) original.getTouchMinor(),
(double) original.getX(),
(double) original.getY()));
// Make a platform view touch from the motion event.
PlatformViewTouch frameWorkTouchNonVd =
new PlatformViewTouch(
Expand Down
2 changes: 1 addition & 1 deletion tools/engine_tool/lib/src/commands/format_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class _FormatStreamer {
return;
}
final String l = line.trim();
if (l == 'To fix, run `et format` or:') {
if (l == 'To fix, run `et format --all` or:') {
inADiff = true;
}
if (l.isNotEmpty && (!inADiff || dryRun)) {
Expand Down
6 changes: 3 additions & 3 deletions tools/engine_tool/test/format_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void main() {
final FakeProcessManager manager = _formatProcessManager(
expectedFlags: <String>['--fix'],
stdout: <String>[
'To fix, run `et format` or:',
'To fix, run `et format --all` or:',
'many',
'lines',
'of',
Expand All @@ -185,7 +185,7 @@ void main() {
final FakeProcessManager manager = _formatProcessManager(
expectedFlags: <String>[],
stdout: <String>[
'To fix, run `et format` or:',
'To fix, run `et format --all` or:',
'many',
'lines',
'of',
Expand All @@ -206,7 +206,7 @@ void main() {
expect(
stringsFromLogs(testLogs),
equals(<String>[
'To fix, run `et format` or:\n',
'To fix, run `et format --all` or:\n',
'many\n',
'lines\n',
'of\n',
Expand Down