Improved how the Shell directories are created.
When dumpstate is run for the first time, the /data/data/com.android.shell/files/bugreports does not exist, which was crashing dumpstate because the code that added the version.txt entry was not checking if the zip_writer was NULL. The crash itself was fixed by adding a sanity check in the functions that add entries to the zip file, but that only hid the real problem: it is necessary to create the parent directories before creating the zip file, otherwise the first run will always generate a .txt file (since dumpstate falls back to .txt when it cannot create the .zip). This change also improves how the parent directories are created by checking if they exist first, rather than always calling mkdir(). BUG: 26949960 Change-Id: I1434be5c36a3fad0b3a2a26c7eaaab03a1228c30
Loading
Please register or sign in to comment