This bug is very easy to reproduce, just follow the step below:
1. Add below code into tiapp.xml
3. Press the start button and lock the screen by press the power button of iPhone, the screen will be locked. Let me tell you what will happen after this
- if you unlock the screen less than 10 seconds after you lock, everthing is fine
- try to waiting more than 10 seconds before you unlocking your device, for example 30 seconds, you'll got a blank record, when you try to play this record it will never stop even thoung it's a blank file.
Everytime we start a new recording, a temp file will be created, however, the "ProtectionKey" is not set properly, so after the screen being locked, we don't have correct rights to write into that file, so we just unprotect this temp file to fix this bug. uh..., how does the magic "10 seconds" comes up? As we are know, iOS will left about 10 seconds to every app runing on it to do the cleanup thing before the system pause it(e.g. home button pressed), so if we unlock our device again shortly after we lock it everthing will be fine cause our App is stilling running in "foreground" now.
Sorry for my broken English, hopes you guys understand it. If you have any question please let'me know, Thanks.