google-research / CVD-paper-mobile-camera-example

Apache License 2.0
6 stars 4 forks source link

Avoid waiting for zipping captured data for upload to view a ppg placeholder #72

Closed MJ1998 closed 5 months ago

MJ1998 commented 5 months ago

Fixes #71

The event SensorCaptureResult.ResourcesStored is emitted after zipping and creating UploadRequest records which is not needed for the application to know. Hence the application can directly get access to captured data locations using SensorCaptureResult.ResourceInfoCreated event!

Now the events give back ResourceInfo (instead of resourceInfoId) and CaptureInfo (instead of captureId) as application needs more information. This eliminates the need of using the SensingEngine singleton in the SDC's custom ViewHolderFactories.

[ ViewHolderFactory provides a ViewHolderDelegate: This interface provides an abstraction of the operations that need to be implemented for a type of view in the questionnaire. So our PPGSensorCaptureViewHolderFactory and PhotoCaptureViewHolderFactory provide custom ViewHolderDelegates to handle custom views. ]

Updated PPG and Photo ViewHolderFactory to be consistent. This also fixed #57 as the thumbnail is always updated because the answer is changed everytime (by adding the display field to the answer)

Updated Issue #65 to move zipping to sync module!

TESTED:- The placeholder comes immediately now. Tested recapture, upload, and fhir resources created.