Loading services/core/java/com/android/server/am/ActivityManagerService.java +10 −5 Original line number Original line Diff line number Diff line Loading @@ -7745,11 +7745,15 @@ public class ActivityManagerService extends IActivityManager.Stub * @return true if the process should exit immediately (WTF is fatal) * @return true if the process should exit immediately (WTF is fatal) */ */ @Override @Override public boolean handleApplicationWtf(final IBinder app, final String tag, boolean system, public boolean handleApplicationWtf(@Nullable final IBinder app, @Nullable final String tag, final ApplicationErrorReport.ParcelableCrashInfo crashInfo, int immediateCallerPid) { boolean system, @NonNull final ApplicationErrorReport.ParcelableCrashInfo crashInfo, int immediateCallerPid) { final int callingUid = Binder.getCallingUid(); final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); final int callingPid = Binder.getCallingPid(); // Internal callers in RuntimeInit should always generate a crashInfo. Preconditions.checkNotNull(crashInfo); // If this is coming from the system, we could very well have low-level // If this is coming from the system, we could very well have low-level // system locks held, so we want to do this all asynchronously. And we // system locks held, so we want to do this all asynchronously. And we // never want this to become fatal, so there is that too. // never want this to become fatal, so there is that too. Loading Loading @@ -7782,14 +7786,15 @@ public class ActivityManagerService extends IActivityManager.Stub } } } } ProcessRecord handleApplicationWtfInner(int callingUid, int callingPid, IBinder app, String tag, ProcessRecord handleApplicationWtfInner(int callingUid, int callingPid, @Nullable IBinder app, final ApplicationErrorReport.CrashInfo crashInfo) { @Nullable String tag, @Nullable final ApplicationErrorReport.CrashInfo crashInfo) { final ProcessRecord r = findAppProcess(app, "WTF"); final ProcessRecord r = findAppProcess(app, "WTF"); final String processName = app == null ? "system_server" final String processName = app == null ? "system_server" : (r == null ? "unknown" : r.processName); : (r == null ? "unknown" : r.processName); EventLogTags.writeAmWtf(UserHandle.getUserId(callingUid), callingPid, EventLogTags.writeAmWtf(UserHandle.getUserId(callingUid), callingPid, processName, r == null ? -1 : r.info.flags, tag, crashInfo.exceptionMessage); processName, r == null ? -1 : r.info.flags, tag, crashInfo == null ? "unknown" : crashInfo.exceptionMessage); FrameworkStatsLog.write(FrameworkStatsLog.WTF_OCCURRED, callingUid, tag, processName, FrameworkStatsLog.write(FrameworkStatsLog.WTF_OCCURRED, callingUid, tag, processName, callingPid, (r != null) ? r.getProcessClassEnum() : 0); callingPid, (r != null) ? r.getProcessClassEnum() : 0); Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +10 −5 Original line number Original line Diff line number Diff line Loading @@ -7745,11 +7745,15 @@ public class ActivityManagerService extends IActivityManager.Stub * @return true if the process should exit immediately (WTF is fatal) * @return true if the process should exit immediately (WTF is fatal) */ */ @Override @Override public boolean handleApplicationWtf(final IBinder app, final String tag, boolean system, public boolean handleApplicationWtf(@Nullable final IBinder app, @Nullable final String tag, final ApplicationErrorReport.ParcelableCrashInfo crashInfo, int immediateCallerPid) { boolean system, @NonNull final ApplicationErrorReport.ParcelableCrashInfo crashInfo, int immediateCallerPid) { final int callingUid = Binder.getCallingUid(); final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); final int callingPid = Binder.getCallingPid(); // Internal callers in RuntimeInit should always generate a crashInfo. Preconditions.checkNotNull(crashInfo); // If this is coming from the system, we could very well have low-level // If this is coming from the system, we could very well have low-level // system locks held, so we want to do this all asynchronously. And we // system locks held, so we want to do this all asynchronously. And we // never want this to become fatal, so there is that too. // never want this to become fatal, so there is that too. Loading Loading @@ -7782,14 +7786,15 @@ public class ActivityManagerService extends IActivityManager.Stub } } } } ProcessRecord handleApplicationWtfInner(int callingUid, int callingPid, IBinder app, String tag, ProcessRecord handleApplicationWtfInner(int callingUid, int callingPid, @Nullable IBinder app, final ApplicationErrorReport.CrashInfo crashInfo) { @Nullable String tag, @Nullable final ApplicationErrorReport.CrashInfo crashInfo) { final ProcessRecord r = findAppProcess(app, "WTF"); final ProcessRecord r = findAppProcess(app, "WTF"); final String processName = app == null ? "system_server" final String processName = app == null ? "system_server" : (r == null ? "unknown" : r.processName); : (r == null ? "unknown" : r.processName); EventLogTags.writeAmWtf(UserHandle.getUserId(callingUid), callingPid, EventLogTags.writeAmWtf(UserHandle.getUserId(callingUid), callingPid, processName, r == null ? -1 : r.info.flags, tag, crashInfo.exceptionMessage); processName, r == null ? -1 : r.info.flags, tag, crashInfo == null ? "unknown" : crashInfo.exceptionMessage); FrameworkStatsLog.write(FrameworkStatsLog.WTF_OCCURRED, callingUid, tag, processName, FrameworkStatsLog.write(FrameworkStatsLog.WTF_OCCURRED, callingUid, tag, processName, callingPid, (r != null) ? r.getProcessClassEnum() : 0); callingPid, (r != null) ? r.getProcessClassEnum() : 0); Loading