-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera] android-rework part 1: Base classes to support Android Camera features #3795
[camera] android-rework part 1: Base classes to support Android Camera features #3795
Conversation
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
FYI I'm OOO at the moment but will start working through these reviews as time allows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just small nits, otherwise looks good.
|
||
/** An interface allowing access to the different characteristics of the device's camera. */ | ||
public interface CameraProperties { | ||
String getCameraName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not obvious what most of these methods mean. Please add Javadoc comments to each public method (as required by style); it seems like the best option would probably be to document them by indicating what CameraCharacteristics entry each one maps to.
return cameraCharacteristics.get(CameraCharacteristics.CONTROL_MAX_REGIONS_AF); | ||
} | ||
|
||
@RequiresApi(api = VERSION_CODES.P) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is a Java noob question, but shouldn't this be on the interface, not the implementation? It's not clear to me what it means for an interface with no API requirement to be implemented by something that does have one.
public abstract String getDebugName(); | ||
|
||
/** | ||
* Get the current value of this feature's setting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the expected behavior of get/set if checkIsSupported
returns false? That would be good to document.
public abstract void setValue(T value); | ||
|
||
/** | ||
* Returns whether or not this feature is supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: please use consistent mood in declaration comments (e.g., the above is Sets, not Set, but this is Returns, not Return.)
It looks like the preferred style for Javadoc is declarative, so this is correct and the other methods here should be Gets, Sets, Updates.
Co-authored-by: Andrew Coutts <[email protected]>
a02cc68
to
76bc5bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…id Camera features (flutter/plugins#3795)
* master: (397 commits) [in_app_purchase] Implementation of platform interface (flutter#3781) [google_sign_in] Add todo WRT correctly setting X-Goog-AuthUser header (flutter#3819) [tools] fix version check command not working for new packages (flutter#3818) [camera] android-rework part 1: Base classes to support Android Camera features (flutter#3795) fix MD (flutter#3815) Path provider windows crash fix (flutter#3814) [local_auth] docs update (flutter#3103) Update PULL_REQUEST_TEMPLATE.md (flutter#3801) [quick_actions] handle cold start on iOS correctly (flutter#3811) Replace path_provider_linux widget tests with simple unit tests (flutter#3812) [sensors] format dart code based on the new dart formatter (flutter#3809) [google_sign_in] Fix "pick account" on iOS (flutter#3805) [image_picker_platform_interface] Added pickMultiImage (flutter#3782) [in_app_purchase] Added currency code and numerical price to product detail model. (flutter#3794) [local_auth] Fix iOS crash when no localizedReason (flutter#3780) Fix and update version checks (flutter#3792) [in_app_purchase] Configured example app to use StoreKit Testing on iOS 14 (flutter#3772) [local_auth] Unnecessary reassignment in example removed (flutter#2983) [flutter_webview] Fix `allowsInlineMediaPlayback` ignored on iOS (flutter#3791) Switch script/tools over to the new analysis options (flutter#3777) ...
* master: (79 commits) Fix grammatical error in contributing guide (flutter#3217) [google_sign_in_web] fix README typos. [tool] combine run and runAndExitOnError (flutter#3827) [camera] android-rework part 2: Android auto focus feature (flutter#3796) [in_app_purchase_platform_interface] Added additional fields to ProductDetails (flutter#3826) Move all null safety packages' min dart sdk to 2.12.0 (flutter#3822) [path_provider_*] code cleanup: sort directives (flutter#3823) [in_app_purchase] Implementation of platform interface (flutter#3781) [google_sign_in] Add todo WRT correctly setting X-Goog-AuthUser header (flutter#3819) [tools] fix version check command not working for new packages (flutter#3818) [camera] android-rework part 1: Base classes to support Android Camera features (flutter#3795) fix MD (flutter#3815) Path provider windows crash fix (flutter#3814) [local_auth] docs update (flutter#3103) Update PULL_REQUEST_TEMPLATE.md (flutter#3801) [quick_actions] handle cold start on iOS correctly (flutter#3811) Replace path_provider_linux widget tests with simple unit tests (flutter#3812) [sensors] format dart code based on the new dart formatter (flutter#3809) [google_sign_in] Fix "pick account" on iOS (flutter#3805) [image_picker_platform_interface] Added pickMultiImage (flutter#3782) ...
* upstream/master: (383 commits) Add implement and registerWith method to plugins (flutter#3833) Update third_party license checking (flutter#3844) [tool] add `all` and `dry-run` flags to publish-plugin command (flutter#3776) Re-add bin/ to flutter_plugin_tools (flutter#3839) switch from using 'tuneup' to analyze to 'dart analyze' (flutter#3837) [in_app_purchase] Federated iOS implementation (flutter#3832) Prep the tools for publishing (flutter#3836) [in_app_purchase] Make PurchaseDetails.status mandatory (flutter#3831) Fix grammatical error in contributing guide (flutter#3217) [google_sign_in_web] fix README typos. [tool] combine run and runAndExitOnError (flutter#3827) [camera] android-rework part 2: Android auto focus feature (flutter#3796) [in_app_purchase_platform_interface] Added additional fields to ProductDetails (flutter#3826) Move all null safety packages' min dart sdk to 2.12.0 (flutter#3822) [path_provider_*] code cleanup: sort directives (flutter#3823) [in_app_purchase] Implementation of platform interface (flutter#3781) [google_sign_in] Add todo WRT correctly setting X-Goog-AuthUser header (flutter#3819) [tools] fix version check command not working for new packages (flutter#3818) [camera] android-rework part 1: Base classes to support Android Camera features (flutter#3795) fix MD (flutter#3815) ...
…a features (flutter#3795) * Base classes to support Android camera features Co-authored-by: Andrew Coutts <[email protected]> * Fixed formatting * Applied feedback from PR Co-authored-by: Andrew Coutts <[email protected]>
Introduces some base classes in the Android Camera implementation which will allow us to separate specific feature logic from the
Camera
class into specific feature classes. This has the following benefits (basically all benefits of the Separation of Concerns principle):Camera
class, making it easier to maintain theCamera
class;This is the first PR in a series of pull-requests which will gradually introduce changes from PR #3651, making it easier to review the code (as discussed with @stuartmorgan).
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
[shared_preferences]
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.