hackingtype1 / original-android-cgm

My original code for grabbing CGM data via an Android device... not pretty!
BSD 2-Clause "Simplified" License
6 stars 2 forks source link

Changes to prevent hanging when the service gets destroyed #1

Closed jasoncalabrese closed 10 years ago

jasoncalabrese commented 10 years ago

I think the primary fix was removing the stopSelf, but the other changes should also help get things back to good state when there are problems.

With these changes I had 2 nights in a row with no hanging. Before that every 4-6hrs I'd need to unplug/replug the usb cable to get monitoring working again. There always seemed to be a call to onDestroy right before things fell apart.

While debugging I added some better logging and exception handling that should be useful going forward.

hackingtype1 commented 10 years ago

Awesome, I merged the updates. Interestingly, I have almost no issues with hanging - so I will go take a look at the code I'm using in our setup, it may be a slightly different version than the initial commit here. I will merge any changes I find that may be beneficial.