Google java format relocation and formatting update (flutter/engine#53118)

Fixes https://github.com/flutter/flutter/issues/149319
Caused by https://github.com/flutter/engine/pull/52582

Follow up required to add a flag that fails on missing jar files instead of skipping missing jar files.
This commit is contained in:
Reid Baker
2024-05-31 14:09:23 -04:00
committed by GitHub
parent f2471ff7d9
commit 02d2b7c8e1
6 changed files with 27 additions and 33 deletions

View File

@@ -475,6 +475,7 @@ class JavaFormatChecker extends FormatChecker {
path.absolute(
path.join(
srcDir.absolute.path,
'flutter',
'third_party',
'android_tools',
'google-java-format',

View File

@@ -646,12 +646,12 @@ import java.util.List;
// 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);
}
}
/**

View File

@@ -502,11 +502,11 @@ public class PlatformViewsChannel {
/** 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;

View File

@@ -371,28 +371,21 @@ public class PlatformViewsControllerTest {
// 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(

View File

@@ -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)) {

View File

@@ -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',
@@ -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',
@@ -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',