Skip to content

Commit

Permalink
Merge branch 'main' of github.com:flutter/packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrinneal committed Feb 22, 2024
2 parents 5dc3577 + ff587b7 commit c56313e
Show file tree
Hide file tree
Showing 453 changed files with 7,250 additions and 2,977 deletions.
10 changes: 6 additions & 4 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,21 +295,21 @@ targets:
timeout: 30
properties:
target_file: analyze_legacy.yaml
channel: "3.13.9"
channel: "3.16.9"
env_variables: >-
{
"CHANNEL": "3.13.9"
"CHANNEL": "3.16.9"
}
- name: Linux analyze_legacy N-2
recipe: packages/packages
timeout: 30
properties:
target_file: analyze_legacy.yaml
channel: "3.10.6"
channel: "3.13.9"
env_variables: >-
{
"CHANNEL": "3.10.6"
"CHANNEL": "3.13.9"
}
- name: Linux_android custom_package_tests master
Expand Down Expand Up @@ -1472,6 +1472,7 @@ targets:
- name: Windows_arm64 windows-build_all_packages master
recipe: packages/packages
presubmit: false
timeout: 30
bringup: true # https://github.com/flutter/flutter/issues/134083
properties:
Expand Down Expand Up @@ -1506,6 +1507,7 @@ targets:
- name: Windows_arm64 windows-build_all_packages stable
recipe: packages/packages
presubmit: false
timeout: 30
bringup: true
properties:
Expand Down
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eb5d0a434ef13d34b532aa8c53a7be64b88963c2
41581c9a1b909e481c13a2cee7a6e133f7e2ab1e
2 changes: 1 addition & 1 deletion .ci/flutter_stable.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
41456452f29d64e8deb623a3c927524bcf9f111b
abb292a07e20d696c4568099f918f6c5f330e6b0
3 changes: 3 additions & 0 deletions .ci/legacy_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ and then deleting everything but `android/` from it:
jcenter.bintray.com shutdown.
- Update `compileSdkVersion` from 30 to 33 to maintain compatibility
with plugins that use API 34.
- Updates `gradle-wrapper.properties` from `6.7` to `6.7.1`, to add
support for the Kotlin gradle plugin. If a user runs into this
error, the error message is clear on how to upgrade.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
2 changes: 1 addition & 1 deletion .ci/targets/repo_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tasks:
script: .ci/scripts/tool_runner.sh
args:
- "pubspec-check"
- "--min-min-flutter-version=3.10.0"
- "--min-min-flutter-version=3.13.0"
- "--allow-dependencies=script/configs/allowed_unpinned_deps.yaml"
- "--allow-pinned-dependencies=script/configs/allowed_pinned_deps.yaml"
always: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# the change if it doesn't.
run: |
cd $HOME
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.16.6 _flutter
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.19.0 _flutter
echo "$HOME/_flutter/bin" >> $GITHUB_PATH
cd $GITHUB_WORKSPACE
# Checks out a copy of the repo.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v1.0.26
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v1.0.26
with:
sarif_file: results.sarif
6 changes: 4 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ analyzer:
strict-inference: true
strict-raw-types: true
errors:
# allow self-reference to deprecated members (we do this because otherwise we have
# to annotate every member in every test, assert, etc, when we deprecate something)
# allow deprecated members (we do this because otherwise we have to annotate
# every member in every test, assert, etc, when we or the Dart SDK deprecates
# something (https://github.com/flutter/flutter/issues/143312)
deprecated_member_use: ignore
deprecated_member_use_from_same_package: ignore
exclude: # DIFFERENT FROM FLUTTER/FLUTTER
# Ignore generated files
Expand Down
4 changes: 4 additions & 0 deletions packages/animations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.

## 2.0.11

* Fixes new lint warnings.
Expand Down
4 changes: 2 additions & 2 deletions packages/animations/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ publish_to: none
version: 0.0.1

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.1.0
flutter: ">=3.13.0"

dependencies:
animations:
Expand Down
1 change: 1 addition & 0 deletions packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates support matrix in README to indicate that iOS 11 is no longer supported.
* Clients on versions of Flutter that still support iOS 11 can continue to use this
package with iOS 11, but will not receive any further updates to the iOS implementation.
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin.
publish_to: none

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.1.0
flutter: ">=3.13.0"

dependencies:
camera:
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
version: 0.10.5+9

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.1.0
flutter: ">=3.13.0"

flutter:
plugin:
Expand Down
1 change: 1 addition & 0 deletions packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT

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

## 0.10.8+16
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera_android/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin.
publish_to: none

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.1.0
flutter: ">=3.13.0"

dependencies:
camera_android:
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
version: 0.10.8+16

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
sdk: ^3.1.0
flutter: ">=3.13.0"

flutter:
plugin:
Expand Down
14 changes: 14 additions & 0 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.5.0+35

* Modifies `CameraInitializedEvent` that is sent when the camera is initialized to indicate that the initial focus
and exposure modes are auto and that developers may set focus and exposure points.

## 0.5.0+34

* Implements `setFocusPoint`, `setExposurePoint`, and `setExposureOffset`.

## 0.5.0+33

* Fixes typo in `README.md`.
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.

## 0.5.0+32

* Removes all remaining `unawaited` calls to fix potential race conditions and updates the
Expand Down
11 changes: 5 additions & 6 deletions packages/camera/camera_android_camerax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ the title, which will be actively triaged.

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

