Use $PREFIX/storage for symlinks. Rix null check.

This commit is contained in:
Fredrik Fornwall
2015-12-24 09:29:14 +01:00
parent 79d56b778d
commit dd38965c46

View File

@@ -205,9 +205,7 @@ final class TermuxInstaller {
new Thread() {
public void run() {
try {
File homeDir = new File(TermuxService.HOME_PATH);
homeDir.mkdirs();
File storageDir = new File(homeDir, "storage");
File storageDir = new File(TermuxService.FILES_PATH, "storage");
if (storageDir.exists()) {
if (storageDir.isDirectory()) {
@@ -241,7 +239,7 @@ final class TermuxInstaller {
Os.symlink(moviesDir.getAbsolutePath(), new File(storageDir, "movies").getAbsolutePath());
final File[] dirs = context.getExternalFilesDirs(null);
if (dirs == null || dirs.length >= 2) {
if (dirs != null && dirs.length >= 2) {
final File externalDir = dirs[1];
Os.symlink(externalDir.getAbsolutePath(), new File(storageDir, "external").getAbsolutePath());
}