Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Need Clean Shutdown - solution for all corrupted TV sticks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    I found this :

    On my android app for root user, I perform a shutdown with su reboot -p It works ok, but I noticed that the phone is shutdown almost instantly (as opposed from showing the shutdown animation, and


    It seems that the clean way to do it would be to use "android.internal.app.ShutdownThread"

    But the calling app has to be signed with the same key as the system, so that it is known as a system app.
    So unfortunately I won't be able to use that.

    Comment


      #17
      Originally posted by petrus View Post
      I found this :

      On my android app for root user, I perform a shutdown with su reboot -p It works ok, but I noticed that the phone is shutdown almost instantly (as opposed from showing the shutdown animation, and


      It seems that the clean way to do it would be to use "android.internal.app.ShutdownThread"

      But the calling app has to be signed with the same key as the system, so that it is known as a system app.
      So unfortunately I won't be able to use that.
      From what I read, I think you are right. One advantake of using internal ShutdownThread is that it broadcast the shutdown signal for some seconds before actually shutting down. The apps listening for this signal is then given a chance to run some last code before dying. Its up to the maker of the app to implement the listener and to decide what to do if receiving the shutdown signal.

      Well, since you cannot broadcast the shutdown signal from a user app, I'm not sure how you can improve your reboot-app... But you had some ideas? Keep up the good work.

      Anyway, I think finless should try to implement the native shutdown in his rom. Theres already a rom he may be able to copy code from, the CM10 rom for mk808. It has a poweroff button in systembar, and long pressing gives power menu: http://www.freaktab.com/showthread.p...CyanogenMod-10

      Finless rom already have a shutdown button on the statusbar, which I believe gives a clean shutdown. Just missing reboot and reboot to recovery.

      Comment


        #18
        If you want to test my new version of Reboot app v0.9.1, I changed a bit the way I proceed with the filesystems :

        * I unmount sdcard and usb disk if present
        * then I try to remount all filesystems read-only, to make sure no app is writing when I shut down or reboot.

        Maybe the next evolution of the reboot app will be to manually kill every running app (excluding system apps) before unmounting. But I'm not sure it will really help, unless I find a clean way to shutdown apps. The only one that will work is the "kill" command, and it won't trigger a clean shutdown.

        Comment

        Working...
        X