Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
475f4ab
Replicated existing code and migrated references to new embedding, ad…
matthew-carroll Sep 24, 2019
8cde03b
Introduced CameraPreviewDisplay and CameraImageStream to remove Flutt…
matthew-carroll Sep 24, 2019
2081f42
Introduced a CameraEventListener to completely decouple Camera from E…
matthew-carroll Sep 24, 2019
b78bfcb
Removed all references of Result from Camera by introducing a combina…
matthew-carroll Sep 24, 2019
b45ae68
Refactored Camera such that getFlutterTexture() no longer needs to ex…
matthew-carroll Sep 24, 2019
6780abf
Moved ResolutionPreset to standalone class and made Camera package pr…
matthew-carroll Sep 24, 2019
8b93f68
Re-organized Camera code order to clearly separate preview images, fr…
matthew-carroll Sep 24, 2019
c85fcc2
Removed Activity reference from Camera.
matthew-carroll Sep 24, 2019
e04653b
Refactored CameraPermissions to eliminate Activity, ActivityCompat, C…
matthew-carroll Sep 24, 2019
60c1d20
Refactored CameraPermissions into an Interface and AndroidCameraPermi…
matthew-carroll Sep 25, 2019
13e4303
Separated the CameraPlugin class from the concept of the comms Camera…
matthew-carroll Sep 25, 2019
d5da9ce
Introduced CameraDetails data structure & wrote unit tests for Camera…
matthew-carroll Sep 25, 2019
436d9ca
Added unit tests for CameraPluginProtocol and reached 100% coverage f…
matthew-carroll Sep 25, 2019
3dcc0ab
Moved CameraPreviewDisplay and CameraImageStream implementations into…
matthew-carroll Sep 26, 2019
02ab397
Extracted per-camera channel construction out into CameraPlugin for t…
matthew-carroll Sep 26, 2019
e5408d9
Refactored so that CameraSystem and AndroidCameraSystem could be redu…
matthew-carroll Sep 26, 2019
6ea1b4f
Deleted CameraUtils, and continued to cleanup relationships.
matthew-carroll Sep 26, 2019
4669cb4
Added tests for CameraSystem - at 93% line coverage.
matthew-carroll Sep 26, 2019
410d0ac
Added tests to ensure that CameraPlugin does nothing without an Activ…
matthew-carroll Sep 26, 2019
0bd6522
Added tests for ChannelCameraEventHandler - now at CameraSystem (93%)…
matthew-carroll Sep 26, 2019
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
Added tests for CameraSystem - at 93% line coverage.
  • Loading branch information
matthew-carroll committed Sep 26, 2019
commit 4669cb4eaf0d3c398865b14d5e8dedc0478694c5
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

boolean hasAudioPermission();

void requestPermissions(boolean enableAudio, ResultCallback callback);
void requestPermissions(boolean enableAudio, @NonNull ResultCallback callback);

void addRequestPermissionsResultListener(@NonNull PluginRegistry.RequestPermissionsResultListener listener);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,23 @@ public void initialize(
camera.close();
}

if (!cameraPermissions.hasCameraPermission() || (request.getEnableAudio() ))

cameraPermissions.requestPermissions(
request.getEnableAudio(),
new CameraPermissions.ResultCallback() {
@Override
public void onSuccess() {
try {
openCamera(request, callback);
} catch (Exception error) {
callback.onError("CameraAccess", error.getMessage());
}
cameraPermissions.requestPermissions(
request.getEnableAudio(),
new CameraPermissions.ResultCallback() {
@Override
public void onSuccess() {
try {
openCamera(request, callback);
} catch (Exception error) {
callback.onError("CameraAccess", error.getMessage());
}
}

@Override
public void onResult(String errorCode, String errorDescription) {
callback.onCameraPermissionError(errorCode, errorDescription);
}
});
@Override
public void onResult(String errorCode, String errorDescription) {
callback.onCameraPermissionError(errorCode, errorDescription);
}
});
}

private void openCamera(
Expand All @@ -108,6 +106,7 @@ public void onCameraOpenFailed(@NonNull String message) {
}
});

// TODO(mattcarroll): remove the ChannelCameraEventHandler reference from CameraSystem, it's a protocol detail.
final CameraPluginProtocol.ChannelCameraEventHandler eventHandler = new CameraPluginProtocol.ChannelCameraEventHandler();
camera.setCameraEventHandler(eventHandler);

Expand Down Expand Up @@ -186,6 +185,7 @@ public void startImageStream(@NonNull OnCameraAccessCommandCallback callback) {
public void stopImageStream(@NonNull OnCameraAccessCommandCallback callback) {
// TODO(mattcarroll): determine desired behavior when no camera is active
try {
// TODO(mattcarroll): verify that startPreview() is really what should run here
camera.startPreview();
callback.success();
} catch (CameraAccessException e) {
Expand Down
Loading