dump visiblity table in dumpsys accounts
Bug: 63170585
Test: adb shell dumpsys account
Change-Id: I3128fbeca710eef0e9a6f685690b1139b7eaf07d
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index a54fe72..c6f2fc0 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -5180,6 +5180,28 @@
fout.println();
mAuthenticatorCache.dump(fd, fout, args, userAccounts.userId);
+
+ boolean isUserUnlocked;
+ synchronized (mUsers) {
+ isUserUnlocked = isLocalUnlockedUser(userAccounts.userId);
+ }
+ // Following logs are printed only when user is unlocked.
+ if (!isUserUnlocked) {
+ return;
+ }
+ fout.println();
+ synchronized (userAccounts.dbLock) {
+ Map<Account, Map<String, Integer>> allVisibilityValues =
+ userAccounts.accountsDb.findAllVisibilityValues();
+ fout.println("Account visibility:");
+ for (Account account : allVisibilityValues.keySet()) {
+ fout.println(" " + account.name);
+ Map<String, Integer> visibilities = allVisibilityValues.get(account);
+ for (Entry<String, Integer> entry : visibilities.entrySet()) {
+ fout.println(" " + entry.getKey() + ", " + entry.getValue());
+ }
+ }
+ }
}
}