613 Commits

Author SHA1 Message Date
Gray Mackall
2aae286c8d Bump versions of agp and robolectric, and configure to use SDK 35 (flutter/engine#56732)
Bumps the version of AGP used in the IDE-support `build.gradle`, as well as the robolectric version in both the IDE-support `build.gradle` and test-runner-`build.gradle`. 

This is the current latest robolectric: https://github.com/robolectric/robolectric/releases/tag/robolectric-4.14.1.

Also 
1. configures robolectric to use API 35, and 
2. removes the use of a deprecated class which (from what I could tell) looked like it was just used for setup, and the test still passes without it.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-25 18:24:05 +00:00
André Stein
5ae19147fa [TextInput] Add TextInputType.webSearch (#15762) (flutter/engine#56428)
This PR adds the engine part to add `TextInputType.webSearch` that allows to show a keyboard with ready access to a "." key on iOS. On Android this is re-mapped to `url` which shows the same behaviour as `webSearch` on iOS. This fixes issue https://github.com/flutter/flutter/issues/157562.

The flutter PR: https://github.com/flutter/flutter/pull/158323
2024-11-15 21:51:21 +00:00
Bruno Leroux
14807a1cb4 [Android] Fix Slider semantics double tap behaviors (flutter/engine#56452)
## Description

Android fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](https://github.com/flutter/flutter/issues/156427). Similar to [the iOS engine fix](https://github.com/flutter/engine/pull/56427).

Slider widget doesn't define a Semantics.onTap handler, so a double-click while in accessibility mode defaults to a regular tap down event to which _RenderSlider reacts by changing the slider value.

Adding a onTap callback on the framework side was tried in https://github.com/flutter/flutter/pull/157601 but it breaks one accessibility guideline test, see https://github.com/flutter/flutter/pull/157601#discussion_r1821650120). 

See https://github.com/flutter/flutter/pull/157601#discussion_r1829992890 for the reasoning to make the change at the engine level.

## Related Issue

Android fix for [[A11y] Double Tap brings the Slider thumb to the center of the widget.](https://github.com/flutter/flutter/issues/156427).

## Tests

Adds 1 test.
2024-11-14 17:53:04 +00:00
yaakovschectman
97152fcaf0 Move detection of cutouts in Android engine to onApplyWindowInsets (flutter/engine#55992)
Stop including the translation of window insets cutouts to Flutter
cutout DisplayFeatures in the window info listener method, which would
not necessarily receive changes in the correct order/state when they
update, e.g. when the screen orientation changes.

Fixes https://github.com/flutter/flutter/issues/155658

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-11-04 11:45:57 -05:00
Gray Mackall
c5d163fccb Delete v1 android engine embedding (flutter/engine#52022)
Fixes https://github.com/flutter/flutter/issues/143531

Other failures from the initial attempt are fixed in https://github.com/flutter/flutter/pull/146523/
2024-10-23 21:12:52 +00:00
Justin McCandless
cd1cd27685 Scribe (Android stylus handwriting text input) (flutter/engine#52943)
The engine API for Android's Scribe stylus handwriting input. Just bare bones handwriting itself, does not support special gestures, which will come in subsequent PR(s).
2024-10-21 11:55:02 -07:00
Jason Simmons
9872e0ee2f Request another frame in ImageReaderSurfaceProducer.dequeueImage if more images are pending in the queue (flutter/engine#55944)
ImageReaderSurfaceProducer will request a frame when an image is enqueued. But there is no guarantee that each request will produce an additional frame.
Multiple requests happening within one vsync interval could be merged into one frame.  If no other frame is scheduled, then some images will remain in the queue and the image shown on screen will not be the latest image.

With this change, ImageReaderSurfaceProducer will continue requesting frames after consuming an image if the queue is not empty.

Fixes https://github.com/flutter/flutter/issues/156903
Fixes https://github.com/flutter/flutter/issues/155787
2024-10-21 15:31:14 +00:00
Matan Lurey
8e3b58f166 ReleaseonTrimMemoryListener after ImageReaderSurfaceProducer released. (flutter/engine#55760)
Fixes https://github.com/flutter/flutter/issues/156434.

A better fix for the workaround in https://github.com/flutter/flutter/issues/156158.

This should likely be cherrypicked, as it's a memory leak, safe, and avoids workaround code in plugins.
2024-10-09 01:35:17 +00:00
auto-submit[bot]
248b86a64b Reverts "Reverts "Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (#55418)" (#55450)" (flutter/engine#55463)
Reverts: flutter/engine#55450
Initiated by: matanlurey
Reason for reverting: Fixed forward in https://github.com/flutter/packages/pull/7712.
Original PR Author: auto-submit[bot]

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:
Reverts: flutter/engine#55418
Initiated by: bdero
Reason for reverting: [Engine->Framework roll breakage](https://github.com/flutter/flutter/issues/155727#issuecomment-2375489803)
Original PR Author: matanlurey

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/155131.

Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.

/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
2024-09-26 17:34:17 +00:00
auto-submit[bot]
80ce9f8631 Reverts "Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (#55418)" (flutter/engine#55450)
Reverts: flutter/engine#55418
Initiated by: bdero
Reason for reverting: [Engine->Framework roll breakage](https://github.com/flutter/flutter/issues/155727#issuecomment-2375489803)
Original PR Author: matanlurey

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/155131.

Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.

/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
2024-09-26 00:45:46 +00:00
jesswrd
21ddf3e6e3 Remove usages of WindowManager's getDefaultDisplay (flutter/engine#55002)
Removed deprecated usages of WindowManager's `getDefaultDisplay()` and
replaced them with DisplayManager's `getDisplay()`.

Note: Decided to keep a usage of `getDefaultDisplay()`, which can be
found in FlutterView.java because it is expected to be deleted as a part
of V1 embedding removal. No changes were made to that file.

path to FlutterView.java:
shell/platform/android/io/flutter/embedding/android/FlutterView.java

Fixes [#99421](https://github.com/flutter/flutter/issues/99421)

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-09-25 17:04:00 -04:00
Matan Lurey
f425edfbf7 Add a boolean that exposes rotation/crop metadata capability. (flutter/engine#55434)
Closes https://github.com/flutter/flutter/issues/144407.
Closes https://github.com/flutter/flutter/issues/155633.
2024-09-25 19:27:08 +00:00
Matan Lurey
2291e92e59 Add SurfaceProducer#onSurfaceAvailable, deprecate onSurfaceCreated. (flutter/engine#55418)
Closes https://github.com/flutter/flutter/issues/155131.

Not only did I rename the method, but I also changed the contract slightly - now `onSurfaceAvailable` is _only_ invoked _after_ `onSurfaceDestroyed` has been called. The cost is a single `boolean`, and it honestly makes the API make a lot more sense than someone having to track this themselves.

/cc @johnmccutchan (OOO), and @flutter/android-reviewers.
2024-09-25 16:24:06 +00:00
Mahmut Taşkıran
92cc1aac8a Add a check for the surface if it is valid (flutter/engine#55277)
Fixes an issue where the Surface is not valid and the `draw` method is crashing.

https://github.com/flutter/flutter/issues/155018

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-24 18:43:06 +00:00
Reid Baker
0f03db48fe FlutterViewTest add back part 4 and 5 (flutter/engine#55243)
- **Add light and dark test back to FlutterView.java**
- **Migrate some but not all usages of Robolectric.setupActivity in FlutterViewTest.java**
- **Remove suppress warnings on tests that no longer need it, update documentation for ones that still need the suppression**
Fixes https://github.com/flutter/flutter/issues/154746 
Partial work on https://github.com/flutter/flutter/issues/133151
2024-09-17 15:58:59 +00:00
Reid Baker
1030f3b153 flutter view add test 2 (flutter/engine#55188)
- **add test back with no other changes**
- **Add legacy test and setup shadow**
2 and 3 of 5 flutter/flutter/issues/154746

Improved legacy testing by validating a fullscreen and non fullscreen codepaths. 

Added `.git-blame-ignore-revs` because git was failing to give blame values with that file missing. I dont think I added a global config anywhere but adding an empty file should not cause a problem.
2024-09-16 20:40:19 +00:00
Gray Mackall
fde6227383 Synthesize remove events on PointerChange.ACTION_UP and PointerChange.ACTION_POINTER_UP (flutter/engine#55157)
... when the input device type is touch.

Fixes (partially) https://github.com/flutter/flutter/issues/154842 for touch events. Does not fix when using a stylus, that case will require a follow up PR.

Without fix:

https://github.com/user-attachments/assets/10a8ac73-7b27-498b-a76e-0f2cfc3050d7

With fix:

https://github.com/user-attachments/assets/18656f3a-d45a-4b08-9227-cc0abe8c73f7

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-14 01:02:23 +00:00
Jonah Williams
9235fbb695 [impeller] add Android flag for disabling surface control for debugging. (flutter/engine#55185)
I've found a few instances where Vulkan worked correctly but surface control did not. lets add a debugging flag we can ask folks to try to narrow down the issue.
2024-09-13 21:39:20 +00:00
Reid Baker
415f89e20a add back test itSendsTextShowPasswordToFrameworkOnAttach with new mock for display metrics (flutter/engine#55110)
Part 1/5 for re adding tests documented in flutter/flutter/issues/154746

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
2024-09-13 13:45:37 -04:00
Reid Baker
f6b728f86f Add copyright notices to java test files (flutter/engine#55155)
Fixes flutter/flutter/issues/155118
2024-09-13 15:31:52 +00:00
Gray Mackall
7a06558bd9 Replace System.loadLibrary with ReLinker.loadLibrary() in FlutterJNI.loadLibrary() (flutter/engine#55095)
Could fix? https://github.com/flutter/flutter/issues/83596

The communication on https://issuetracker.google.com/issues/346717090#comment2 recommends using [ReLinker](https://github.com/KeepSafe/ReLinker) to avoid a bug in how library loading interacts with the [Play delivery feature](https://developer.android.com/guide/playcore/feature-delivery) (used in turn by Flutter's deferred components).

The ReLinker docs also suggest that if you have `minSdk` less than `23`, then you should be using ReLinker regardless, as `System.loadLibrary` is unreliable for other reasons.

I don't have any strong evidence to suggest that either one of these two root causes is the definitive cause of https://github.com/flutter/flutter/issues/83596, but it probably wouldn't hurt 🤷 

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-09-11 21:05:52 +00:00
Reid Baker
930edba64f Add back FlutterViewTest.java (flutter/engine#55048)
Add back FlutterViewTest.java from 8e096b4 (last commit before it was deleted in https://github.com/flutter/engine/pull/44047)

Fixes flutter/flutter/issues/154746
2024-09-11 15:02:56 +00:00
chunhtai
47bc9a3abb [Android] Drops semantics query when app is not attached (flutter/engine#52040)
Is seems automatic test may send a11y query before the engine is attached. Add a guard to guard against it.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-26 16:37:05 +00:00
Jonah Williams
95edf0d8db [android] workaround for HC bug. (flutter/engine#54408)
Testing

FYI @jason-simmons 

"Fixes" https://github.com/flutter/flutter/issues/152691
2024-08-08 00:06:58 +00:00
hangyu
5f18f2ebfd Set deep linking flag to true by default (flutter/engine#52350)
doc: flutter.dev/go/deep-link-flag-migration

Action item: make sure customers are aware of this change before merging
this PR.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I signed the [CLA].
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-08-01 12:58:12 -07:00
Bruno Leroux
555c2ff92a [Android] Revert "Reset IME state on clear text input client" (flutter/engine#54277)
## Description

This PR reverts two commits https://github.com/flutter/engine/pull/49829 and https://github.com/flutter/engine/pull/53662.

The main change was in https://github.com/flutter/engine/pull/49829. https://github.com/flutter/engine/pull/53662 was a follow-up to mitigate the impact of https://github.com/flutter/engine/pull/49829.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/148530
Fixes https://github.com/flutter/flutter/issues/152620

Reopens https://github.com/flutter/flutter/issues/70546.
Reopens https://github.com/flutter/flutter/issues/51478
2024-08-01 19:50:07 +00:00
Chinmay Garde
2160284af8 [Impeller] Enable on-by-default on Android. (flutter/engine#54156)
Developers can control the backend in the following ways:

* **Do nothing**: Impeller with Vulkan is used where Vulkan is available with a fallback to Skia with OpenGL.
* **In `AndroidManifest.xml`, specify `io.flutter.embedding.android.EnableImpeller` as `false`**: Skia with OpenGL is used.
* **On the command line, specify `--no-enable-impeller`**: Skia with OpenGL is used.

Manifest options will take priority command line options when there is a conflict. This matches iOS behavior per https://github.com/flutter/flutter/issues/124049 (closed as WAI).

Fixes https://github.com/flutter/flutter/issues/149360
2024-07-29 03:35:27 +00:00
Greg Spencer
b5648f9fb0 Remove incorrect line (flutter/engine#54021)
## Description

Removes a line that shadows setting the device type correctly for keyboard events.

## Related Issues
 - Fixes https://github.com/flutter/flutter/issues/151308
2024-07-25 01:03:16 +00:00
Camille Simon
0619de0107 Upgrade Engine Android SDK to 35 (flutter/engine#53574)
**REVIEW BUT DO NOT MERGE:** Will merge after https://github.com/flutter/buildroot/pull/870 lands.

1: Updates engine to use Android 35. Part of https://github.com/flutter/flutter/issues/150215.
Engine step of https://github.com/flutter/flutter/blob/master/docs/platforms/android/Upgrading-Engine's-Android-API-version.md.

2: Updates test runner AGP version to 8.5, engine Gradle version to 8.9 to accommodate update.

3: Fixes lint and suppresses deprecation warnings caused by the update. None of the deprecations are unknown by the team (they are handled in the code), but the tests emitted warnings.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-24 16:54:38 +00:00
Bruno Leroux
42ec2e55c5 [Android] Call restartInput selectively on clear (flutter/engine#53662)
## Description

This PR restricts the call to `restartInput` which was added in https://github.com/flutter/engine/pull/49829.
The restart is called when input action is null, DONE, or NONE.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/148673.

## Tests

Updates 1 test, adds 3 tests.
2024-07-18 20:27:33 +00:00
Gray Mackall
29a474fe3e More logs for Android unsatisfiedLinkError (flutter/engine#53920)
See https://github.com/flutter/flutter/issues/83596#issuecomment-2140605278, there are two cases:
1. IO issue
2. The directory doesn't exist

Narrow down by including in the logs if the directory exists or not.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-07-16 20:12:03 +00:00
Gray Mackall
8e2c560e10 Re-re-re-land "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53592)
Re-re-re-land https://github.com/flutter/engine/pull/53001.

I recreated the postsubmit failures of the [roll](https://github.com/flutter/flutter/pull/150733) of the [last land](https://github.com/flutter/engine/pull/53532), and then verified on a local branch that those same postsubmits pass with this upgrade after the land of https://github.com/flutter/flutter/pull/150873. 

So I have pretty high confidence this won't cause any problems in the framework repo. I also tested on a previous land attempt that the `all_packages` app builds on this branch, so that is also a good sign for the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-27 19:56:47 +00:00
Håkon Bertheussen
8311e5eca9 Fix AccessibilityFeatures.disableAnimations flag on Android 12+ (flutter/engine#53428)
This PR fixes the problem where Flutter would not respect the "remove animation" accessibility setting on Android 12+.

Please see this issue for details: https://github.com/flutter/flutter/issues/130976

As [mentioned](https://github.com/flutter/flutter/issues/130976#issuecomment-1931388665) by [horsemankukka](https://github.com/horsemankukka), the problem has to do with reading `Settings.Global.TRANSITION_ANIMATION_SCALE` as a string instead of a float. Flutter would compare it to the string "0" to determine if animations should be disabled. Presumably, this worked because the settings app did indeed use the string "0" or "1" for this setting. But as of Android 12 it's instead written using float representation ("0.0" or "1.0"), at least on Samsung devices. [The documentation](https://developer.android.com/reference/android/provider/Settings.Global#TRANSITION_ANIMATION_SCALE) also states that this setting should be read as a float, which is what this PR does.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-27 18:44:04 +00:00
auto-submit[bot]
c352f44015 Reverts "Re-re-land "Upgrade all[most] androidx dependencies to latest" (#53532)" (flutter/engine#53546)
Reverts: flutter/engine#53532
Initiated by: gmackall
Reason for reverting: This breaks apps that use plugins that use compileSdk 31, some of which we use in our postsubmit (so it blocks the tree).
Original PR Author: gmackall

Reviewed By: {reidbaker, matanlurey}

This change reverts the following previous change:
Re-re-land https://github.com/flutter/engine/pull/53001

(Reland attempt was at https://github.com/flutter/engine/pull/53462)

Unblocked by https://github.com/flutter/flutter/pull/150585, but will still need a manual roll because I will need to re-generate a bunch of lockfiles.

Also, https://github.com/flutter/flutter/blob/master/docs/engine/Testing-presubmit-Engine-PRs-with-the-Flutter-framework.md doesn't work (it's blocked on https://github.com/flutter/flutter/issues/149780) so I mostly just have to pray that no new issues occur in the roll. But I believe all issues that came up in the last attempt should be addressed by the above pr and by manual lockfile generation.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-25 01:20:29 +00:00
Gray Mackall
f9b2f290ba Re-re-land "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53532)
Re-re-land https://github.com/flutter/engine/pull/53001

(Reland attempt was at https://github.com/flutter/engine/pull/53462)

Unblocked by https://github.com/flutter/flutter/pull/150585, but will still need a manual roll because I will need to re-generate a bunch of lockfiles.

Also, https://github.com/flutter/flutter/blob/master/docs/engine/Testing-presubmit-Engine-PRs-with-the-Flutter-framework.md doesn't work (it's blocked on https://github.com/flutter/flutter/issues/149780) so I mostly just have to pray that no new issues occur in the roll. But I believe all issues that came up in the last attempt should be addressed by the above pr and by manual lockfile generation.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-24 21:36:22 +00:00
Matan Lurey
233edc0b8f Add SurfaceProducer.Callback lifecycle hooks (flutter/engine#53280)
Work towards https://github.com/flutter/flutter/issues/148417.
2024-06-24 08:06:56 -07:00
auto-submit[bot]
feefb6ebd8 Reverts "Reland "Upgrade all[most] androidx dependencies to latest" (#53462)" (flutter/engine#53468)
Reverts: flutter/engine#53462
Initiated by: gmackall
Reason for reverting: blocking roll (see https://github.com/flutter/flutter/pull/150465#issuecomment-2177329885).
Original PR Author: gmackall

Reviewed By: {reidbaker}

This change reverts the following previous change:
Relands https://github.com/flutter/engine/pull/53001.

Also pulls in @matanlurey's dependency on `androidx.lifecycle:lifecycle-process`, and upgrades it to `2.7.0`.

It is unblocked by the changes in https://github.com/flutter/flutter/pull/149204.

Tested by building the engine, and then also by building the `flutter/packages` `all_packages` app on this branch, so that hopefully it will also roll smoothly into the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-19 01:08:48 +00:00
Gray Mackall
4e98015b1e Reland "Upgrade all[most] androidx dependencies to latest" (flutter/engine#53462)
Relands https://github.com/flutter/engine/pull/53001.

Also pulls in @matanlurey's dependency on `androidx.lifecycle:lifecycle-process`, and upgrades it to `2.7.0`.

It is unblocked by the changes in https://github.com/flutter/flutter/pull/149204.

Tested by building the engine, and then also by building the `flutter/packages` `all_packages` app on this branch, so that hopefully it will also roll smoothly into the packages repo.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-06-18 21:14:07 +00:00
Matan Lurey
5300aafdb5 Add a FlutterEngineRule (JUnit TestRule) and use it in FlutterRendererTest (flutter/engine#53361)
In https://github.com/flutter/engine/pull/53280, I'm adding
lifecycle-aware methods to `SurfaceProducer`.

That means, in order to test that it WAI, we'll need to be running in a
simulated activity, and be able to switch scenario states (i.e. to
`RESUMED`). This was mentioned as well in
https://github.com/flutter/flutter/issues/133151 as being something we
want to do.

This PR adds a `FlutterEngineRule`, which allows the creation of a
"real" `FlutterEngine` and an `Intent` that can power
`AndroidScenarioRule<FlutterActivity>`. I felt bad doing all of this
work for a single `@Test`, so I also refactored the rest of the file and
cleaned things up a bit.

That said, I'm happy to revert or make changes if we liked how things
were setup before.
2024-06-13 16:22:54 -07:00
Reid Baker
02d2b7c8e1 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.
2024-05-31 18:09:23 +00:00
Gray Mackall
dab310ecb8 Manual revert of #53001 (flutter/engine#53075)
Revert label failed due to conflicts

`FlutterFragmentTest.java` was the only file that had merge issues, everything else is the output of `git revert 802e5d2cd3c9e73f336e3fe43487b64a5fdf98d8`

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-28 23:00:20 +00:00
Justin McCandless
6dfec16435 FlutterFragment predictive back (flutter/engine#52302)
Android add-to-app apps now support predictive back when going between Activities or back to the home screen. Predictive back route transitions within the Flutter part of the app are not yet supported.
2024-05-28 12:52:05 -07:00
Gray Mackall
802e5d2cd3 Upgrade all[most] androidx dependencies to latest (flutter/engine#53001)
Upgrades every `androidx` dependency in the `src/third_party/android_embedding_dependencies` bundle to the latest version, except the `lifecycle` group*. Tested running a couple of apps as well because when updating these dependencies in the past I've been able to build the engine but then flutter run fail when trying to run an app.

Fixes https://github.com/flutter/flutter/issues/129307, also unblocks a feature that will eventually be needed for Scribe.

[*]`2.8.0` is the latest there, but I ran into an issue with dexing when I tried to upgrade, due to b/336164417, an AGP bug that had its fix backported to all >`8.0.0` versions, but we still support less than that so we will have to wait on that upgrade.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-28 16:58:59 +00:00
Gray Mackall
b6bb39ad2d Fix non-vd android platform view input event offsets (flutter/engine#52532)
Fixes https://github.com/flutter/flutter/issues/146570, which tracks a regression from https://github.com/flutter/engine/pull/49268 regarding platform view inputs in some specific cases.

This PR translates the input event location to be the same as the location we calculated before https://github.com/flutter/engine/pull/49268, returning to the previous behavior, while maintaining the input event's verified status (I checked this manually with the `InputManager`).

Tested manually with the reproduction in the linked issue.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-05-14 23:07:53 +00:00
Chinmay Garde
f3934883b0 Delete Settings::msaa_samples. (flutter/engine#52780)
Fixes https://github.com/flutter/flutter/issues/148257
2024-05-13 23:51:11 +00:00
John McCutchan
845c75ce6c Workaround HardwareRenderer breakage in Android 14 (flutter/engine#52370)
- Destroy ImageReaders on memory trim.
- Unset the VirtualDisplay's surface on memory trim.
- On resume, recreate ImageReaders.
- On resume, do a dumb little dance and then set the VirtualDisplay's surface

Fixes: https://github.com/flutter/flutter/issues/146499
Fixes: https://github.com/flutter/flutter/issues/144219

Internal bug: b/335646931
Android Fix: https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/27015418

Android 15 will include the fix. Unclear if Android 14 will be patched.
2024-04-30 05:09:05 +00:00
auto-submit[bot]
c0bd2a3ce0 Reverts "Delete engine v1 android embedding (#51229)" (flutter/engine#51996)
Reverts: flutter/engine#51229
Initiated by: gmackall
Reason for reverting: blocking engine->framework roll (I missed some framework code referencing the v1 embedding).
Original PR Author: gmackall

Reviewed By: {matanlurey, reidbaker}

This change reverts the following previous change:
Fixes https://github.com/flutter/flutter/issues/143531

Also fixes a random typo I found

~TODO to test this~ (no more todo):
-~test the framework against this as well, probably with a dummy PR changing the engine commit to my branch if this is possible~ not possible, made a best effort removal of framework code in https://github.com/flutter/flutter/pull/144726.
-~figure out if the old embedding is used in g3 at all~ removed all uses
-~figure out exactly what the ShimPluginRegistry/ShimRegistrar are doing, and if fully deleting them was right~ (see https://github.com/flutter/engine/pull/51229#issuecomment-1981757743)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-09 19:13:47 +00:00
Gray Mackall
797e1ad902 Delete engine v1 android embedding (flutter/engine#51229)
Fixes https://github.com/flutter/flutter/issues/143531

Also fixes a random typo I found

TODO to test this:
-test the framework against this as well, probably with a dummy PR changing the engine commit to my branch if this is possible
-figure out if the old embedding is used in g3 at all
-~figure out exactly what the ShimPluginRegistry/ShimRegistrar are doing, and if fully deleting them was right~ (see https://github.com/flutter/engine/pull/51229#issuecomment-1981757743)

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-09 18:03:17 +00:00
utzcoz
04f240de45 Bump Robolectric to 4.12.1 (flutter/engine#51800)
See https://github.com/robolectric/robolectric/releases/tag/robolectric-4.12 and https://github.com/robolectric/robolectric/releases/tag/robolectric-4.12.1 .

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-04-04 20:07:53 +00:00
John McCutchan
e5289fdce1 Reland https://github.com/flutter/engine/pull/51391 (flutter/engine#51764) 2024-03-29 01:45:16 +00:00