Skip to content

Commit c56313e

Browse files
committed
Merge branch 'main' of github.com:flutter/packages
2 parents 5dc3577 + ff587b7 commit c56313e

File tree

453 files changed

+7250
-2977
lines changed

Some content is hidden

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

453 files changed

+7250
-2977
lines changed

.ci.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -295,21 +295,21 @@ targets:
295295
timeout: 30
296296
properties:
297297
target_file: analyze_legacy.yaml
298-
channel: "3.13.9"
298+
channel: "3.16.9"
299299
env_variables: >-
300300
{
301-
"CHANNEL": "3.13.9"
301+
"CHANNEL": "3.16.9"
302302
}
303303
304304
- name: Linux analyze_legacy N-2
305305
recipe: packages/packages
306306
timeout: 30
307307
properties:
308308
target_file: analyze_legacy.yaml
309-
channel: "3.10.6"
309+
channel: "3.13.9"
310310
env_variables: >-
311311
{
312-
"CHANNEL": "3.10.6"
312+
"CHANNEL": "3.13.9"
313313
}
314314
315315
- name: Linux_android custom_package_tests master
@@ -1472,6 +1472,7 @@ targets:
14721472
14731473
- name: Windows_arm64 windows-build_all_packages master
14741474
recipe: packages/packages
1475+
presubmit: false
14751476
timeout: 30
14761477
bringup: true # https://github.com/flutter/flutter/issues/134083
14771478
properties:
@@ -1506,6 +1507,7 @@ targets:
15061507
15071508
- name: Windows_arm64 windows-build_all_packages stable
15081509
recipe: packages/packages
1510+
presubmit: false
15091511
timeout: 30
15101512
bringup: true
15111513
properties:

.ci/flutter_master.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
eb5d0a434ef13d34b532aa8c53a7be64b88963c2
1+
41581c9a1b909e481c13a2cee7a6e133f7e2ab1e

.ci/flutter_stable.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
41456452f29d64e8deb623a3c927524bcf9f111b
1+
abb292a07e20d696c4568099f918f6c5f330e6b0

.ci/legacy_project/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ and then deleting everything but `android/` from it:
3939
jcenter.bintray.com shutdown.
4040
- Update `compileSdkVersion` from 30 to 33 to maintain compatibility
4141
with plugins that use API 34.
42+
- Updates `gradle-wrapper.properties` from `6.7` to `6.7.1`, to add
43+
support for the Kotlin gradle plugin. If a user runs into this
44+
error, the error message is clear on how to upgrade.

.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

.ci/targets/repo_checks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tasks:
1919
script: .ci/scripts/tool_runner.sh
2020
args:
2121
- "pubspec-check"
22-
- "--min-min-flutter-version=3.10.0"
22+
- "--min-min-flutter-version=3.13.0"
2323
- "--allow-dependencies=script/configs/allowed_unpinned_deps.yaml"
2424
- "--allow-pinned-dependencies=script/configs/allowed_pinned_deps.yaml"
2525
always: true

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# the change if it doesn't.
3232
run: |
3333
cd $HOME
34-
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.16.6 _flutter
34+
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.19.0 _flutter
3535
echo "$HOME/_flutter/bin" >> $GITHUB_PATH
3636
cd $GITHUB_WORKSPACE
3737
# Checks out a copy of the repo.

.github/workflows/scorecards-analysis.yml

+1-1
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@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v1.0.26
52+
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v1.0.26
5353
with:
5454
sarif_file: results.sarif

analysis_options.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ analyzer:
1111
strict-inference: true
1212
strict-raw-types: true
1313
errors:
14-
# allow self-reference to deprecated members (we do this because otherwise we have
15-
# to annotate every member in every test, assert, etc, when we deprecate something)
14+
# allow deprecated members (we do this because otherwise we have to annotate
15+
# every member in every test, assert, etc, when we or the Dart SDK deprecates
16+
# something (https://github.com/flutter/flutter/issues/143312)
17+
deprecated_member_use: ignore
1618
deprecated_member_use_from_same_package: ignore
1719
exclude: # DIFFERENT FROM FLUTTER/FLUTTER
1820
# Ignore generated files

packages/animations/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
4+
15
## 2.0.11
26

37
* Fixes new lint warnings.

packages/animations/example/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ publish_to: none
66
version: 0.0.1
77

88
environment:
9-
sdk: ">=3.0.0 <4.0.0"
10-
flutter: ">=3.10.0"
9+
sdk: ^3.1.0
10+
flutter: ">=3.13.0"
1111

1212
dependencies:
1313
animations:

packages/camera/camera/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## NEXT
22

3+
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
34
* Updates support matrix in README to indicate that iOS 11 is no longer supported.
45
* Clients on versions of Flutter that still support iOS 11 can continue to use this
56
package with iOS 11, but will not receive any further updates to the iOS implementation.

packages/camera/camera/example/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin.
33
publish_to: none
44

55
environment:
6-
sdk: ">=3.0.0 <4.0.0"
7-
flutter: ">=3.10.0"
6+
sdk: ^3.1.0
7+
flutter: ">=3.13.0"
88

