Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
496ca83
Add code needed from proof of concept
camsim99 Jan 20, 2023
c9593ba
Add test files, delete unecessary method
camsim99 Jan 27, 2023
8e8779e
Merge remote-tracking branch 'upstream/main' into camx_s3
camsim99 Jan 27, 2023
6e5bc8e
Add tests, remove unecessary code
camsim99 Jan 27, 2023
268d9f5
Fix analyze
camsim99 Jan 30, 2023
2001c33
Update changelog
camsim99 Jan 30, 2023
7552ad9
Merge remote-tracking branch 'upstream/main' into camx_s3
camsim99 Jan 30, 2023
7ff2a94
Cleanup:
camsim99 Jan 30, 2023
dfc3071
Cleanup and add switch
camsim99 Jan 30, 2023
4ba07e2
Finish todo
camsim99 Jan 30, 2023
754939c
Merge remote-tracking branch 'upstream/main' into camx_s3
camsim99 Jan 31, 2023
fb44db3
Add onCameraError
camsim99 Jan 31, 2023
858815d
Fix pigeon file
camsim99 Jan 31, 2023
78edaa2
Add method for releasing flutter texture and cleanup surface logic
camsim99 Jan 31, 2023
3527322
Add test for release method
camsim99 Jan 31, 2023
335372b
Add dart test
camsim99 Jan 31, 2023
4dd9c4c
Update changelog
camsim99 Jan 31, 2023
24b1bdb
Modify flutter api names to avoid stack overflow
camsim99 Jan 31, 2023
e0efef2
Cleanup
camsim99 Jan 31, 2023
e90f45c
Fix tests
camsim99 Feb 1, 2023
73cb5f8
Delete space
camsim99 Feb 1, 2023
abf4e58
Address review 1
camsim99 Feb 1, 2023
659c2e0
Update switch
camsim99 Feb 2, 2023
5f269c7
Add annotations and constants in tests
camsim99 Feb 3, 2023
a6fe15c
Merge remote-tracking branch 'upstream/main' into camx_s3
camsim99 Feb 3, 2023
78e0d0f
Reset verification behavior
camsim99 Feb 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modify flutter api names to avoid stack overflow
  • Loading branch information
camsim99 committed Jan 31, 2023
commit 24b1bdb44b5caeeaa4a9f437b0aaaaa8ca2b0481
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void onSurfaceRequested(SurfaceRequest request) {
flutterSurface.release();
case SurfaceRequest.Result.RESULT_SURFACE_ALREADY_PROVIDED:
default:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This switch is confusing.
Success releases the surface and breaks but so does canceled invalid and "will not provide".
Canceled feels like an expected condition but invalid and will not provide feel like errors even though they fall through and have the same behavior as success.
Finally Already provided feels like a code error but it falls through to default which is usually dangerous.

I am not sure what the expected conditions are but I might suggest trying to structure this in a way that is a bit easier to follow.
For example if the result code is a actually being used as a proxy for if we have a flutterSurface then maybe we always check flutterSurface and if it exists it is released. Then if we get a value that should return an error we do that. Finally we should ensure we dont hit default and if we do perhaps we error and then test that all values of Result code do not error in a unit test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified this and replied below: #7046 (comment)

systemServicesFlutterApi.onCameraError(
systemServicesFlutterApi.sendCameraError(
getProvideSurfaceErrorDescription(resultCode), reply -> {});
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public SystemServicesFlutterApiImpl(BinaryMessenger binaryMessenger) {
super(binaryMessenger);
}

public void onDeviceOrientationChanged(String orientation, Reply<Void> reply) {
public void sendDeviceOrientationChanged(String orientation, Reply<Void> reply) {
super.onDeviceOrientationChanged(orientation, reply);
}

public void onCameraError(String errorDescription, Reply<Void> reply) {
public void sendCameraError(String errorDescription, Reply<Void> reply) {
super.onCameraError(errorDescription, reply);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void startListeningForDeviceOrientationChange(
isFrontFacing,
sensorOrientation.intValue(),
(DeviceOrientation newOrientation) -> {
systemServicesFlutterApi.onDeviceOrientationChanged(
systemServicesFlutterApi.sendDeviceOrientationChanged(
serializeDeviceOrientation(newOrientation), reply -> {});
});
deviceOrientationManager.start();
Expand Down