Loading services/java/com/android/server/am/ActivityManagerService.java +13 −2 Original line number Original line Diff line number Diff line Loading @@ -106,6 +106,7 @@ import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.Process; import android.os.RemoteCallbackList; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.RemoteException; import android.os.SELinux; import android.os.ServiceManager; import android.os.ServiceManager; import android.os.StrictMode; import android.os.StrictMode; import android.os.SystemClock; import android.os.SystemClock; Loading Loading @@ -3032,7 +3033,12 @@ public final class ActivityManagerService extends ActivityManagerNative File tracesFile = new File(tracesPath); File tracesFile = new File(tracesPath); try { try { File tracesDir = tracesFile.getParentFile(); File tracesDir = tracesFile.getParentFile(); if (!tracesDir.exists()) tracesFile.mkdirs(); if (!tracesDir.exists()) { tracesFile.mkdirs(); if (!SELinux.restorecon(tracesDir)) { return null; } } FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x if (clearTraces && tracesFile.exists()) tracesFile.delete(); if (clearTraces && tracesFile.exists()) tracesFile.delete(); Loading Loading @@ -3136,7 +3142,12 @@ public final class ActivityManagerService extends ActivityManagerNative final File tracesDir = tracesFile.getParentFile(); final File tracesDir = tracesFile.getParentFile(); final File tracesTmp = new File(tracesDir, "__tmp__"); final File tracesTmp = new File(tracesDir, "__tmp__"); try { try { if (!tracesDir.exists()) tracesFile.mkdirs(); if (!tracesDir.exists()) { tracesFile.mkdirs(); if (!SELinux.restorecon(tracesDir.getPath())) { return; } } FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x if (tracesFile.exists()) { if (tracesFile.exists()) { Loading services/java/com/android/server/am/DeviceMonitor.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.am; package com.android.server.am; import android.os.SELinux; import android.util.Slog; import android.util.Slog; import java.io.*; import java.io.*; Loading Loading @@ -80,6 +81,9 @@ class DeviceMonitor { if (!BASE.isDirectory() && !BASE.mkdirs()) { if (!BASE.isDirectory() && !BASE.mkdirs()) { throw new AssertionError("Couldn't create " + BASE + "."); throw new AssertionError("Couldn't create " + BASE + "."); } } if (!SELinux.restorecon(BASE)) { throw new AssertionError("Couldn't restorecon " + BASE + "."); } } } private static final File[] PATHS = { private static final File[] PATHS = { Loading Loading
services/java/com/android/server/am/ActivityManagerService.java +13 −2 Original line number Original line Diff line number Diff line Loading @@ -106,6 +106,7 @@ import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.Process; import android.os.RemoteCallbackList; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.RemoteException; import android.os.SELinux; import android.os.ServiceManager; import android.os.ServiceManager; import android.os.StrictMode; import android.os.StrictMode; import android.os.SystemClock; import android.os.SystemClock; Loading Loading @@ -3032,7 +3033,12 @@ public final class ActivityManagerService extends ActivityManagerNative File tracesFile = new File(tracesPath); File tracesFile = new File(tracesPath); try { try { File tracesDir = tracesFile.getParentFile(); File tracesDir = tracesFile.getParentFile(); if (!tracesDir.exists()) tracesFile.mkdirs(); if (!tracesDir.exists()) { tracesFile.mkdirs(); if (!SELinux.restorecon(tracesDir)) { return null; } } FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x if (clearTraces && tracesFile.exists()) tracesFile.delete(); if (clearTraces && tracesFile.exists()) tracesFile.delete(); Loading Loading @@ -3136,7 +3142,12 @@ public final class ActivityManagerService extends ActivityManagerNative final File tracesDir = tracesFile.getParentFile(); final File tracesDir = tracesFile.getParentFile(); final File tracesTmp = new File(tracesDir, "__tmp__"); final File tracesTmp = new File(tracesDir, "__tmp__"); try { try { if (!tracesDir.exists()) tracesFile.mkdirs(); if (!tracesDir.exists()) { tracesFile.mkdirs(); if (!SELinux.restorecon(tracesDir.getPath())) { return; } } FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x FileUtils.setPermissions(tracesDir.getPath(), 0775, -1, -1); // drwxrwxr-x if (tracesFile.exists()) { if (tracesFile.exists()) { Loading
services/java/com/android/server/am/DeviceMonitor.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.am; package com.android.server.am; import android.os.SELinux; import android.util.Slog; import android.util.Slog; import java.io.*; import java.io.*; Loading Loading @@ -80,6 +81,9 @@ class DeviceMonitor { if (!BASE.isDirectory() && !BASE.mkdirs()) { if (!BASE.isDirectory() && !BASE.mkdirs()) { throw new AssertionError("Couldn't create " + BASE + "."); throw new AssertionError("Couldn't create " + BASE + "."); } } if (!SELinux.restorecon(BASE)) { throw new AssertionError("Couldn't restorecon " + BASE + "."); } } } private static final File[] PATHS = { private static final File[] PATHS = { Loading