```yaml
Expand All @@ -24,20 +24,19 @@ dependencies:
## Missing features and limitations
### 240p resolution configuration for video recording
240p resolution configuration for video recording is unsupported by CameraX,
and thus, the plugin will fall back to 480p if configured with a
`ResolutionPreset`.

### Exposure mode, point, & offset configuration \[[Issue #120468][120468]\]
### Exposure mode configuration \[[Issue #120468][120468]\]

`setExposureMode`, `setExposurePoint`, & `setExposureOffset` are unimplemented.
`setExposureMode`is unimplemented.

### Focus mode & point configuration \[[Issue #120467][120467]\]
### Focus mode configuration \[[Issue #120467][120467]\]

`setFocusMode` & `setFocusPoint` are unimplemented.
`setFocusMode` is unimplemented.

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity
@VisibleForTesting @Nullable public ImageCaptureHostApiImpl imageCaptureHostApiImpl;
@VisibleForTesting @Nullable public CameraControlHostApiImpl cameraControlHostApiImpl;
@VisibleForTesting @Nullable public SystemServicesHostApiImpl systemServicesHostApiImpl;
@VisibleForTesting @Nullable public MeteringPointHostApiImpl meteringPointHostApiImpl;

@VisibleForTesting
public @Nullable DeviceOrientationManagerHostApiImpl deviceOrientationManagerHostApiImpl;
Expand Down Expand Up @@ -119,6 +120,12 @@ public void setUp(
cameraControlHostApiImpl =
new CameraControlHostApiImpl(binaryMessenger, instanceManager, context);
GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl);
GeneratedCameraXLibrary.FocusMeteringActionHostApi.setup(
binaryMessenger, new FocusMeteringActionHostApiImpl(instanceManager));
GeneratedCameraXLibrary.FocusMeteringResultHostApi.setup(
binaryMessenger, new FocusMeteringResultHostApiImpl(instanceManager));
meteringPointHostApiImpl = new MeteringPointHostApiImpl(instanceManager);
GeneratedCameraXLibrary.MeteringPointHostApi.setup(binaryMessenger, meteringPointHostApiImpl);
}

@Override
Expand Down Expand Up @@ -238,5 +245,8 @@ public void updateActivity(@Nullable Activity activity) {
if (deviceOrientationManagerHostApiImpl != null) {
deviceOrientationManagerHostApiImpl.setActivity(activity);
}
if (meteringPointHostApiImpl != null) {
meteringPointHostApiImpl.setActivity(activity);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public void onSuccess(Void voidResult) {
}

public void onFailure(Throwable t) {
if (t instanceof CameraControl.OperationCanceledException) {
// Operation was canceled due to camera being closed or a new request was submitted, which
// is not actionable and should not block a new value from potentially being submitted.
result.success(null);
return;
}
result.error(t);
}
},
Expand All @@ -94,6 +100,9 @@ public void onFailure(Throwable t) {
*
* <p>Will trigger an auto focus action and enable auto focus/auto exposure/auto white balance
* metering regions.
*
* <p>Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was
* canceled.
*/
public void startFocusAndMetering(
@NonNull CameraControl cameraControl,
Expand All @@ -117,6 +126,12 @@ public void onSuccess(FocusMeteringResult focusMeteringResult) {
}

public void onFailure(Throwable t) {
if (t instanceof CameraControl.OperationCanceledException) {
// Operation was canceled due to camera being closed or a new request was submitted, which
// is not actionable and should not block a new value from potentially being submitted.
result.success(null);
return;
}
result.error(t);
}
},
Expand Down Expand Up @@ -152,6 +167,9 @@ public void onFailure(Throwable t) {
* <p>The exposure compensation value set on the camera must be within the range of {@code
* ExposureState#getExposureCompensationRange()} for the current {@code ExposureState} for the
* call to succeed.
*
* <p>Will send a {@link GeneratedCameraXLibrary.Result} with a null result if operation was
* canceled.
*/
public void setExposureCompensationIndex(
@NonNull CameraControl cameraControl, @NonNull Long index, @NonNull Result<Long> result) {
Expand All @@ -166,6 +184,12 @@ public void onSuccess(Integer integerResult) {
}

public void onFailure(Throwable t) {
if (t instanceof CameraControl.OperationCanceledException) {
// Operation was canceled due to camera being closed or a new request was submitted, which
// is not actionable and should not block a new value from potentially being submitted.
result.success(null);
return;
}
result.error(t);
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ private CameraStateType(final int index) {
* <p>If you need to add another type to support a type S to use a LiveData<S> in this plugin,
* ensure the following is done on the Dart side:
*
* <p>* In `../lib/src/live_data.dart`, add new cases for S in
* <p>* In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in
* `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a
* LiveData<S> instance and in `LiveDataFlutterApiImpl#create` to create the expected type of
* LiveData<S> when requested.
*
* <p>On the native side, ensure the following is done:
*
* <p>* Update `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for
* <p>* Make sure `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for
* instances of type S. * Update `ObserverFlutterApiWrapper#onChanged` to properly handle
* receiving calls with instances of type S if a LiveData<S> instance is observed.
*/
Expand Down Expand Up @@ -146,6 +146,24 @@ private VideoResolutionFallbackRule(final int index) {
}
}

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

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

void create(
@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size);
@NonNull Long identifier,
@NonNull Double x,
@NonNull Double y,
@Nullable Double size,
@NonNull Long cameraInfoId);

@NonNull
Double getDefaultPointSize();
Expand Down Expand Up @@ -3927,12 +3949,14 @@ static void setup(
Double xArg = (Double) args.get(1);
Double yArg = (Double) args.get(2);
Double sizeArg = (Double) args.get(3);
Number cameraInfoIdArg = (Number) args.get(4);
try {
api.create(
(identifierArg == null) ? null : identifierArg.longValue(),
xArg,
yArg,
sizeArg);
sizeArg,
(cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue());
wrapped.add(0, null);
} catch (Throwable exception) {
ArrayList<Object> wrappedError = wrapError(exception);
Expand Down
Loading

0 comments on commit c56313e

Please sign in to comment.