Jason Simmons
a7a4d0bd2b
Write macOS universal gen_snapshot binaries to a separate output directory ( #164667 )
...
Also use the name "gen_snapshot" when building for Android targets
instead of appending a target architecture to the filename.
This allows flutter_tools to find the universal gen_snapshot binary when
using a locally built engine. Previously the tools would search
directories like "clang_x64" and find build outputs that may not match
the host architecture.
Moving the universal gen_snapshot binary to a separate directory avoids
conflicts with Dart's gen_snapshot binary, which is placed at the root
of the target output directory.
2025-03-12 19:02:55 +00:00
Jim Graham
f1090285df
Clip layers reduce rrects and paths to simpler shapes when possible ( #164693 )
...
Flutter code can pass clips in the widget tree down as Path objects even
if they were originally simpler shapes. We now catch those
simplifications in the clip_*_layer code and perform reduced operations
in their place.
2025-03-07 05:01:22 +00:00
Jim Graham
66e910d27e
Migrate Mutators to DisplayList/Impeller geometry ( #164258 )
...
Mutator types and MutatorsStack will now use DisplayList/Impeller
geometry objects.
2025-03-06 21:27:51 +00:00
Gray Mackall
1301475873
Implement clipPath Mutator for hcpp ( #164525 )
...
Implements `clipPath` mutator for hcpp.
Fixes https://github.com/flutter/flutter/issues/164219
https://github.com/user-attachments/assets/2c98e621-c73e-40ca-bc76-77de1a3826a0
## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Gray Mackall <mackall@google.com>
2025-03-05 06:45:21 +00:00
Jason Simmons
47a710ba99
Move flutter/third_party/txt into flutter/txt ( #164248 )
...
The flutter/txt library does not currently contain any third-party code.
2025-03-04 16:13:40 +00:00
Chris Bracken
060e159d53
android: Build universal gen_snapshot for Android ( #164453 )
...
This adopts the macOS/iOS rules for creating the `gen_snapshot_arm64`
and `gen_snapshot_armv7` for both arm64 targets (`gen_snapshot_arm64`)
and armv7 targets (`gen_snapshot_armv7`) on both arm64 and x64 macOS
hosts. The macOS and iOS rules have already been updated to generate
universal binaries for each of these that can be run on both Apple
Silicon and Intel Mac hosts.
The `create_arm_gen_snapshot` rule remains until I'm 100% convinced it's
not used for anything else. Will send a follow-up patch removing it so
as not to conflate the two.
No test changes since this is covered by existing build/integration
tests.
Fixes: https://github.com/flutter/flutter/issues/152281
Issue: https://github.com/flutter/flutter/issues/69157
## 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], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-03-03 21:50:31 +00:00
Jonah Williams
696251d25a
[Android] match dequeued images to FIF. ( #164422 )
...
Fixes https://github.com/flutter/flutter/issues/162795
The ImageReaderSurfaceProducer must not close images until the renderer,
either Skia OpenGL, Impeller OpenGL, or Impeller Vulkan is done reading
from them. The Vulkan renderer allows up to two frames in flight before
backpressure is applied. This implies that we may need to keep up to two
images beyond the current image alive. Closing the images before the
frame that references them has finished rendering can result in tearing
or other incorrect rendering.
How do I test?
2025-03-03 19:29:18 +00:00
Chris Bracken
8fe6208a73
android: Clean up gen_snapshot artifact build ( #164418 )
...
Previously, when producing the Android artifacts zip archive, we were
relying directly on the transitively deep-down target in
`//flutter/third_party/dart` that produces it rather than on the
`//flutter/lib/snapshot:generate_snapshot_bins` target that generates
the gen_snapshot binaries for Flutter.
Also documents and renames `gen_snapshot_path` and `gen_snapshot_bin`
for clarity.
In a followup patch, I'll be refactoring Flutter's
`generate_snapshot_bins` target to produce a universal (x64/arm64)
`gen_snapshot` on macOS hosts, so we should rely on our own target
instead.
Issue: https://github.com/flutter/flutter/issues/69157
## 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], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-03-02 01:01:07 +00:00
Chris Bracken
d6089dde09
Delete unused build archive targets ( #164414 )
...
This migration is incomplete and is no longer planned.
Issue: https://github.com/flutter/flutter/issues/105351
## 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], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-03-01 06:16:04 +00:00
Matej Knopp
b831b269c5
Add PlatformDispatcher.engineId ( #163476 )
...
Fixes https://github.com/flutter/flutter/issues/163430 .
This PR adds `engineId` field to `PlatformDispatcher`. When provided by
the engine, this can be used to retrieve the engine instance from native
code.
Dart code:
```dart
final identifier = PlatformDispatcher.instance.engineId!;
```
macOS, iOS:
```objc
FlutterEngine *engine = [FlutterEngine engineForIdentifier: identifier];
```
Android:
```java
FlutterEngine engine = FlutterEngine.engineForId(identifier);
```
Linux
```cpp
FlEngine *engine = fl_engine_for_id(identifier);
```
Windows
```cpp
FlutterDesktopEngineRef engine = FlutterDesktopEngineForId(identifier);
```
*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], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-28 22:20:11 +00:00
Jonah Williams
cd7a24c1b9
[Android] Use java for looking up Android API level. ( #163558 )
...
android_get_device_api_level is an API 24 API, whereas flutter supports
down to API 21. We have other places in the engine that use this API but
they're not on paths that work < 29. Even though the ndk API seems to
work on older devices we should still probably not rely on it...
2025-02-28 01:59:42 +00:00
Gray Mackall
c9c3e74747
Add empty io.flutter.app.FlutterApplication to give deprecation notice, and un-break projects that have not migrated ( #164233 )
...
The removal of the v1 embedding missed that this class was not marked as
deprecated, and did not provide a notice in the breaking changes
section. V1 apps that needed the functionality of the old
`FlutterApplication` were all broken in the previous release, but some
V2 apps have been referencing the v1 `FlutterApplication`.
For these apps, this is the same as extending the base
`android.app.Application`. So we can provide an "empty extension" of
that base class, to provide these v2 apps a deprecation notice, and
avoid breaking them without warning (in 3.29.1).
Arbitrarily chose the `spell_checker` integration test to reference this
empty application, let me know if you think I should bring up an
entirely new devicelab test instead.
## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Gray Mackall <mackall@google.com>
2025-02-27 21:47:12 +00:00
Gray Mackall
b287365b21
Implement opacity FlutterMutator for hcpp ( #164147 )
...
This is essentially a reland of
https://github.com/flutter/engine/pull/30264/ , except that it only
applies the opacity if the new alpha (alpha = 255*opacity, where
opacity∈[0,1]) is different from the current alpha.
Also adds a new opacity screenshot test. Need to figure out how to bring
up a new screenshot test... does the screenshot get uploaded
automatically? Do I need to manually upload somewhere?
Fixes https://github.com/flutter/flutter/issues/164212
## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Gray Mackall <mackall@google.com>
2025-02-26 23:12:19 +00:00
Jonah Williams
04cc4b1f11
[Impeller] Reland: move AHB check into Flutter main, don't disable ImageReader on 29. ( #164201 )
...
Rather than conditionally disabling AHBs, just disable Vulkan on devices
where AHB imports don't work. FIx from last time is in the last commit,
I reversed the string check accidentally and disabled vulkan everywhere
🥺
https://github.com/flutter/flutter/issues/163473
https://github.com/flutter/flutter/issues/160854
2025-02-26 20:53:57 +00:00
Jonah Williams
ac9f68b12d
[Impeller] detect mediatek soc and fall back to GLES. ( #164126 )
...
If the device is _probably_ mediatek, then use OpenGL. We may relax this
check if the future if we find a mediatek soc that works well w/ Vulkan.
2025-02-26 05:07:59 +00:00
Jonah Williams
8bb34f2c20
[Impeller] make DLOG into LOG for startup errors. ( #164110 )
...
Make logs visible to help debug
https://github.com/flutter/flutter/issues/163532 . Right now we can't
see why context creation is failing.
It may be an EGL config issue.
2025-02-26 05:07:59 +00:00
auto-submit[bot]
cca82ed93b
Reverts "[Impeller] move AHB check to Vulkan, use Vulkan surface on 29. ( #164109 )" ( #164166 )
...
<!-- start_original_pr_link -->
Reverts: flutter/flutter#164109
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: jonahwilliams
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: brain not work too good.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: jonahwilliams
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {matanlurey}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
Rather than conditionally disabling AHBs, just disable Vulkan on devices
where AHB imports don't work.
https://github.com/flutter/flutter/issues/163473
https://github.com/flutter/flutter/issues/160854
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-02-26 04:32:26 +00:00
Jonah Williams
8b3f1a4c0f
[Impeller] move AHB check to Vulkan, use Vulkan surface on 29. ( #164109 )
...
Rather than conditionally disabling AHBs, just disable Vulkan on devices
where AHB imports don't work.
https://github.com/flutter/flutter/issues/163473
https://github.com/flutter/flutter/issues/160854
2025-02-26 02:50:12 +00:00
Jim Graham
f825cccda2
[DisplayList] Delete all legacy Skia-oriented method overloads in DlCanvas ( #164054 )
...
Delete remaining DlCanvas method overloads that were allowing the use of
Skia geometry objects in rendering code.
The only remaining uses of Skia classes in the DlCanvas interface are
SkImageInfo and SkTextBlob.
2025-02-26 00:44:27 +00:00
Matan Lurey
7535cb10bc
Move AndroidRenderingApi from common to shell/platform/android ( #163796 )
...
Towards https://github.com/flutter/flutter/issues/163792 .
Major changes:
- `enum class AndroidRenderingAPI` physically moves to
`shell/platform/android`
- Store in `FlutterMain` (as a result of `::init`), instead of in
`Settings`
---------
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
2025-02-25 02:40:29 +00:00
Gray Mackall
7d23780c7f
[remake] Restore old back handling for FlutterFragmentActivity ( #161545 )
...
Remake of https://github.com/flutter/engine/pull/56565 . Quoting from an
old comment, slightly edited:
------------
https://github.com/flutter/engine/pull/52302 seems to have
unintentionally had the effect of not allowing people to "opt out" of
predictive back. This is actually aligned with what the android docs say
should happen:
https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture
> Note: OnBackPressedCallback is always called regardless of the value
of android:enableOnBackInvokedCallback. In other words, disabling the
system animation doesn't affect your app's back handling logic if it
uses OnBackPressedCallback.
But this wasn't actually true for flutter apps before
https://github.com/flutter/engine/pull/52302 , because we were not
calling `super`, and `FlutterFragmentActivity` extends a
`FragmentActivity` which in turn extends a `ComponentActivity`, which
uses the old `onBackPressed` to [invoke the new back
handling](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/java/androidx/activity/ComponentActivity.kt;l=587?q=ComponentActivity ):
```kotlin
override fun onBackPressed() {
onBackPressedDispatcher.onBackPressed()
}
```
So while the docs imply that removing the `onBackPressed` in
`FlutterFragmentActivity` shouldn't have had an effect, that wasn't true
because in our case we were consuming the back event and ignoring the
warning
```java
@Override
@SuppressWarnings("MissingSuperCall")
public void onBackPressed() {
flutterFragment.onBackPressed();
}
```
What all this means is that apps that _aren't_ opting in to predictive
back had their back handling migrated to the new code path
automatically. FlutterFragmentActivity was uniquely is forced into the
new back handling codepath by
https://github.com/flutter/engine/pull/52302 , which this PR fixes.
------------
## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Gray Mackall <mackall@google.com>
2025-02-21 22:22:24 +00:00
Matan Lurey
177b7e6091
Restore linux_android_emulator_tests to CI. ( #163747 )
...
Closes https://github.com/flutter/flutter/issues/163742 .
Removed JSON files for testing emulator API variations (that was only
applicable for Scenario App).
2025-02-20 22:34:34 +00:00
Jonah Williams
e7d167cca2
[android] use macro definition to shrink repetitive JNI code size. ( #163395 )
...
But less code!
2025-02-18 21:31:36 +00:00
Matan Lurey
9ffdd3a0ec
Show 'started' messages, explain how to debug hangs in the Android JUnit tests ( #163242 )
...
There is more work to do, i.e.
https://github.com/flutter/flutter/issues/163239 , to make this a better
experience, but better than nothing.
2025-02-13 22:50:09 +00:00
Jonah Williams
128caa701f
[Impeller] disable Vulkan on known bad exynos SoCs. ( #163236 )
...
The common theme in:
* https://github.com/flutter/flutter/issues/160854
* https://github.com/flutter/flutter/issues/160804
* https://github.com/flutter/flutter/issues/158091
Is that the Samsung exynos chipset has problems with AHB imports.
Unfortunately some of the reported bugs are hard crashes/. While I
couldn't reproduce the crash itself, it does indicate to me that
attempting to feature detect if AHB imports work is probably too risky
(and potentially slow, as we'd have to do a read back).
While the Vulkan drivers otherwise work, the deivces in question are not
able to reliably import AHBs which prevents platform views from working.
This may not fix all issues as there could be different SoC models that
also have problems. I considered removing 29 support as well, but there
are a large number of APi 29 devices that work fine.
2025-02-13 21:01:37 +00:00
Jonah Williams
1cd3ab16ca
[android] correct API availibility checks for hcpp. ( #163226 )
...
This fixes the HCPP crashes in devicelab by correctly disabling HCPP for
devices that are < API level 34. Unfortunately this means we can't
benchmark on CI until we update the devices.
2025-02-13 17:39:48 +00:00
Jonah Williams
a0dca0c30a
[Android] add missing null check to java object for hcpp mode. ( #163165 )
...
This can be hit if the FlutterJNI has been disconnected. In this case,
it is correct to return a nullptr as the engine can create its own
trasnaction.
2025-02-13 00:58:48 +00:00
Jonah Williams
a7a4da95c9
[Android] increment shared_ptr for jni impl. ( #163152 )
...
More speculative fixes for crashing. Since we were closing over a ref,
maybe it is nullptr? Lets check with an FML_CHECK too.
2025-02-12 20:49:48 +00:00
Jonah Williams
ad74f9f0cd
[android] speculative fix for hcpp crashes. ( #163108 )
...
The crash indicates that FlutterJNI is returning a nullptr
SurfaceControl.Transaction. That likely indicates that we're trying to
rasterize a frame before the platform view controller is setup.
Potentially a startup race?
At any rate, if the PVC is null that means there is no platform views -
so it should be safe to create a tx on the fly. Interestingly I cannot
repro this locally even on the same device.
```
[2025-02-11 21:50:37.462356] [STDOUT] stdout: [ +173 ms] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
[2025-02-11 21:50:37.462539] [STDOUT] stdout: [ ] Build fingerprint: 'google/cheetah/cheetah:13/TQ3A.230901.001/10750268:user/release-keys'
[2025-02-11 21:50:37.462564] [STDOUT] stdout: [ ] Revision: 'MP1.0'
[2025-02-11 21:50:37.463914] [STDOUT] stdout: [ +1 ms] ABI: 'arm64'
[2025-02-11 21:50:37.463946] [STDOUT] stdout: [ ] Timestamp: 2025-02-11 21:57:42.183302140-0800
[2025-02-11 21:50:37.463959] [STDOUT] stdout: [ ] Process uptime: 3s
[2025-02-11 21:50:37.464054] [STDOUT] stdout: [ ] Cmdline: dev.benchmarks.platform_views_layout
[2025-02-11 21:50:37.464174] [STDOUT] stdout: [ ] pid: 15185, tid: 15246, name: 1.raster >>> dev.benchmarks.platform_views_layout <<<
[2025-02-11 21:50:37.464354] [STDOUT] stdout: [ ] uid: 10250
[2025-02-11 21:50:37.464398] [STDOUT] stdout: [ ] tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
[2025-02-11 21:50:37.464440] [STDOUT] stdout: [ ] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000
[2025-02-11 21:50:37.464602] [STDOUT] stdout: [ ] Cause: null pointer dereference
[2025-02-11 21:50:37.464651] [STDOUT] stdout: [ ] x0 b400007b82ff2e70 x1 000000000000002d x2 b400007c3309f370 x3 0000007abbcc6a23
[2025-02-11 21:50:37.464745] [STDOUT] stdout: [ ] x4 0000007a30d286b0 x5 0000007a4f6dd47b x6 0000000000000000 x7 61686b4b11ff3a78
[2025-02-11 21:50:37.464831] [STDOUT] stdout: [ ] x8 0000000000000000 x9 1417c2bd490e1f78 x10 0000000000000010 x11 000000000000009c
[2025-02-11 21:50:37.464933] [STDOUT] stdout: [ ] x12 0000000000000adb x13 b400007ba2fe9510 x14 0000000000000e6b x15 b400007ba2fe9510
[2025-02-11 21:50:37.465012] [STDOUT] stdout: [ ] x16 0000000000000001 x17 0000000000000067 x18 0000007a2f996000 x19 b400007b82ff2e70
[2025-02-11 21:50:37.465082] [STDOUT] stdout: [ ] x20 000000000000002d x21 b400007ae3064b60 x22 b400007af30d0fa8 x23 0000000000000001
[2025-02-11 21:50:37.465155] [STDOUT] stdout: [ ] x24 0000007a30d2a000 x25 b400007b73028fb0 x26 0000007a3a22da20 x27 000000003b9bf6c8
[2025-02-11 21:50:37.465235] [STDOUT] stdout: [ ] x28 b400007af30d0fa8 x29 b400007ad3022cd0
[2025-02-11 21:50:37.465318] [STDOUT] stdout: [ ] lr 0000007a3a8c7918 sp 0000007a30d28940 pc 0000000000000000 pst 0000000040001000
[2025-02-11 21:50:37.465401] [STDOUT] stdout: [ ] backtrace:
[2025-02-11 21:50:37.465491] [STDOUT] stdout: [ ] #00 pc 0000000000000000 <unknown>
[2025-02-11 21:50:37.465596] [STDOUT] stdout: [ ] #01 pc 000000000088b914 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::PlatformViewAndroidJNIImpl::createTransaction()+104) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.465688] [STDOUT] stdout: [ ] #02 pc 000000000087f738 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<flutter::AndroidSurfaceVKImpeller::SetNativeWindow(fml::RefPtr<flutter::AndroidNativeWindow>, std::_fl::shared_ptr<flutter::PlatformViewAndroidJNI> const&)::$_0, std::_fl::allocator<flutter::AndroidSurfaceVKImpeller::SetNativeWindow(fml::RefPtr<flutter::AndroidNativeWindow>, std::_fl::shared_ptr<flutter::PlatformViewAndroidJNI> const&)::$_0>, impeller::android::SurfaceTransaction ()>::operator()()+16) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.465785] [STDOUT] stdout: [ ] #03 pc 0000000000bdbf1c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<impeller::AHBSwapchainImplVK::AcquireNextDrawable()::$_0, std::_fl::allocator<impeller::AHBSwapchainImplVK::AcquireNextDrawable()::$_0>, bool ()>::operator()()+1716) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.465874] [STDOUT] stdout: [ ] #04 pc 0000000000b1d180 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::SurfaceFrame::Submit()+148) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.465989] [STDOUT] stdout: [ ] #05 pc 0000000000beb2b4 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurfacesUnsafe(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> >, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> > > >)+1284) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466400] [STDOUT] stdout: [ ] #06 pc 0000000000beac58 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurfaces(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> >, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> > > >)+112) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466444] [STDOUT] stdout: [ ] #07 pc 0000000000bec144 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)::$_0, std::_fl::allocator<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)::$_0>, void (std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem> >)>::operator()(std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem> >&&)+192) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466468] [STDOUT] stdout: [ ] #08 pc 0000000000bebc48 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)+360) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466521] [STDOUT] stdout: [ ] #09 pc 0000000000bf9f7c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> >)::$_0>, std::_fl::allocator<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> >)::$_0> >, void ()>::operator()()+84) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466543] [STDOUT] stdout: [ ] #10 pc 00000000008a09ec /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopImpl::RunExpiredTasksNow()+728) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466667] [STDOUT] stdout: [ ] #11 pc 00000000008a4600 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopAndroid::MessageLoopAndroid()::$_0::__invoke(int, int, void*)+84) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466746] [STDOUT] stdout: [ ] #12 pc 0000000000011178 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+808) (BuildId: 0b4a793fa8045c04066d988c68bac8bb)
[2025-02-11 21:50:37.466784] [STDOUT] stdout: [ ] #13 pc 00000000000185e4 /system/lib64/libandroid.so (ALooper_pollOnce+100) (BuildId: 682dab490c18361d5d6527bcdd86cdfa)
[2025-02-11 21:50:37.466865] [STDOUT] stdout: [ ] #14 pc 00000000008a470c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopAndroid::Run()+28) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466903] [STDOUT] stdout: [ ] #15 pc 00000000008a283c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0, std::_fl::allocator<fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>, void ()>::operator()()+116) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.466943] [STDOUT] stdout: [ ] #16 pc 00000000008a2670 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::ThreadHandle::ThreadHandle(std::_fl::function<void ()>&&)::$_0::__invoke(void*)+8) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1)
[2025-02-11 21:50:37.467002] [STDOUT] stdout: [ ] #17 pc 00000000000c226c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: dc4001c2ef2dfc23467040797a96840c)
[2025-02-11 21:50:37.467058] [STDOUT] stdout: [ ] #18 pc 0000000000054a30 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: dc4001c2ef2dfc23467040797a96840c)
[2025-02-11 21:50:37.525275] [STDOUT] stdout: [ +57 ms] 00:00 [32m+0[0m[31m -1[0m: scrolling performance test (setUpAll) [1m[31m[E][0m[0m
```
2025-02-12 17:37:08 +00:00
Jonah Williams
761c1623ca
[Android] fix hcpp overlay layer intersection. ( #163024 )
...
Since we only have a single overlay layer, we need to diff out the
platform views that _would_ intersect if we did the correct layering.
2025-02-11 17:13:19 +00:00
Jonah Williams
7cd9e0f640
[Android] Remove overlay when platform views are removed from screen. ( #162908 )
...
When there are no more platform views, make sure the overlay layer is
hidden. When a platform view is added again, show the overlay. The
show/hide allows us to avoid continually recreating and destroying the
overlay surface + swapchain when a platform view slides in and out of
frame.
To further reduce memory usage, we could do a delayed de-allocation of
the overlay layer (say after 50 frames of no platform view, destroy it).
But I'm leaving this to a follow up.
2025-02-11 02:29:07 +00:00
Jonah Williams
9438fd4471
[Android] add runtime flag to determine if HCPP is supported. ( #163004 )
...
Developers will need to _conditionally_ use HCPP (or the framework will
need to handle it automatically). This requires the ability to query at
runtime whether HCPP mode is enabled + supported.
Add a message channel to do so, and add the usage of this to the
android_engine_test. Does not yet add any automatic selection.
---------
Co-authored-by: Matan Lurey <matanlurey@users.noreply.github.com>
2025-02-10 22:43:25 +00:00
Jonah Williams
53bcdf2cda
[Android] Make PVC1 and PVC2 share a platform view registry. ( #162857 )
...
This avoids the insanity of having to register everything twice. Since
the object is shared a registration on pvc1 will automatically apply to
pvc2.
2025-02-08 01:05:00 +00:00
Jonah Williams
ec7cdbd126
[Android] Add missing API level check for hcpp ( #162901 )
...
Requires API 34
2025-02-07 21:52:35 +00:00
Jonah Williams
f0396970e9
[Android] HC++ wire up dart platform channel code and integration test. ( #162751 )
...
Use the PlatformViewController2 to register a platform view, allow the
dart side platform view logic to opt into this new platform view. Wires
up an integration test with android_engine_test.
2025-02-07 03:09:24 +00:00
Jonah Williams
17cb12d9bd
[Android] wire up Java Transaction to AHB swapchain. ( #162750 )
...
* When the opt in surface control setting is enabled (and the backend is
impeller vulkan) - then use the external view embedder 2.
* ALways create the SurfaceControl.Transaction in
PlatformViewController2 and manage it in Java. This was done for ease of
implementation. Rather than switching between SurfaceControl.Transaction
objects created in the native heap or created in java, we always go
through java. This also means that adding platform views shouldn't
change this flow.
* We may need to separate this after peformance profiling.
One more PR to go to wire up the new message channels and add the
integration_test.
2025-02-05 21:07:34 +00:00
Jonah Williams
8c11026d3f
[Android] HC++ external view embedder and JNI plumbing. ( #162493 )
...
Part of HC++ work. still not wired up end to end, but only requires a
few more swapchain changes and a runtime flag...
2025-02-05 01:09:13 +00:00
chunhtai
b0d95460e4
Refactors platform_view_android_delegate test ( #162696 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
Reduce magic number
## 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], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-05 00:08:24 +00:00
chunhtai
0e1df622a1
Adds urlspan to support link semantics in Android ( #162419 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
fixes https://github.com/flutter/flutter/issues/102535
## 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], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-04 18:59:47 +00:00
Jonah Williams
4d08217f8d
[Android] add lint ignores to Flutter JNI. ( #162527 )
...
These API calls are triggering lints in g3, which has stricter lints for
transitively calling higher API level methods.
2025-02-01 22:43:34 +00:00
Jonah Williams
a4927668cb
[Android] add HC++ platform view class. ( #161829 )
...
Part of the HC++ project for Android. This adds a current unused and
unusable separate manager class for the new platform view strategy.
Subsequent PRs will fill in the engine implementation as well as adding
a mechanism to detect if support is available and provide a framework
opt in.
2025-01-30 20:02:15 +00:00
Jonah Williams
a3fced5da1
[Impeller] Disable Vulkan on Emulators. ( #162454 )
...
Forces known android emulators to use OpenGLES. This is a very
conservative check that could be expanded over time if need be. For
testing emulators can still use the debug flags.
Fixes https://github.com/flutter/flutter/issues/160442
Fixes https://github.com/flutter/flutter/issues/160439
Fixes https://github.com/flutter/flutter/issues/155973
2025-01-30 19:41:04 +00:00
Jonah Williams
1eecbf1256
[Android] HC++ plumbing. ( #162407 )
...
We'll need the JNI fascade to create the surface transaction for HC++
mode. Split into a separate PR so that the "real" HC++ PR isn't 5000
lines long.
2025-01-30 18:04:40 +00:00
Chinmay Garde
cd586eea50
[DisplayList] Move nested canvas enums into their own TU. ( #162037 )
...
These cause ambiguous compiler reference errors on some GCC versions.
And, the errors seem right. But, newer versions of clang seem to resolve
that ambiguity by also checking if the references to the types are also
references to identical types.
Per the chat with Jim, also added the Dl prefix to those types.
No change in functionality. Just a rename of the types and removal of
the now unnecessary typedefs.
2025-01-27 22:00:01 +00:00
NabilaWorks
e0d7b588b6
Feature/twitter keyboard ( #161025 )
...
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
Fixes https://github.com/flutter/flutter/issues/64801
Example :
```dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Centered TextField Example',
theme: ThemeData(primarySwatch: Colors.blue),
home: CenteredTextFieldScreen(),
);
}
}
class CenteredTextFieldScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Centered TextField')),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: TextField(
keyboardType: TextInputType.twitter,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'Enter some text here',
),
),
),
),
);
}
}
```
https://github.com/user-attachments/assets/5a2a2a4a-6994-44b1-bb0e-395c24012ef8
https://github.com/user-attachments/assets/aefc7bc5-a997-4e0f-a74e-a39a4517c898
## 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], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Jenn Magder <magder@google.com>
2025-01-15 00:15:15 +00:00
jesswrd
d8322207df
Fixed XiaoMi statusBar Bug ( #161271 )
...
Updated usages of statusBar() to systemBar() to fix XiaoMi statusBar
bug.
Fixes #132831
## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-15 00:12:58 +00:00
Jonah Williams
96dffbeda5
[Impeller] fix scaling of trampoline import of GLES textures into Vulkan. ( #161331 )
...
Not sure if this just needs the dpr transform or the entire canvas
transform.
Fixes https://github.com/flutter/flutter/issues/159688
## Before

## After

2025-01-09 20:39:29 +00:00
Jonah Williams
6bda88b61b
[Impeller] add opt in flag for SurfaceControl testing. ( #161353 )
...
Adds an opt in flag for the Android surface control based swapchain.
This is off by default, but added for the sake of bug reports and
investigation of the functionality.
2025-01-09 16:09:41 +00:00
Matan Lurey
9467677fef
Change timing of onSurfaceDestroyed to match onSurfaceCleanup ( #161252 )
...
Follow-up to https://github.com/flutter/flutter/pull/160937
(https://github.com/flutter/flutter/issues/160933 ).
This more or less mirrors what we did already for `onSurfaceCreated` to
match `onSurfaceAvailable`.
With this approach, the master branch should immediately start seeing
better behavior in terms of being able to use the `onSurfaceDestroyed`
callback effectively (before the surface has been released). For
example, for a plugin that already uses `onSurfaceDestroyed`, [i.e
`camerax`](97ce56a68e/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java ):
```java
@Override
public void onSurfaceDestroyed() {
// Invalidate the SurfaceRequest so that CameraX knows to to make a new request
// for a surface.
request.invalidate();
}
```
... the request is now invalidated _before_ the surface has been
destroyed, which is what (I believe) we wanted?
---
Folks that want to publish package updates that _definitely_ use the
correct timing will have to wait for the next stable.
/cc @hasali19 would be great to get your input here.
2025-01-07 21:15:09 +00:00
Matan Lurey
351f2742af
Add SurfaceProducer.onSurfaceCleanup, deprecate onSurfaceDestroyed. ( #160937 )
...
Closes https://github.com/flutter/flutter/issues/160933 .
The timing of this callback gives our users (and plugin authors) a
chance to stop using the `Surface` before it becomes invalid, allowing
us to fix https://github.com/flutter/flutter/issues/156488 - we no
longer need to do shenanigans on storing and restoring state because
`ExoPlayer` can now handle it out of the box; see
https://github.com/flutter/flutter/issues/160933#issuecomment-2564092567 .
It's unfortunate we have to go through a bit of churn on the callback
API, but realistically this _is_ the feedback we were looking for when
originally creating it - it just took longer than expected due to the
long release cycle.
/cc @hasali19, @xxoo, @camsim99
2025-01-06 18:03:11 +00:00