From d3547af8feb996fe06265d6e0209f3d40edd496d Mon Sep 17 00:00:00 2001 From: Rhed Jao Date: Fri, 29 Mar 2019 12:02:59 +0800 Subject: [PATCH] Dumps bound and enabled services in a11yManagerService Bug: 128422953 Test: dumpsys accessibility Change-Id: I2f1fd441818d0a7bd379a9e7d325bcb63b64c620 --- .../AccessibilityManagerService.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index 47cd917bf84ee..51ae5cf8900e9 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -2549,6 +2549,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub pw.append(", autoclickEnabled=" + userState.mIsAutoclickEnabled); pw.append(", nonInteractiveUiTimeout=" + userState.mNonInteractiveUiTimeout); pw.append(", interactiveUiTimeout=" + userState.mInteractiveUiTimeout); + pw.append(", installedServiceCount=" + userState.mInstalledServices.size()); if (mUiAutomationManager.isUiAutomationRunningLocked()) { pw.append(", "); mUiAutomationManager.dumpUiAutomationService(fd, pw, args); @@ -2556,7 +2557,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub } pw.append("}"); pw.println(); - pw.append(" services:{"); + pw.append(" Bound services:{"); final int serviceCount = userState.mBoundServices.size(); for (int j = 0; j < serviceCount; j++) { if (j > 0) { @@ -2567,6 +2568,30 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub AccessibilityServiceConnection service = userState.mBoundServices.get(j); service.dump(fd, pw, args); } + pw.println("}"); + pw.append(" Enabled services:{"); + Iterator it = userState.mEnabledServices.iterator(); + if (it.hasNext()) { + ComponentName componentName = it.next(); + pw.append(componentName.toShortString()); + while (it.hasNext()) { + componentName = it.next(); + pw.append(", "); + pw.append(componentName.toShortString()); + } + } + pw.println("}"); + pw.append(" Binding services:{"); + it = userState.mBindingServices.iterator(); + if (it.hasNext()) { + ComponentName componentName = it.next(); + pw.append(componentName.toShortString()); + while (it.hasNext()) { + componentName = it.next(); + pw.append(", "); + pw.append(componentName.toShortString()); + } + } pw.println("}]"); pw.println(); } @@ -2582,6 +2607,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub pw.append(window.toString()); pw.append(']'); } + pw.println(); } } }