Merge "ActivityManagerService: delete unnecessary mkdir"

This commit is contained in:
Nick Kralevich
2015-07-26 04:25:56 +00:00
committed by Gerrit Code Review

View File

@@ -4789,15 +4789,6 @@ public final class ActivityManagerService extends ActivityManagerNative
File tracesFile = new File(tracesPath);
try {
File tracesDir = tracesFile.getParentFile();
if (!tracesDir.exists()) {
tracesDir.mkdirs();
if (!SELinux.restorecon(tracesDir)) {
return null;
}
}
FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x
if (clearTraces && tracesFile.exists()) tracesFile.delete();
tracesFile.createNewFile();
FileUtils.setPermissions(tracesFile.getPath(), 0666, -1, -1); // -rw-rw-rw-
@@ -4900,14 +4891,6 @@ public final class ActivityManagerService extends ActivityManagerNative
final File tracesDir = tracesFile.getParentFile();
final File tracesTmp = new File(tracesDir, "__tmp__");
try {
if (!tracesDir.exists()) {
tracesDir.mkdirs();
if (!SELinux.restorecon(tracesDir.getPath())) {
return;
}
}
FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x
if (tracesFile.exists()) {
tracesTmp.delete();
tracesFile.renameTo(tracesTmp);