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

[DRAFT] Migrate update to new BLE api #1008

Draft
wants to merge 6 commits into
base: makeevrserg/new-ble-api/dev
Choose a base branch
from

Conversation

makeevrserg
Copy link
Collaborator

@makeevrserg makeevrserg commented Dec 25, 2024

Background

Migration of all update modules into new api

Changes

  • Added new feature for update
  • Migrated every update submodules into new api

Test plan

  • Open flipper android app and run update
  • See flipper is update correctly with all it's flow (image changed, rebooted, location sub-ghz working)
  • See all tests previously located is passed

TODO

  • Device reconnect after it being shutdown(we don't get success message on mobile)(the problem is on another layer. Not actually related to feature)

BatteryState.Ready(gattInfo.isCharging, batteryLevel)
} ?: BatteryState.Unknown
}
}.stateIn(viewModelScope, SharingStarted.Lazily, BatteryState.Unknown)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to be lazily because we can't properly mock FGattInfoFeatureApi without it

@@ -124,6 +136,9 @@ class UpdateRequestViewModelTest {
@Test
fun `Open update request with sync`() = runTest {
synchronizationState.emit(SynchronizationState.InProgress.Default(0f))
viewModel.getBatteryState()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's required to call batteryState initialization. It's lazy initialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant