platform_packages_apps_Updater icon indicating copy to clipboard operation
platform_packages_apps_Updater copied to clipboard

Seamlessupdate does not handle force stop then restart gracefully

Open renlord opened this issue 5 years ago • 6 comments

Sometimes when seamlessupdate hangs, a user might want to force stop the service and restart it by pressing on "check updates", but this fails silently without a UI prompt for reboot and seamlessupdate will refuse to restart until reboot.

Logcat Logs:

06-03 13:21:20.902  1152  1152 E update_engine: [0603/132120.899720:ERROR:update_attempter_android.cc(-1)] Domain=update_engine, Code=generic_error, Message=An update already applied, waiting for reboot
06-03 13:21:20.906  1152  1152 E update_engine: [0603/132120.906020:ERROR:update_attempter_android.cc(85)] Replying with failure: pc:0x5fb9a8d6bc: An update already applied, waiting for reboot
06-03 13:21:20.909  6320  6482 E AndroidRuntime: FATAL EXCEPTION: IntentService[Service]
06-03 13:21:20.909  6320  6482 E AndroidRuntime: Process: app.seamlessupdate.client, PID: 6320
06-03 13:21:20.909  6320  6482 E AndroidRuntime: android.os.ServiceSpecificException: An update already applied, waiting for reboot (code 1)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.Parcel.createException(Parcel.java:2085)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:2039)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:1987)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.IUpdateEngine$Stub$Proxy.applyPayload(IUpdateEngine.java:247)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.UpdateEngine.applyPayload(UpdateEngine.java:308)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at app.seamlessupdate.client.Service.applyUpdate(Service.java:103)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at app.seamlessupdate.client.Service.onDownloadFinished(Service.java:195)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at app.seamlessupdate.client.Service.onHandleIntent(Service.java:262)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:107)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:214)
06-03 13:21:20.909  6320  6482 E AndroidRuntime:        at android.os.HandlerThread.run(HandlerThread.java:67

renlord avatar Jun 03 '20 03:06 renlord

Interesting, not sure why this would happen.

thestinger avatar Jun 03 '20 04:06 thestinger

It looks like it's update_engine that screwed up though? Unless it did successfully apply the update and the only issue was the UI not showing a notification.

thestinger avatar Jun 03 '20 04:06 thestinger

I think what you suggested was the case.

The progress bar hung and I had to check logcat to do the reboot manually.

renlord avatar Jun 03 '20 07:06 renlord

I think perhaps force stopping Updater didn't stop the update, so it succeeded anyway, but the app wasn't running?

thestinger avatar Jun 03 '20 19:06 thestinger

It definitely lacks a way to contact update engine and pick up where it left off.

thestinger avatar Jun 03 '20 19:06 thestinger

It now uses a foreground service tied to the progress notification for downloading + verifying + installing so issues like this should be far less frequent without the user triggering it. It still won't handle this well when it's triggered via force stop.

thestinger avatar Jul 24 '21 00:07 thestinger