Skip to content

Commit e89b7c2

Browse files
committed
Merge remote-tracking branch 'upstream/main' into show-title-implementations
2 parents caac897 + 0f677d3 commit e89b7c2

File tree

147 files changed

+9068
-1615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+9068
-1615
lines changed

.ci.yaml

Lines changed: 26 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ platform_properties:
2727
[
2828
{"dependency": "android_sdk", "version": "version:33v6"},
2929
{"dependency": "open_jdk", "version": "version:17"},
30-
{"dependency": "curl", "version": "version:7.64.0"}
30+
{"dependency": "curl", "version": "version:7.64.0"},
31+
{"dependency": "avd_cipd_version", "version": "build_id:8759428741582061553"}
3132
]
3233
linux_android_legacy:
3334
properties:
@@ -39,7 +40,8 @@ platform_properties:
3940
{"dependency": "android_sdk", "version": "version:33v6"},
4041
{"dependency": "open_jdk", "version": "version:17"},
4142
{"dependency": "curl", "version": "version:7.64.0"},
42-
{"dependency": "android_virtual_device", "version": "22"}
43+
{"dependency": "android_virtual_device", "version": "generic_android22.textpb"},
44+
{"dependency": "avd_cipd_version", "version": "build_id:8759428741582061553"}
4345
]
4446
linux_desktop:
4547
properties:
@@ -107,20 +109,6 @@ platform_properties:
107109
}
108110
109111
targets:
110-
### Linux-host general tasks ###
111-
- name: Linux repo_tools_tests
112-
recipe: packages/packages
113-
timeout: 30
114-
properties:
115-
add_recipes_cq: "true"
116-
target_file: repo_tools_tests.yaml
117-
channel: master
118-
version_file: flutter_master.version
119-
env_variables: >-
120-
{
121-
"CHANNEL": "master"
122-
}
123-
124112
- name: Linux repo_checks
125113
recipe: packages/packages
126114
timeout: 30
@@ -281,19 +269,10 @@ targets:
281269
"CHANNEL": "stable"
282270
}
283271
284-
- name: Linux analyze_downgraded master
285-
recipe: packages/packages
286-
timeout: 30
287-
properties:
288-
add_recipes_cq: "true"
289-
target_file: analyze_downgraded.yaml
290-
channel: master
291-
version_file: flutter_master.version
292-
env_variables: >-
293-
{
294-
"CHANNEL": "master"
295-
}
296-
272+
# This is only run on stable since it's extremely likely that stable will
273+
# resolve to packages that are older (or at least as old) than on master, so
274+
# running a second copy with master is very unlikely to catch anything that
275+
# this doesn't.
297276
- name: Linux analyze_downgraded stable
298277
recipe: packages/packages
299278
timeout: 30
@@ -344,7 +323,7 @@ targets:
344323
# web_benchmarks needs Chrome.
345324
dependencies: >-
346325
[
347-
{"dependency": "android_virtual_device", "version": "34"},
326+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"},
348327
{"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"},
349328
{"dependency": "chrome_and_driver", "version": "version:114.0"}
350329
]
@@ -365,7 +344,7 @@ targets:
365344
# See comments on 'master' version above.
366345
dependencies: >-
367346
[
368-
{"dependency": "android_virtual_device", "version": "34"},
347+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"},
369348
{"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"},
370349
{"dependency": "chrome_and_driver", "version": "version:114.0"}
371350
]
@@ -426,7 +405,7 @@ targets:
426405
package_sharding: "--shardIndex 0 --shardCount 6"
427406
dependencies: >-
428407
[
429-
{"dependency": "android_virtual_device", "version": "34"}
408+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
430409
]
431410
env_variables: >-
432411
{
@@ -445,7 +424,7 @@ targets:
445424
package_sharding: "--shardIndex 1 --shardCount 6"
446425
dependencies: >-
447426
[
448-
{"dependency": "android_virtual_device", "version": "34"}
427+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
449428
]
450429
env_variables: >-
451430
{
@@ -464,7 +443,7 @@ targets:
464443
package_sharding: "--shardIndex 2 --shardCount 6"
465444
dependencies: >-
466445
[
467-
{"dependency": "android_virtual_device", "version": "34"}
446+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
468447
]
469448
env_variables: >-
470449
{
@@ -483,7 +462,7 @@ targets:
483462
package_sharding: "--shardIndex 3 --shardCount 6"
484463
dependencies: >-
485464
[
486-
{"dependency": "android_virtual_device", "version": "34"}
465+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
487466
]
488467
env_variables: >-
489468
{
@@ -502,7 +481,7 @@ targets:
502481
package_sharding: "--shardIndex 4 --shardCount 6"
503482
dependencies: >-
504483
[
505-
{"dependency": "android_virtual_device", "version": "34"}
484+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
506485
]
507486
env_variables: >-
508487
{
@@ -521,7 +500,7 @@ targets:
521500
package_sharding: "--shardIndex 5 --shardCount 6"
522501
dependencies: >-
523502
[
524-
{"dependency": "android_virtual_device", "version": "34"}
503+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
525504
]
526505
env_variables: >-
527506
{
@@ -540,7 +519,7 @@ targets:
540519
package_sharding: "--shardIndex 0 --shardCount 2"
541520
dependencies: >-
542521
[
543-
{"dependency": "android_virtual_device", "version": "33"}
522+
{"dependency": "android_virtual_device", "version": "android_33_google_apis_x64.textpb"}
544523
]
545524
env_variables: >-
546525
{
@@ -559,7 +538,7 @@ targets:
559538
package_sharding: "--shardIndex 1 --shardCount 2"
560539
dependencies: >-
561540
[
562-
{"dependency": "android_virtual_device", "version": "33"}
541+
{"dependency": "android_virtual_device", "version": "android_33_google_apis_x64.textpb"}
563542
]
564543
env_variables: >-
565544
{
@@ -578,7 +557,7 @@ targets:
578557
package_sharding: "--shardIndex 0 --shardCount 6"
579558
dependencies: >-
580559
[
581-
{"dependency": "android_virtual_device", "version": "34"}
560+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
582561
]
583562
env_variables: >-
584563
{
@@ -597,7 +576,7 @@ targets:
597576
package_sharding: "--shardIndex 1 --shardCount 6"
598577
dependencies: >-
599578
[
600-
{"dependency": "android_virtual_device", "version": "34"}
579+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
601580
]
602581
env_variables: >-
603582
{
@@ -616,7 +595,7 @@ targets:
616595
package_sharding: "--shardIndex 2 --shardCount 6"
617596
dependencies: >-
618597
[
619-
{"dependency": "android_virtual_device", "version": "34"}
598+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
620599
]
621600
env_variables: >-
622601
{
@@ -635,7 +614,7 @@ targets:
635614
package_sharding: "--shardIndex 3 --shardCount 6"
636615
dependencies: >-
637616
[
638-
{"dependency": "android_virtual_device", "version": "34"}
617+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
639618
]
640619
env_variables: >-
641620
{
@@ -654,7 +633,7 @@ targets:
654633
package_sharding: "--shardIndex 4 --shardCount 6"
655634
dependencies: >-
656635
[
657-
{"dependency": "android_virtual_device", "version": "34"}
636+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
658637
]
659638
env_variables: >-
660639
{
@@ -673,7 +652,7 @@ targets:
673652
package_sharding: "--shardIndex 5 --shardCount 6"
674653
dependencies: >-
675654
[
676-
{"dependency": "android_virtual_device", "version": "34"}
655+
{"dependency": "android_virtual_device", "version": "android_34_google_apis_x64.textpb"}
677656
]
678657
env_variables: >-
679658
{
@@ -691,7 +670,7 @@ targets:
691670
package_sharding: "--shardIndex 0 --shardCount 2"
692671
dependencies: >-
693672
[
694-
{"dependency": "android_virtual_device", "version": "33"}
673+
{"dependency": "android_virtual_device", "version": "android_33_google_apis_x64.textpb"}
695674
]
696675
env_variables: >-
697676
{
@@ -709,7 +688,7 @@ targets:
709688
package_sharding: "--shardIndex 1 --shardCount 2"
710689
dependencies: >-
711690
[
712-
{"dependency": "android_virtual_device", "version": "33"}
691+
{"dependency": "android_virtual_device", "version": "android_33_google_apis_x64.textpb"}
713692
]
714693
env_variables: >-
715694
{

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19b06f4ee9a0027b0ece7ae7da783819294e5da8
1+
e02e2079bea7d04151e8d4240d70002e4b54186d

.ci/flutter_stable.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
67457e669f79e9f8d13d7a68fe09775fefbb79f4
1+
41456452f29d64e8deb623a3c927524bcf9f111b

.ci/targets/repo_checks.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ tasks:
22
- name: prepare tool
33
script: .ci/scripts/prepare_tool.sh
44
infra_step: true # Note infra steps failing prevents "always" from running.
5+
- name: tool unit tests
6+
script: .ci/scripts/plugin_tools_tests.sh
57
- name: format
68
script: script/tool_runner.sh
79
# Skip Swift formatting on Linux builders.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [ ] I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use `dart format`.)
1212
- [ ] I signed the [CLA].
1313
- [ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]`
14-
- [ ] I listed at least one issue that this PR fixes in the description above.
14+
- [ ] I [linked to at least one issue that this PR fixes] in the description above.
1515
- [ ] I updated `pubspec.yaml` with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
1616
- [ ] I updated `CHANGELOG.md` to add a description of the change, [following repository CHANGELOG style].
1717
- [ ] I updated/added relevant documentation (doc comments with `///`).
@@ -28,6 +28,7 @@ If you need help, consider asking for advice on the #hackers-new channel on [Dis
2828
[flutter/tests]: https://github.com/flutter/tests
2929
[breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
3030
[Discord]: https://github.com/flutter/flutter/wiki/Chat
31+
[linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
3132
[pub versioning philosophy]: https://dart.dev/tools/pub/versioning
3233
[exempt from version changes]: https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#version-and-changelog-updates
3334
[following repository CHANGELOG style]: https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style

.github/workflows/scorecards-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ jobs:
4949

5050
# Upload the results to GitHub's code scanning dashboard.
5151
- name: "Upload to code-scanning"
52-
uses: github/codeql-action/upload-sarif@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v1.0.26
52+
uses: github/codeql-action/upload-sarif@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v1.0.26
5353
with:
5454
sarif_file: results.sarif

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ use, and use auto-formatters:
4040
for more details, and exceptions.
4141
- [Java](https://google.github.io/styleguide/javaguide.html) formatted with
4242
`google-java-format`
43+
- [Kotlin](https://developer.android.com/kotlin/style-guide) formatted with
44+
`ktfmt`
4345
- [Objective-C](https://google.github.io/styleguide/objcguide.html) formatted with
4446
`clang-format`
4547
- [Swift](https://google.github.io/swift/) formatted with `swift-format`

packages/camera/camera_android_camerax/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.5.0+29
2+
3+
* Modifies `buildPreview` to return `Texture` that maps to camera preview, building in the assumption
4+
that `createCamera` should have been called before building the preview. Fixes
5+
https://github.com/flutter/flutter/issues/140567.
6+
17
## 0.5.0+28
28

39
* Wraps CameraX classes needed to implement setting focus and exposure points and exposure offset.

packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ class AndroidCameraCameraX extends CameraPlatform {
9898
@visibleForTesting
9999
String? videoOutputPath;
100100

101+
/// Whether or not [preview] has been bound to the lifecycle of the camera by
102+
/// [createCamera].
103+
@visibleForTesting
104+
bool previewInitiallyBound = false;
105+
101106
bool _previewIsPaused = false;
102107

103108
/// The prefix used to create the filename for video recording files.
@@ -284,6 +289,7 @@ class AndroidCameraCameraX extends CameraPlatform {
284289
camera = await processCameraProvider!.bindToLifecycle(
285290
cameraSelector!, <UseCase>[preview!, imageCapture!, imageAnalysis!]);
286291
await _updateCameraInfoAndLiveCameraState(flutterSurfaceTextureId);
292+
previewInitiallyBound = true;
287293
_previewIsPaused = false;
288294

289295
return flutterSurfaceTextureId;
@@ -520,21 +526,20 @@ class AndroidCameraCameraX extends CameraPlatform {
520526
}
521527

522528
/// Returns a widget showing a live camera preview.
529+
///
530+
/// [createCamera] must be called before attempting to build this preview.
523531
@override
524532
Widget buildPreview(int cameraId) {
525-
return FutureBuilder<void>(
526-
future: _bindPreviewToLifecycle(cameraId),
527-
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
528-
switch (snapshot.connectionState) {
529-
case ConnectionState.none:
530-
case ConnectionState.waiting:
531-
case ConnectionState.active:
532-
// Do nothing while waiting for preview to be bound to lifecyle.
533-
return const SizedBox.shrink();
534-
case ConnectionState.done:
535-
return Texture(textureId: cameraId);
536-
}
537-
});
533+
if (!previewInitiallyBound) {
534+
// No camera has been created, and thus, the preview UseCase has not been
535+
// bound to the camera lifecycle, restricting this preview from being
536+
// built.
537+
throw CameraException(
538+
'cameraNotFound',
539+
"Camera not found. Please call the 'create' method before calling 'buildPreview'",
540+
);
541+
}
542+
return Texture(textureId: cameraId);
538543
}
539544

540545
/// Captures an image and returns the file where it was saved.

packages/camera/camera_android_camerax/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera_android_camerax
22
description: Android implementation of the camera plugin using the CameraX library.
33
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
5-
version: 0.5.0+28
5+
version: 0.5.0+29
66

77
environment:
88
sdk: ">=3.0.0 <4.0.0"

0 commit comments

Comments
 (0)