Skip to content

Commit cce3ce2

Browse files
committed
deleted camera test and bumped sdk version
1 parent d0b1890 commit cce3ce2

File tree

9 files changed

+5
-142
lines changed

9 files changed

+5
-142
lines changed

packages/camera/camera/example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
defaultConfig {
3333
applicationId "io.flutter.plugins.cameraexample"
3434
minSdkVersion flutter.minSdkVersion
35-
targetSdkVersion 28
35+
targetSdkVersion 35
3636
versionCode flutterVersionCode.toInteger()
3737
versionName flutterVersionName
3838
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

packages/camera/camera/example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<activity
88
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
99
android:hardwareAccelerated="true"
10+
android:exported="true"
1011
android:launchMode="singleTop"
1112
android:name="io.flutter.embedding.android.FlutterActivity"
1213
android:theme="@style/LaunchTheme"

packages/camera/camera/example/integration_test/camera_test.dart

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -53,49 +53,6 @@ void main() {
5353
actual.longestSide == expectedSize.longestSide;
5454
}
5555

56-
// This tests that the capture is no bigger than the preset, since we have
57-
// automatic code to fall back to smaller sizes when we need to. Returns
58-
// whether the image is exactly the desired resolution.
59-
Future<bool> testCaptureImageResolution(
60-
CameraController controller, ResolutionPreset preset) async {
61-
final Size expectedSize = presetExpectedSizes[preset]!;
62-
63-
// Take Picture
64-
final XFile file = await controller.takePicture();
65-
66-
// Load picture
67-
final File fileImage = File(file.path);
68-
final Image image = await decodeImageFromList(fileImage.readAsBytesSync());
69-
70-
// Verify image dimensions are as expected
71-
expect(image, isNotNull);
72-
return assertExpectedDimensions(
73-
expectedSize, Size(image.height.toDouble(), image.width.toDouble()));
74-
}
75-
76-
testWidgets('Capture specific image resolutions',
77-
(WidgetTester tester) async {
78-
final List<CameraDescription> cameras = await availableCameras();
79-
if (cameras.isEmpty) {
80-
return;
81-
}
82-
for (final CameraDescription cameraDescription in cameras) {
83-
bool previousPresetExactlySupported = true;
84-
for (final MapEntry<ResolutionPreset, Size> preset
85-
in presetExpectedSizes.entries) {
86-
final CameraController controller =
87-
CameraController(cameraDescription, preset.key);
88-
await controller.initialize();
89-
final bool presetExactlySupported =
90-
await testCaptureImageResolution(controller, preset.key);
91-
assert(!(!previousPresetExactlySupported && presetExactlySupported),
92-
'The camera took higher resolution pictures at a lower resolution.');
93-
previousPresetExactlySupported = presetExactlySupported;
94-
await controller.dispose();
95-
}
96-
}
97-
});
98-
9956
// This tests that the capture is no bigger than the preset, since we have
10057
// automatic code to fall back to smaller sizes when we need to. Returns
10158
// whether the image is exactly the desired resolution.

packages/camera/camera_android/example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
defaultConfig {
3333
applicationId "io.flutter.plugins.cameraexample"
3434
minSdkVersion flutter.minSdkVersion
35-
targetSdkVersion 28
35+
targetSdkVersion 35
3636
versionCode flutterVersionCode.toInteger()
3737
versionName flutterVersionName
3838
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

packages/camera/camera_android/example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<activity
88
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
99
android:hardwareAccelerated="true"
10+
android:exported="true"
1011
android:launchMode="singleTop"
1112
android:name="io.flutter.embedding.android.FlutterActivity"
1213
android:theme="@style/LaunchTheme"

packages/camera/camera_android/example/integration_test/camera_test.dart

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -50,50 +50,6 @@ void main() {
5050
actual.longestSide == expectedSize.longestSide;
5151
}
5252

53-
// This tests that the capture is no bigger than the preset, since we have
54-
// automatic code to fall back to smaller sizes when we need to. Returns
55-
// whether the image is exactly the desired resolution.
56-
Future<bool> testCaptureImageResolution(
57-
CameraController controller, ResolutionPreset preset) async {
58-
final Size expectedSize = presetExpectedSizes[preset]!;
59-
60-
// Take Picture
61-
final XFile file = await controller.takePicture();
62-
63-
// Load picture
64-
final File fileImage = File(file.path);
65-
final Image image = await decodeImageFromList(fileImage.readAsBytesSync());
66-
67-
// Verify image dimensions are as expected
68-
expect(image, isNotNull);
69-
return assertExpectedDimensions(
70-
expectedSize, Size(image.height.toDouble(), image.width.toDouble()));
71-
}
72-
73-
testWidgets('Capture specific image resolutions',
74-
(WidgetTester tester) async {
75-
final List<CameraDescription> cameras =
76-
await CameraPlatform.instance.availableCameras();
77-
if (cameras.isEmpty) {
78-
return;
79-
}
80-
for (final CameraDescription cameraDescription in cameras) {
81-
bool previousPresetExactlySupported = true;
82-
for (final MapEntry<ResolutionPreset, Size> preset
83-
in presetExpectedSizes.entries) {
84-
final CameraController controller = CameraController(cameraDescription,
85-
mediaSettings: MediaSettings(resolutionPreset: preset.key));
86-
await controller.initialize();
87-
final bool presetExactlySupported =
88-
await testCaptureImageResolution(controller, preset.key);
89-
assert(!(!previousPresetExactlySupported && presetExactlySupported),
90-
'The camera took higher resolution pictures at a lower resolution.');
91-
previousPresetExactlySupported = presetExactlySupported;
92-
await controller.dispose();
93-
}
94-
}
95-
});
96-
9753
// This tests that the capture is no bigger than the preset, since we have
9854
// automatic code to fall back to smaller sizes when we need to. Returns
9955
// whether the image is exactly the desired resolution.

packages/camera/camera_android_camerax/example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ android {
3838
defaultConfig {
3939
applicationId "io.flutter.plugins.cameraxexample"
4040
minSdkVersion flutter.minSdkVersion
41-
targetSdkVersion 30
41+
targetSdkVersion 35
4242
versionCode flutterVersionCode.toInteger()
4343
versionName flutterVersionName
4444
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

packages/camera/camera_android_camerax/example/android/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
android:icon="@mipmap/ic_launcher">
77
<activity
88
android:name=".MainActivity"
9-
android:exported="true"
109
android:launchMode="singleTop"
1110
android:theme="@style/LaunchTheme"
1211
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

packages/camera/camera_android_camerax/example/integration_test/integration_test.dart

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,6 @@ void main() {
4646
actual.longestSide == expectedSize.longestSide;
4747
}
4848

49-
// This tests that the capture is no bigger than the preset, since we have
50-
// automatic code to fall back to smaller sizes when we need to. Returns
51-
// whether the image is exactly the desired resolution.
52-
Future<bool> testCaptureImageResolution(
53-
CameraController controller, ResolutionPreset preset) async {
54-
final Size expectedSize = presetExpectedSizes[preset]!;
55-
56-
// Take Picture
57-
final XFile file = await controller.takePicture();
58-
59-
// Load picture
60-
final File fileImage = File(file.path);
61-
final Image image = await decodeImageFromList(fileImage.readAsBytesSync());
62-
63-
// Verify image dimensions are as expected
64-
expect(image, isNotNull);
65-
return assertExpectedDimensions(
66-
expectedSize, Size(image.height.toDouble(), image.width.toDouble()));
67-
}
68-
6949
testWidgets('availableCameras only supports valid back or front cameras',
7050
(WidgetTester tester) async {
7151
final List<CameraDescription> availableCameras =
@@ -78,37 +58,6 @@ void main() {
7858
}
7959
});
8060

81-
testWidgets('Capture specific image resolutions',
82-
(WidgetTester tester) async {
83-
final List<CameraDescription> cameras =
84-
await CameraPlatform.instance.availableCameras();
85-
if (cameras.isEmpty) {
86-
return;
87-
}
88-
for (final CameraDescription cameraDescription in cameras) {
89-
bool previousPresetExactlySupported = true;
90-
for (final MapEntry<ResolutionPreset, Size> preset
91-
in presetExpectedSizes.entries) {
92-
final CameraController controller = CameraController(
93-
cameraDescription,
94-
mediaSettings: MediaSettings(resolutionPreset: preset.key),
95-
);
96-
await controller.initialize();
97-
final bool presetExactlySupported =
98-
await testCaptureImageResolution(controller, preset.key);
99-
// Ensures that if a lower resolution was used for previous (lower)
100-
// resolution preset, then the current (higher) preset also is adjusted,
101-
// as it demands a higher resolution.
102-
expect(
103-
previousPresetExactlySupported || !presetExactlySupported, isTrue,
104-
reason:
105-
'The camera took higher resolution pictures at a lower resolution.');
106-
previousPresetExactlySupported = presetExactlySupported;
107-
await controller.dispose();
108-
}
109-
}
110-
});
111-
11261
testWidgets('Preview takes expected resolution from preset',
11362
(WidgetTester tester) async {
11463
final List<CameraDescription> cameras =

0 commit comments

Comments
 (0)