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

[Woo POS] We don't handle the low battery event during IPP flow properly #12568

Draft
wants to merge 7 commits into
base: trunk
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ internal class ConnectionManager(
connectedScope.launch {
terminalListenerImpl.readerStatus.collect { connectionStatus ->
if (connectionStatus is CardReaderStatus.NotConnected) {
bluetoothReaderListener.resetConnectionState()
if (connectionStatus.errorMessage != null) {
if (connectionStatus.errorMessage.contains("battery")) {
//
} else {
bluetoothReaderListener.resetConnectionState()
}
}
connectedScope.cancel()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ internal class TerminalWrapper {
private fun mapFrequencyOptions(updateFrequency: CardReaderManager.SimulatorUpdateFrequency): SimulateReaderUpdate {
return when (updateFrequency) {
CardReaderManager.SimulatorUpdateFrequency.NEVER -> SimulateReaderUpdate.NONE
CardReaderManager.SimulatorUpdateFrequency.ALWAYS -> SimulateReaderUpdate.REQUIRED
CardReaderManager.SimulatorUpdateFrequency.ALWAYS -> SimulateReaderUpdate.LOW_BATTERY
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is test code, to be removed before merging.

CardReaderManager.SimulatorUpdateFrequency.RANDOM -> SimulateReaderUpdate.RANDOM
}
}
Expand Down
Loading