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

Decompose Key Emulate #616

Merged

Conversation

Programistich
Copy link
Contributor

Background

Step for integrate infared emulate

Changes

  • Start/Stop/Error/OpenApp Helpers

Test plan

  • Green pipeline
  • Try emulate keys

@Programistich Programistich changed the title Refactot Key Emulate Decompose Key Emulate Jun 14, 2023
LionZXY
LionZXY previously approved these changes Jun 15, 2023
Comment on lines 60 to 86
val appStartResponse = requestApi.request(
flowOf(
main {
appStartRequest = startRequest {
name = keyType.flipperAppName
args = Constants.RPC_START_REQUEST_ARG
}
}.wrapToRequest(FlipperRequestPriority.FOREGROUND)
)
)
if (appStartResponse.commandStatus == Flipper.CommandStatus.ERROR_APP_SYSTEM_LOCKED) {
error { "Handle already opened app" }
throw AlreadyOpenedAppException()
}
if (appStartResponse.commandStatus != Flipper.CommandStatus.OK) {
error { "Failed start rpc app with error $appStartResponse" }
return false
}
info { "Start waiting for stateAppFlow" }
val appState = withTimeoutOrNull(APP_STARTED_TIMEOUT_MS) {
stateAppFlow.filter { it == Application.AppState.APP_STARTED }.first()
}
if (appState != null) {
info { "Receive that app state started" }
return true
}
info { "Failed wait for app state started" }
Copy link
Member

Choose a reason for hiding this comment

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

Let's move it to separate fun

@Programistich Programistich added this pull request to the merge queue Jun 15, 2023
Merged via the queue into flipperdevices:dev with commit a2a4433 Jun 15, 2023
5 checks passed
@Programistich Programistich deleted the refactor/key_emulate_decompose branch June 15, 2023 19:36
kiingviolence

This comment was marked as spam.

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.

3 participants