Refuse to write optimized dex files to a non-private directory.

It's infeasible to test if other applications can write to a
given directory, particularly since directories like /sdcard/
are accessible to named groups like sdcard_rw. Instead we take
a shortcut and just test that the optimized directory is owned
by the current process.

I tested this manually; the '/data/data/vogar.test.java.StatTest/'
app directory could be successfully used but other directories
('/data', '/sdcard', '/') throw exceptions as expected.

Bug: http://b/4609061
Change-Id: Ia72b50aa3c73051b0c03c06c0bc7c0470f76b212
1 file changed