Analogus:
Well, what actually happens with your code is that it crashes the device
The crash then triggers a reboot, which is why it seems to work. The exitcode info is in
/opt/sony/ebook/bin/tinyhttp.sh. There you can see that the device is only rebooted if either:
- a suitable exitcode is present, which (in the corresponding part of the script) calls safe_reboot;
- or tinyhttp itself exits with an error (i.e. it crashes).
You can also tell that it's crashing by putting a trace at the end of Fskin.window.doQuit (present in StandbyImage.js). That trace is successful on a regular shutdown, but not when the bookData line is added.
The reason btw (presumably) is that by adding the bookData line you're tricking the device into thinking there is no current book open, even though there is. This then results in a crash somewhere in the shutdown procedure. The correct way to unload the current book would be:
Code:
kbook.model.currentBook.media.close(kbook.bookData);
kbook.bookData.setData(null);
And you'll notice that, after adding the media.close line, the device no longer reboots. Sorry to burst your bubble
Victor:
I have seen your mails btw, thanks for the suggestions! I'm sure we'll be working on some of them in the near future