Check for amInternal nullness on user.dump()

Bug: 133242016
Test: manual verification

Change-Id: I4f669c94b0be5f15465446cf768d16e483b440a4
This commit is contained in:
Felipe Leme
2019-10-04 16:23:16 -07:00
parent 5284336dec
commit 5b8dc76c0e

View File

@@ -3897,9 +3897,14 @@ public class UserManagerService extends IUserManager.Stub {
long now = System.currentTimeMillis();
final long nowRealtime = SystemClock.elapsedRealtime();
final int currentUser = LocalServices.getService(ActivityManagerInternal.class)
.getCurrentUserId();
pw.print("Current user: "); pw.println(currentUser);
final ActivityManagerInternal amInternal = LocalServices
.getService(ActivityManagerInternal.class);
pw.print("Current user: ");
if (amInternal != null) {
pw.println(amInternal.getCurrentUserId());
} else {
pw.println("N/A");
}
StringBuilder sb = new StringBuilder();
synchronized (mPackagesLock) {