Skip to content

Commit

Permalink
Fix false positive error message, if no devices available
Browse files Browse the repository at this point in the history
  • Loading branch information
NiroDeveloper committed Jun 17, 2024
1 parent 488e0f8 commit 9e8ed29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId = "dev.niro.cameraremote"
minSdk = 28
targetSdk = 34
versionCode = 1
versionName = "1.0.0"
versionCode = 2
versionName = "1.0.1"
vectorDrawables {
useSupportLibrary = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ class BluetoothServiceCallback(
val devices = getDevices(BluetoothProfile.STATE_DISCONNECTED)

if (devices.isEmpty()) {
val allDevices = getDevices()

// If all devices are in the disconnecting state, show an error.
if (getDevices(BluetoothProfile.STATE_DISCONNECTING).size == getDevices().size) {
if (allDevices.isNotEmpty() && getDevices(BluetoothProfile.STATE_DISCONNECTING).size == allDevices.size) {
Log.e(null, "All devices are disconnecting, seems like the app unregistered silently")
serviceStateListener.onServiceError(R.string.error_app_register)

Expand Down

0 comments on commit 9e8ed29

Please sign in to comment.