99
dependencies:
1010
camera:

packages/camera/camera/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
77
version: 0.10.5+9
88

99
environment:
10-
sdk: ">=3.0.0 <4.0.0"
11-
flutter: ">=3.10.0"
10+
sdk: ^3.1.0
11+
flutter: ">=3.13.0"
1212

1313
flutter:
1414
plugin:

packages/camera/camera_android/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## NEXT
22

3+
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
34
* Updates compileSdk version to 34.
45

56
## 0.10.8+16

packages/camera/camera_android/example/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin.
33
publish_to: none
44

55
environment:
6-
sdk: ">=3.0.0 <4.0.0"
7-
flutter: ">=3.10.0"
6+
sdk: ^3.1.0
7+
flutter: ">=3.13.0"
88

99
dependencies:
1010
camera_android:

packages/camera/camera_android/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
66
version: 0.10.8+16
77

88
environment:
9-
sdk: ">=3.0.0 <4.0.0"
10-
flutter: ">=3.10.0"
9+
sdk: ^3.1.0
10+
flutter: ">=3.13.0"
1111

1212
flutter:
1313
plugin:

packages/camera/camera_android_camerax/CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## 0.5.0+35
2+
3+
* Modifies `CameraInitializedEvent` that is sent when the camera is initialized to indicate that the initial focus
4+
and exposure modes are auto and that developers may set focus and exposure points.
5+
6+
## 0.5.0+34
7+
8+
* Implements `setFocusPoint`, `setExposurePoint`, and `setExposureOffset`.
9+
10+
## 0.5.0+33
11+
12+
* Fixes typo in `README.md`.
13+
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
14+
115
## 0.5.0+32
216

317
* Removes all remaining `unawaited` calls to fix potential race conditions and updates the

packages/camera/camera_android_camerax/README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ the title, which will be actively triaged.
1212

1313
This package is [non-endorsed][3]; the endorsed Android implementation of `camera`
1414
is [`camera_android`][4]. To use this implementation of the plugin instead of
15-
`camera_android`, you will need to specify it in your `pubsepc.yaml` file as a
15+
`camera_android`, you will need to specify it in your `pubspec.yaml` file as a
1616
dependency in addition to `camera`:
1717

