/** Called by the Binder stub. */
  void dump(String[] args, PrintWriter pw) {
    synchronized (mLock) {
      final long screenOnTime = getScreenOnTimeLocked(checkAndGetTimeLocked());
      IndentingPrintWriter idpw = new IndentingPrintWriter(pw, "  ");
      ArraySet<String> argSet = new ArraySet<>();
      argSet.addAll(Arrays.asList(args));

      final int userCount = mUserState.size();
      for (int i = 0; i < userCount; i++) {
        idpw.printPair("user", mUserState.keyAt(i));
        idpw.println();
        idpw.increaseIndent();
        if (argSet.contains("--checkin")) {
          mUserState.valueAt(i).checkin(idpw, screenOnTime);
        } else {
          mUserState.valueAt(i).dump(idpw, screenOnTime);
          idpw.println();
          if (args.length > 0 && "history".equals(args[0])) {
            mAppIdleHistory.dump(idpw, mUserState.keyAt(i));
          }
        }
        idpw.decreaseIndent();
      }
      pw.write("Screen On Timebase:" + mScreenOnTime + "\n");
    }
  }
 @Override
 public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
   final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ", 160);
   synchronized (mRootsLock) {
     for (int i = 0; i < mRoots.size(); i++) {
       final RootInfo root = mRoots.valueAt(i);
       pw.println("Root{" + root.rootId + "}:");
       pw.increaseIndent();
       pw.printPair("flags", DebugUtils.flagsToString(Root.class, "FLAG_", root.flags));
       pw.println();
       pw.printPair("title", root.title);
       pw.printPair("docId", root.docId);
       pw.println();
       pw.printPair("path", root.path);
       pw.printPair("visiblePath", root.visiblePath);
       pw.decreaseIndent();
       pw.println();
     }
   }
 }