Skip to content

Commit

Permalink
Merge branch 'main' into 150053_code_selection_background
Browse files Browse the repository at this point in the history
  • Loading branch information
domesticmouse committed Jul 14, 2024
2 parents abf6a1d + 96f870e commit 748ff2b
Show file tree
Hide file tree
Showing 210 changed files with 1,029 additions and 4,036 deletions.
35 changes: 33 additions & 2 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,24 @@ targets:
timeout: 30
properties:
version_file: flutter_master.version
target_file: android_build_all_packages.yaml
# This builds the all_packages app only in a current JDK.
target_file: android_build_all_packages_jdk17.yaml
channel: master
env_variables: >-
{
"CHANNEL": "master"
}
- name: Linux_android android_build_all_packages_legacy master
recipe: packages/packages
timeout: 30
properties:
version_file: flutter_master.version
# TODO(stuartmorgan): Once stable requires JDK 17, and the
# legacy project is updated accordingly, this entire target
# can be merged back into android_build_all_packages.
# This file only builds a *legacy* version of the project.
target_file: android_build_all_packages_legacy.yaml
channel: master
# The legacy project build requires an older JDK.
dependencies: >-
Expand All @@ -382,7 +399,21 @@ targets:
properties:
add_recipes_cq: "true"
version_file: flutter_stable.version
target_file: android_build_all_packages.yaml
# This builds the all_packages app only in a current JDK.
target_file: android_build_all_packages_jdk17.yaml
channel: stable
env_variables: >-
{
"CHANNEL": "stable"
}
- name: Linux_android android_build_all_packages_legacy stable
recipe: packages/packages
timeout: 30
properties:
version_file: flutter_stable.version
# This file only builds a *legacy* version of the project.
target_file: android_build_all_packages_legacy.yaml
channel: stable
# The legacy project build requires an older JDK.
dependencies: >-
Expand Down
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5103d757436124a08e6a8024ebacbf0cf4b2bacf
58068d8ea4eca8a17d99469697aaff46255522e9
14 changes: 14 additions & 0 deletions .ci/targets/android_build_all_packages_jdk17.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This only builds the modern all_packages app, which requires jdk17+
tasks:
- name: prepare tool
script: .ci/scripts/prepare_tool.sh
infra_step: true # Note infra steps failing prevents "always" from running.
- name: create all_packages app
script: .ci/scripts/create_all_packages_app.sh
infra_step: true # Note infra steps failing prevents "always" from running.
- name: build all_packages for Android debug
script: .ci/scripts/build_all_packages_app.sh
args: ["apk", "debug"]
- name: build all_packages for Android release
script: .ci/scripts/build_all_packages_app.sh
args: ["apk", "release"]
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
# This only builds the legacy all_packages app, which requires jdk11
tasks:
- name: prepare tool
script: .ci/scripts/prepare_tool.sh
infra_step: true # Note infra steps failing prevents "always" from running.
- name: create all_packages app
script: .ci/scripts/create_all_packages_app.sh
infra_step: true # Note infra steps failing prevents "always" from running.
- name: build all_packages for Android debug
script: .ci/scripts/build_all_packages_app.sh
args: ["apk", "debug"]
- name: build all_packages for Android release
script: .ci/scripts/build_all_packages_app.sh
args: ["apk", "release"]
- name: create all_packages app - legacy version
script: .ci/scripts/create_all_packages_app_legacy.sh
# Output dir; must match the final argument to build_all_packages_app_legacy
Expand Down
7 changes: 3 additions & 4 deletions packages/camera/camera/test/camera_image_stream_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,10 @@ class MockStreamingCameraPlatform extends MockCameraPlatform {
}

