Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

health 10.2.0 isManualEntry always false #947

Closed
LorisTrainect opened this issue Apr 4, 2024 · 5 comments · Fixed by #1023
Closed

health 10.2.0 isManualEntry always false #947

LorisTrainect opened this issue Apr 4, 2024 · 5 comments · Fixed by #1023
Assignees
Labels
bugfix a bug fix

Comments

@LorisTrainect
Copy link

LorisTrainect commented Apr 4, 2024

Device / Emulator and OS

Please complete the following information for each phone and/or emulator you're experiencing this bug on:

  • Device: Samsung A70 (real device)
  • OS: Android 11

Describe the bug

I have done several tests by changing the value of includeManualEntry and then printing the data points, includeManualEntry seems to work correctly and excludes the values I manually added on google fit. However when it is true, the values I added manually are marked as false by isManualEntry.
At the moment I have only tried it on google fit but I wanted to point this out, the documentation also about these parameters is very lacking so I don't even know if this is correct behavior because it is a limitation of google fit or not.

  List<HealthDataPoint> stepsList = await health.getHealthDataFromTypes(
              startTime:  dateStart,
              endTime: now,
              types: [HealthDataType.STEPS],
              includeManualEntry: true
          );

          for(HealthDataPoint stepsData in stepsList){

             print("Steps:");
             print(stepsData.value);
             print(stepsData.isManualEntry);
             print(stepsData.dateFrom);
          }

To Reproduce

Using google fit add steps and print the isManualEntry value

Expected behavior

isManualEntry value is true for the data point i have added

Actual behavior

isManualEntry value is always false

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Versione 10.0.22631.3374], locale it-IT)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.5)
[√] Android Studio (version 2023.2)
[√] VS Code, 64-bit edition (version 1.70.0)
[√] Connected device (5 available)
[√] Network resources

• No issues found!

@LorisTrainect LorisTrainect added the bugfix a bug fix label Apr 4, 2024
@LorisTrainect LorisTrainect changed the title health 10.2.0 includeManualEntry always false health 10.2.0 isManualEntry always false Apr 4, 2024
@Amrazyan
Copy link

Did you find the solution?

@LorisTrainect
Copy link
Author

No actually not, it would be useful for us to take only the data not manually added but given this problem it is not possible and we have not found solutions

@George-nacouzi
Copy link

I have the same problem, i need health connect to give me the steps that were not manually added to google fit

@inochiconcept
Copy link

Issue still not solved and probably won't be solved in the next version as the last commits didn't fix it.
The plugin still not using the [recordingMethod] from HC API

var dataPoints = dataSet.dataPoints
if (!includeManualEntry) {
dataPoints =
dataPoints.filterIndexed { _, dataPoint ->
!dataPoint.originalDataSource
.streamName
.contains(
"user_input"
)
}

@SlimShadyIAm
Copy link
Contributor

I have opened a PR (#1023) to attempt to resolve this issue for Health Connect (as we are removing Google Fit support as of version 11.0.0) by providing you with the RecordingMethod from the record metadata.

I would appreciate if you could test it out.

However, for us to know whether a record is manually added or not, the app that writes the data needs to include it as part of the metadata. Regarding filtering out manually added steps, I have noticed that steps manually added to Google Fit are written with Metadata.RECORDING_METHOD_UNKNOWN, and therefore I'm not sure how to differentiate the two types of steps. If you have any ideas I would love to hear them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix a bug fix
Projects
None yet
5 participants