Dump all users when dumpsys overlay is invoked

Currently bugreports are missing OMS settings for non-system users. This
change dumps overlay information for all users when the --user flag is
not provided and it fixes the --user flag not parsing the specified id
correctly.

Bug: 137796495
Bug: 136549878
bug: 140734485
Test: manual
Change-Id: I0d545253179b3545307b88b3151d11fd9e6cbd5b
(cherry picked from commit b7ef06ac37)
This commit is contained in:
Ryan Mitchell
2019-07-17 17:16:23 -07:00
committed by Nicholas Sauer
parent fcb2ce1503
commit bb2cef6b04

View File

@@ -751,7 +751,7 @@ public final class OverlayManagerService extends SystemService {
@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
final DumpState dumpState = new DumpState();
dumpState.setUserId(UserHandle.getUserId(Binder.getCallingUid()));
dumpState.setUserId(UserHandle.USER_ALL);
int opti = 0;
while (opti < args.length) {
@@ -771,13 +771,13 @@ public final class OverlayManagerService extends SystemService {
pw.println(" so the following are equivalent: mState, mstate, State, state.");
return;
} else if ("--user".equals(opt)) {
opti++;
if (opti >= args.length) {
pw.println("Error: user missing argument");
return;
}
try {
dumpState.setUserId(Integer.parseInt(args[opti]));
opti++;
} catch (NumberFormatException e) {
pw.println("Error: user argument is not a number: " + args[opti]);
return;