@override
Future<XFile> startVideoRecording(int cameraId,
{Duration? maxVideoDuration}) {
Future<void> startVideoRecording(int cameraId, {Duration? maxVideoDuration}) {
streamCallLog.add('startVideoRecording');
return super
.startVideoRecording(cameraId, maxVideoDuration: maxVideoDuration);
// Ignore maxVideoDuration, as it is unimplemented and deprecated.
return super.startVideoRecording(cameraId);
}

@override
Expand Down
15 changes: 9 additions & 6 deletions packages/camera/camera/test/camera_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1511,14 +1511,17 @@ class MockCameraPlatform extends Mock
super.noSuchMethod(Invocation.method(#prepareForVideoRecording, null));

@override
Future<XFile> startVideoRecording(int cameraId,
{Duration? maxVideoDuration}) =>
Future<XFile>.value(mockVideoRecordingXFile);
Future<void> startVideoRecording(int cameraId, {Duration? maxVideoDuration}) {
// Ignore maxVideoDuration, as it is unimplemented and deprecated.
return startVideoCapturing(VideoCaptureOptions(cameraId));
}

@override
Future<void> startVideoCapturing(VideoCaptureOptions options) async {}

@override
Future<void> startVideoCapturing(VideoCaptureOptions options) {
return startVideoRecording(options.cameraId,
maxVideoDuration: options.maxDuration);
Future<XFile> stopVideoRecording(int cameraId) {
return Future<XFile>.value(mockVideoRecordingXFile);
}

@override
Expand Down
4 changes: 4 additions & 0 deletions packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.9+8

* Removes unused code related to `maxVideoDuration`.

## 0.10.9+7

* Updates Android Gradle plugin to 8.5.0.
Expand Down
14 changes: 2 additions & 12 deletions packages/camera/camera_android/lib/src/android_camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ class AndroidCamera extends CameraPlatform {
@override
Future<void> startVideoRecording(int cameraId,
{Duration? maxVideoDuration}) async {
return startVideoCapturing(
VideoCaptureOptions(cameraId, maxDuration: maxVideoDuration));
// Ignore maxVideoDuration, as it is unimplemented and deprecated.
return startVideoCapturing(VideoCaptureOptions(cameraId));
}

@override
Expand All @@ -277,7 +277,6 @@ class AndroidCamera extends CameraPlatform {
'startVideoRecording',
<String, dynamic>{
'cameraId': options.cameraId,
'maxVideoDuration': options.maxDuration?.inMilliseconds,
'enableStream': options.streamCallback != null,
},
);
Expand Down Expand Up @@ -626,15 +625,6 @@ class AndroidCamera extends CameraPlatform {
cameraEventStreamController.add(CameraClosingEvent(
cameraId,
));
case 'video_recorded':
final Map<String, Object?> arguments = _getArgumentDictionary(call);
cameraEventStreamController.add(VideoRecordedEvent(
cameraId,
XFile(arguments['path']! as String),
arguments['maxVideoDuration'] != null
? Duration(milliseconds: arguments['maxVideoDuration']! as int)
: null,
));
case 'error':
final Map<String, Object?> arguments = _getArgumentDictionary(call);
cameraEventStreamController.add(CameraErrorEvent(
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Android implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22

version: 0.10.9+7
version: 0.10.9+8

environment:
sdk: ^3.4.0
Expand Down
26 changes: 0 additions & 26 deletions packages/camera/camera_android/test/android_camera_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -636,31 +636,6 @@ void main() {
expect(channel.log, <Matcher>[
isMethodCall('startVideoRecording', arguments: <String, Object?>{
'cameraId': cameraId,
'maxVideoDuration': null,
'enableStream': false,
}),
]);
});

test('Should pass maxVideoDuration when starting recording a video',
() async {
// Arrange
final MethodChannelMock channel = MethodChannelMock(
channelName: _channelName,
methods: <String, dynamic>{'startVideoRecording': null},
);

// Act
await camera.startVideoRecording(
cameraId,
maxVideoDuration: const Duration(seconds: 10),
);

// Assert
expect(channel.log, <Matcher>[
isMethodCall('startVideoRecording', arguments: <String, Object?>{
'cameraId': cameraId,
'maxVideoDuration': 10000,
'enableStream': false,
}),
]);
Expand All @@ -685,7 +660,6 @@ void main() {
expect(channel.log, <Matcher>[
isMethodCall('startVideoRecording', arguments: <String, Object?>{
'cameraId': cameraId,
'maxVideoDuration': null,
'enableStream': true,
}),
]);
Expand Down
5 changes: 5 additions & 0 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.6.7+1

* Updates README to remove references to `maxVideoDuration`, as it was never
visible to app-facing clients, nor was it implemented in `camera_android`.

## 0.6.7

* Updates AGP version to 8.5.0.
Expand Down
8 changes: 4 additions & 4 deletions packages/camera/camera_android_camerax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ due to this not currently being supported by CameraX.
the plugin will fall back to target 480p (`ResolutionPreset.medium`) if configured with
`ResolutionPreset.low`.

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

Calling `startVideoCapturing` with `VideoCaptureOptions` configured with
`maxVideoDuration` and `streamOptions` is currently unsupported do to the
limitations of the CameraX library and the platform interface, respectively,
and thus, those parameters will silently be ignored.
`streamOptions` is currently unsupported do to
limitations of the platform interface,
and thus that parameter will silently be ignored.

## What requires Android permissions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,16 +1013,15 @@ class AndroidCameraCameraX extends CameraPlatform {
@override
Future<void> startVideoRecording(int cameraId,
{Duration? maxVideoDuration}) async {
return startVideoCapturing(
VideoCaptureOptions(cameraId, maxDuration: maxVideoDuration));
// Ignore maxVideoDuration, as it is unimplemented and deprecated.
return startVideoCapturing(VideoCaptureOptions(cameraId));
}

/// Starts a video recording and/or streaming session.
///
/// Please see [VideoCaptureOptions] for documentation on the
/// configuration options. Currently, maxVideoDuration and streamOptions
/// are unsupported due to the limitations of CameraX and the platform
/// interface, respectively.
/// configuration options. Currently streamOptions are unsupported due to
/// limitations of the platform interface.
@override
Future<void> startVideoCapturing(VideoCaptureOptions options) async {
if (recording != null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android_camerax/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_android_camerax
description: Android implementation of the camera plugin using the CameraX library.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.6.7
version: 0.6.7+1

environment:
sdk: ^3.4.0
Expand Down
8 changes: 8 additions & 0 deletions packages/camera/camera_avfoundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.9.17

* Adds Swift Package Manager compatibility.

## 0.9.16+3

* Removes unused `maxVideoDuration` code.

## 0.9.16+2

* Fixes regression taking a picture in torch mode.
Expand Down
2 changes: 0 additions & 2 deletions packages/camera/camera_avfoundation/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ target 'Runner' do

target 'RunnerTests' do
inherit! :search_paths
# Pods for testing
pod 'OCMock', '~> 3.8.1'
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
25C3919135C3D981E6F800D0 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1944D8072499F3B5E7653D44 /* libPods-RunnerTests.a */; };
334733EA2668111C00DCC49E /* CameraOrientationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03BB767226653ABE00CE5A93 /* CameraOrientationTests.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
408D7A792C3C9CD000B71F9A /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 408D7A782C3C9CD000B71F9A /* OCMock */; };
43ED1537282570DE00EB00DE /* AvailableCamerasTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 43ED1536282570DE00EB00DE /* AvailableCamerasTest.m */; };
788A065A27B0E02900533D74 /* StreamingTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 788A065927B0E02900533D74 /* StreamingTest.m */; };
7D5FCCD42AEF9D0200FB7108 /* CameraSettingsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D5FCCD32AEF9D0200FB7108 /* CameraSettingsTests.m */; };
Expand Down Expand Up @@ -106,6 +107,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
408D7A792C3C9CD000B71F9A /* OCMock in Frameworks */,
25C3919135C3D981E6F800D0 /* libPods-RunnerTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -241,6 +243,9 @@
03BB766E2665316900CE5A93 /* PBXTargetDependency */,
);
name = RunnerTests;
packageProductDependencies = (
408D7A782C3C9CD000B71F9A /* OCMock */,
);
productName = camera_exampleTests;
productReference = 03BB76682665316900CE5A93 /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
Expand Down Expand Up @@ -295,6 +300,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
408D7A772C3C9CD000B71F9A /* XCRemoteSwiftPackageReference "ocmock" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -733,6 +741,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
408D7A772C3C9CD000B71F9A /* XCRemoteSwiftPackageReference "ocmock" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/erikdoe/ocmock";
requirement = {
kind = revision;
revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
408D7A782C3C9CD000B71F9A /* OCMock */ = {
isa = XCSwiftPackageProductDependency;
package = 408D7A772C3C9CD000B71F9A /* XCRemoteSwiftPackageReference "ocmock" */;
productName = OCMock;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// found in the LICENSE file.

@import camera_avfoundation;
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
@import camera_avfoundation.Test;
#endif
@import XCTest;
@import AVFoundation;
#import <OCMock/OCMock.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// found in the LICENSE file.

@import camera_avfoundation;
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
@import camera_avfoundation.Test;
#endif
@import XCTest;

@interface CameraCaptureSessionQueueRaceConditionTests : XCTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// found in the LICENSE file.

@import camera_avfoundation;
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
@import camera_avfoundation.Test;
#endif
@import XCTest;
@import AVFoundation;
#import <OCMock/OCMock.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// found in the LICENSE file.

@import camera_avfoundation;
#if __has_include(<camera_avfoundation/camera_avfoundation-umbrella.h>)
@import camera_avfoundation.Test;
#endif
@import XCTest;
@import AVFoundation;
#import <OCMock/OCMock.h>
Expand Down
Loading

0 comments on commit 748ff2b

Please sign in to comment.