1818
```yaml
@@ -24,20 +24,19 @@ dependencies:
2424
2525
## Missing features and limitations
2626
27-
2827
### 240p resolution configuration for video recording
2928
3029
240p resolution configuration for video recording is unsupported by CameraX,
3130
and thus, the plugin will fall back to 480p if configured with a
3231
`ResolutionPreset`.
3332

34-
### Exposure mode, point, & offset configuration \[[Issue #120468][120468]\]
33+
### Exposure mode configuration \[[Issue #120468][120468]\]
3534

36-
`setExposureMode`, `setExposurePoint`, & `setExposureOffset` are unimplemented.
35+
`setExposureMode`is unimplemented.
3736

38-
### Focus mode & point configuration \[[Issue #120467][120467]\]
37+
### Focus mode configuration \[[Issue #120467][120467]\]
3938

40-
`setFocusMode` & `setFocusPoint` are unimplemented.
39+
`setFocusMode` is unimplemented.
4140

4241
### Setting maximum duration and stream options for video capture
4342

packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraAndroidCameraxPlugin.java

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity
2727
@VisibleForTesting @Nullable public ImageCaptureHostApiImpl imageCaptureHostApiImpl;
2828
@VisibleForTesting @Nullable public CameraControlHostApiImpl cameraControlHostApiImpl;
2929
@VisibleForTesting @Nullable public SystemServicesHostApiImpl systemServicesHostApiImpl;
30+
@VisibleForTesting @Nullable public MeteringPointHostApiImpl meteringPointHostApiImpl;
3031

3132
@VisibleForTesting
3233
public @Nullable DeviceOrientationManagerHostApiImpl deviceOrientationManagerHostApiImpl;
@@ -119,6 +120,12 @@ public void setUp(
119120
cameraControlHostApiImpl =
120121
new CameraControlHostApiImpl(binaryMessenger, instanceManager, context);
121122
GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl);
123+
GeneratedCameraXLibrary.FocusMeteringActionHostApi.setup(
124+
binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager));
125+
GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup(
126+
binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager));
127+
meteringPointHostApiImpl = new MeteringPointHostApiImpl(instanceManager);
128+
GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, meteringPointHostApiImpl);
122129
}
123130

124131
@Override
@@ -238,5 +245,8 @@ public void updateActivity(@Nullable Activity activity) {
238245
if (deviceOrientationManagerHostApiImpl != null) {
239246
deviceOrientationManagerHostApiImpl.setActivity(activity);
240247
}
248+
if (meteringPointHostApiImpl != null) {
249+
meteringPointHostApiImpl.setActivity(activity);
250+
}
241251
}
242252
}

packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraControlHostApiImpl.java

+24
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ public void onSuccess(Void voidResult) {
8383
}
8484

8585
public void onFailure(Throwable t) {
86+
if (t instanceof CameraControl.OperationCanceledException) {
87+
// Operation was canceled due to camera being closed or a new request was submitted, which
88+
// is not actionable and should not block a new value from potentially being submitted.
89+
result.success(null);
90+
return;
91+
}
8692
result.error(t);
8793
}
8894
},
@@ -94,6 +100,9 @@ public void onFailure(Throwable t) {
94100
*
95101
* <p>Will trigger an auto focus action and enable auto focus/auto exposure/auto white balance
96102
* metering regions.
103+
*
104+
* <p>Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was
105+
* canceled.
97106
*/
98107
public void startFocusAndMetering(
99108
@NonNull CameraControl cameraControl,
@@ -117,6 +126,12 @@ public void onSuccess(FocusMeteringResult focusMeteringResult) {
117126
}
118127

119128
public void onFailure(Throwable t) {
129+
if (t instanceof CameraControl.OperationCanceledException) {
130+
// Operation was canceled due to camera being closed or a new request was submitted, which
131+
// is not actionable and should not block a new value from potentially being submitted.
132+
result.success(null);
133+
return;
134+
}
120135
result.error(t);
121136
}
122137
},
@@ -152,6 +167,9 @@ public void onFailure(Throwable t) {
152167
* <p>The exposure compensation value set on the camera must be within the range of {@code
153168
* ExposureState#getExposureCompensationRange()} for the current {@code ExposureState} for the
154169
* call to succeed.
170+
*
171+
* <p>Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was
172+
* canceled.
155173
*/
156174
public void setExposureCompensationIndex(
157175
@NonNull CameraControl cameraControl, @NonNull Long index, @NonNull Result<Long> result) {
@@ -166,6 +184,12 @@ public void onSuccess(Integer integerResult) {
166184
}
167185

168186
public void onFailure(Throwable t) {
187+
if (t instanceof CameraControl.OperationCanceledException) {
188+
// Operation was canceled due to camera being closed or a new request was submitted, which
189+
// is not actionable and should not block a new value from potentially being submitted.
190+
result.success(null);
191+
return;
192+
}
169193
result.error(t);
170194
}
171195
},

packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java

+28-4
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ private CameraStateType(final int index) {
8383
* <p>If you need to add another type to support a type S to use a LiveData<S> in this plugin,
8484
* ensure the following is done on the Dart side:
8585
*
86-
* <p>* In `../lib/src/live_data.dart`, add new cases for S in
86+
* <p>* In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in
8787
* `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a
8888
* LiveData<S> instance and in `LiveDataFlutterApiImpl#create` to create the expected type of
8989
* LiveData<S> when requested.
9090
*
9191
* <p>On the native side, ensure the following is done:
9292
*
93-
* <p>* Update `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for
93+
* <p>* Make sure `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for
9494
* instances of type S. * Update `ObserverFlutterApiWrapper#onChanged` to properly handle
9595
* receiving calls with instances of type S if a LiveData<S> instance is observed.
9696
*/
@@ -146,6 +146,24 @@ private VideoResolutionFallbackRule(final int index) {
146146
}
147147
}
148148

149+
/**
150+
* The types of capture request options this plugin currently supports.
151+
*
152+
* <p>If you need to add another option to support, ensure the following is done on the Dart side:
153+
*
154+
* <p>* In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this
155+
* option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` to create the expected Map
156+
* entry of option key index and value to send to the native side.
157+
*
158+
* <p>On the native side, ensure the following is done:
159+
*
160+
* <p>* Update `CaptureRequestOptionsHostApiImpl#create` to set the correct `CaptureRequest` key
161+
* with a valid value type for this option.
162+
*
163+
* <p>See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest for the
164+
* sorts of capture request options that can be supported via CameraX's interoperability with
165+
* Camera2.
166+
*/
149167
public enum CaptureRequestKeySupportedType {
150168
CONTROL_AE_LOCK(0);
151169

@@ -3899,7 +3917,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply<Void> callback) {
38993917
public interface MeteringPointHostApi {
39003918

39013919
void create(
3902-
@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size);
3920+
@NonNull Long identifier,
3921+
@NonNull Double x,
3922+
@NonNull Double y,
3923+
@Nullable Double size,
3924+
@NonNull Long cameraInfoId);
39033925

39043926
@NonNull
39053927
Double getDefaultPointSize();
@@ -3927,12 +3949,14 @@ static void setup(
39273949
Double xArg = (Double) args.get(1);
39283950
Double yArg = (Double) args.get(2);
39293951
Double sizeArg = (Double) args.get(3);
3952+
Number cameraInfoIdArg = (Number) args.get(4);
39303953
try {
39313954
api.create(
39323955
(identifierArg == null) ? null : identifierArg.longValue(),
39333956
xArg,
39343957
yArg,
3935-
sizeArg);
3958+
sizeArg,
3959+
(cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue());
39363960
wrapped.add(0, null);
39373961
} catch (Throwable exception) {
39383962
ArrayList<Object> wrappedError = wrapError(exception);

0 commit comments

Comments
 (0)