Additional log instrumentation for multi-user

Log when app crash dialogs are shown:
Showing crash dialog for package <package.name> u<user_id>

Also log when BOOT_COMPLETED_DELIVERED to all receivers:
ActivityManager: Finished processing BOOT_COMPLETED for u<USER_ID>

Test: CreateUsersNoAppCrashesTest is passing. New messages are logged.
Bug: 37751789
Change-Id: Idef634007e9dd5f957eb6c5e97f40f3e6ac6dd18
This commit is contained in:
Fyodor Kupolov
2017-04-28 17:38:10 -07:00
parent 080e16575a
commit 5ddcca7891
2 changed files with 11 additions and 2 deletions

View File

@@ -740,6 +740,8 @@ class AppErrors {
}
// If we've created a crash dialog, show it without the lock held
if(data.proc.crashDialog != null) {
Slog.i(TAG, "Showing crash dialog for package " + data.proc.info.packageName
+ " u" + data.proc.userId);
data.proc.crashDialog.show();
}
}

View File

@@ -439,7 +439,7 @@ final class UserController {
}
}
Slog.d(TAG, "Sending BOOT_COMPLETE user #" + userId);
Slog.i(TAG, "Sending BOOT_COMPLETE user #" + userId);
// Do not report secondary users, runtime restarts or first boot/upgrade
if (userId == UserHandle.USER_SYSTEM
&& !mInjector.isRuntimeRestarted() && !mInjector.isFirstBootOrUpgrade()) {
@@ -451,7 +451,14 @@ final class UserController {
bootIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
bootIntent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT
| Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
mInjector.broadcastIntentLocked(bootIntent, null, null, 0, null, null,
mInjector.broadcastIntentLocked(bootIntent, null, new IIntentReceiver.Stub() {
@Override
public void performReceive(Intent intent, int resultCode, String data,
Bundle extras, boolean ordered, boolean sticky, int sendingUser)
throws RemoteException {
Slog.i(UserController.TAG, "Finished processing BOOT_COMPLETED for u" + userId);
}
}, 0, null, null,
new String[] { android.Manifest.permission.RECEIVE_BOOT_COMPLETED },
AppOpsManager.OP_NONE, null, true, false, MY_PID, SYSTEM_UID, userId);
}