1

I'm writing a simple app to enable adb over ethernet on startup of the android, with a cancel button to prevent the enabling of the of the adb on the network. When the pop-up for superuser appears, if clicked immediately everything is fine, but if I wait a few seconds and click ok, the display fails to update.

The onCreate uses a mHandler to start a runnable, which is used for the countdown timer. When I used a mHandler.postDelayed to try to delay past the startup process, the display is never updated. When I use mHandler.postAtFrontOfQueue the countdown display functions properly, but following the superuser dialog the screen fails to update.

The countdown timer uses mHandler.postAtTime to repeatedly call the runnable. I'm thinking I need to put something at the start of the runnable to reset the focus, but am still new to the android and not having any luck figuring out what would make it happy.

When the application is run manually, everything is correct. On a second android, everything is correct.

Fred F
  • 1,027
  • 1
  • 9
  • 18

1 Answers1

0

I've found a workaround to the problem by changing from using "android.intent.action.boot_completed" to using "android.intent.action.MEDIA_MOUNTED".

What I observed was that the boot_completed happened before the full boot was complete. Something, not sure exactly what, stepped all over everything. When I tried to sleep or launch the runnable with a timer, if the sleep or timer crossed over the time things went wrong, the sleep and timer would never return, without ever getting into the runnable. By switching to the media_mounted, whatever was stepping on things had already passed.

I had been thinking of using the startup app to execute an init.rc file from the SD, so trigging off the media mount makes sense for that need.

Fred F
  • 1,027
  • 1
  • 9
  • 18