android: Homeassistant app gets unresponsive if home network is unreachable

Home Assistant Android version: 2022.12.0-full

Android version: Android 13

Phone model: Google Pixel 7 pro

Home Assistant version: 2023.1.4

Last working Home Assistant release (if known): never

Description of problem:

I am running Homeassistant without any cloud connection, so the HA Android app only has access to HA when I am connected to my home wifi network. Unfortunately when I am not at home and therefore the network is unreachable the Homeassistant app crashes and presents the message shown in the screenshot below.

I would expect the app to recognize the home network as unavailable and just idle until it is available again, but it seems it doesn’t.

Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):


Screenshot of problem:

image

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Note that this is an ANR (Application Not Responding) where the OS kills the process for being unresponsive and not a crash due to an unhandled exception. This happens to me regularly and this time I grabbed the latest ANR log file grabbed using adb bugreport on Pixel 5 / Android 13. My Home Assistant installation is not currently accessible from my phone due to my network setup.

This seems to be the relevant part of the call stack:

  - waiting on an unknown object
  at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
  at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:88)
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
  at kotlinx.coroutines.BuildersKt.runBlocking(unavailable:1)
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
  at kotlinx.coroutines.BuildersKt.runBlocking$default(unavailable:1)
  at io.homeassistant.companion.android.sensors.LocationSensorManager.sendLocationUpdate(LocationSensorManager.kt:768)
  at io.homeassistant.companion.android.sensors.LocationSensorManager.sendLocationUpdate$default(LocationSensorManager.kt:753)
  at io.homeassistant.companion.android.sensors.LocationSensorManager.handleLocationUpdate(LocationSensorManager.kt:652)
  at io.homeassistant.companion.android.sensors.LocationSensorManager.onReceive(LocationSensorManager.kt:190)
  at android.app.ActivityThread.handleReceiver(ActivityThread.java:4306)

Here’s the full ANR log for completeness. anr_2023-01-23-15-22-23-866.log