Loading services/core/java/com/android/server/am/AppErrors.java +20 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ import android.util.Log; import android.util.Slog; import android.util.SparseArray; import android.util.TimeUtils; import java.util.Date; import java.text.SimpleDateFormat; import java.io.File; import java.io.FileDescriptor; import java.io.PrintWriter; Loading @@ -76,7 +77,7 @@ class AppErrors { private final ActivityManagerService mService; private final Context mContext; SimpleDateFormat mTraceDateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss.SSS"); private ArraySet<String> mAppsNotReportingCrashes; /** Loading Loading @@ -886,6 +887,23 @@ class AppErrors { annotation != null ? "ANR " + annotation : "ANR", info.toString()); boolean enableTraceRename = SystemProperties.getBoolean("persist.sys.enableTraceRename", false); //Set the trace file name to app name + current date format to avoid overrinding trace file based on debug flag if(enableTraceRename) { String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null); if (tracesPath != null && tracesPath.length() != 0) { File traceRenameFile = new File(tracesPath); String newTracesPath; int lpos = tracesPath.lastIndexOf ("."); if (-1 != lpos) newTracesPath = tracesPath.substring (0, lpos) + "_" + app.processName + "_" + mTraceDateFormat.format(new Date()) + tracesPath.substring (lpos); else newTracesPath = tracesPath + "_" + app.processName; traceRenameFile.renameTo(new File(newTracesPath)); SystemClock.sleep(1000); } } // Bring up the infamous App Not Responding dialog Message msg = Message.obtain(); HashMap<String, Object> map = new HashMap<String, Object>(); Loading Loading
services/core/java/com/android/server/am/AppErrors.java +20 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ import android.util.Log; import android.util.Slog; import android.util.SparseArray; import android.util.TimeUtils; import java.util.Date; import java.text.SimpleDateFormat; import java.io.File; import java.io.FileDescriptor; import java.io.PrintWriter; Loading @@ -76,7 +77,7 @@ class AppErrors { private final ActivityManagerService mService; private final Context mContext; SimpleDateFormat mTraceDateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss.SSS"); private ArraySet<String> mAppsNotReportingCrashes; /** Loading Loading @@ -886,6 +887,23 @@ class AppErrors { annotation != null ? "ANR " + annotation : "ANR", info.toString()); boolean enableTraceRename = SystemProperties.getBoolean("persist.sys.enableTraceRename", false); //Set the trace file name to app name + current date format to avoid overrinding trace file based on debug flag if(enableTraceRename) { String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null); if (tracesPath != null && tracesPath.length() != 0) { File traceRenameFile = new File(tracesPath); String newTracesPath; int lpos = tracesPath.lastIndexOf ("."); if (-1 != lpos) newTracesPath = tracesPath.substring (0, lpos) + "_" + app.processName + "_" + mTraceDateFormat.format(new Date()) + tracesPath.substring (lpos); else newTracesPath = tracesPath + "_" + app.processName; traceRenameFile.renameTo(new File(newTracesPath)); SystemClock.sleep(1000); } } // Bring up the infamous App Not Responding dialog Message msg = Message.obtain(); HashMap<String, Object> map = new HashMap<String, Object>(); Loading