Example #1
0
  /** Run the message queue in this thread. Be sure to call {@link #quit()} to end the loop. */
  public static void loop() {
    final Looper me = myLooper();
    if (me == null) {
      throw new RuntimeException("No Looper; Looper.prepare() wasn't called on this thread.");
    }
    final MessageQueue queue = me.mQueue;

    for (; ; ) {
      Message msg = queue.next(); // might block
      if (msg == null) {
        // No message indicates that the message queue is quitting.
        return;
      }

      // This must be in a local variable, in case a UI event sets the logger
      Printer logging = me.mLogging;
      if (logging != null) {
        logging.println(
            ">>>>> Dispatching to " + msg.target + " " + msg.callback + ": " + msg.what);
      }

      msg.target.dispatchMessage(msg);

      if (logging != null) {
        logging.println("<<<<< Finished to " + msg.target + " " + msg.callback);
      }

      msg.recycleUnchecked();
    }
  }
 public final void dump(Printer pw, String prefix) {
   pw.println(prefix + this + " @ " + SystemClock.uptimeMillis());
   if (mLooper == null) {
     pw.println(prefix + "looper uninitialized");
   } else {
     mLooper.dump(pw, prefix + "  ");
   }
 }
  /** Run the message queue in this thread. Be sure to call {@link #quit()} to end the loop. */
  public static void loop() {
    final Looper me = myLooper();
    if (me == null) {
      throw new RuntimeException("No Looper; Looper.prepare() wasn't called on this thread.");
    }
    final MessageQueue queue = me.mQueue;

    // Make sure the identity of this thread is that of the local process,
    // and keep track of what that identity token actually is.
    Binder.clearCallingIdentity();
    final long ident = Binder.clearCallingIdentity();

    for (; ; ) {
      Message msg = queue.next(); // might block
      if (msg == null) {
        // No message indicates that the message queue is quitting.
        return;
      }

      // This must be in a local variable, in case a UI event sets the logger
      Printer logging = me.mLogging;
      if (logging != null) {
        logging.println(
            ">>>>> Dispatching to " + msg.target + " " + msg.callback + ": " + msg.what);
      }

      msg.target.dispatchMessage(msg);

      if (logging != null) {
        logging.println("<<<<< Finished to " + msg.target + " " + msg.callback);
      }

      // Make sure that during the course of dispatching the
      // identity of the thread wasn't corrupted.
      final long newIdent = Binder.clearCallingIdentity();
      if (ident != newIdent) {
        Log.wtf(
            TAG,
            "Thread identity changed from 0x"
                + Long.toHexString(ident)
                + " to 0x"
                + Long.toHexString(newIdent)
                + " while dispatching to "
                + msg.target.getClass().getName()
                + " "
                + msg.callback
                + " what="
                + msg.what);
      }

      msg.recycleUnchecked();
    }
  }
 /** Dump a CrashInfo instance to a Printer. */
 public void dump(Printer pw, String prefix) {
   pw.println(prefix + "exceptionClassName: " + exceptionClassName);
   pw.println(prefix + "exceptionMessage: " + exceptionMessage);
   pw.println(prefix + "throwFileName: " + throwFileName);
   pw.println(prefix + "throwClassName: " + throwClassName);
   pw.println(prefix + "throwMethodName: " + throwMethodName);
   pw.println(prefix + "throwLineNumber: " + throwLineNumber);
   pw.println(prefix + "stackTrace: " + stackTrace);
 }
 public void dump(Printer pw, String prefix) {
   if (filter != null) {
     pw.println(prefix + "Filter:");
     filter.dump(pw, prefix + "  ");
   }
   pw.println(
       prefix
           + "priority="
           + priority
           + " preferredOrder="
           + preferredOrder
           + " match=0x"
           + Integer.toHexString(match)
           + " specificIndex="
           + specificIndex
           + " isDefault="
           + isDefault);
   if (resolvePackageName != null) {
     pw.println(prefix + "resolvePackageName=" + resolvePackageName);
   }
   if (labelRes != 0 || nonLocalizedLabel != null || icon != 0) {
     pw.println(
         prefix
             + "labelRes=0x"
             + Integer.toHexString(labelRes)
             + " nonLocalizedLabel="
             + nonLocalizedLabel
             + " icon=0x"
             + Integer.toHexString(icon));
   }
   if (activityInfo != null) {
     pw.println(prefix + "ActivityInfo:");
     activityInfo.dump(pw, prefix + "  ");
   } else if (serviceInfo != null) {
     pw.println(prefix + "ServiceInfo:");
     serviceInfo.dump(pw, prefix + "  ");
   } else if (providerInfo != null) {
     pw.println(prefix + "ProviderInfo:");
     providerInfo.dump(pw, prefix + "  ");
   }
 }
Example #6
0
 public void dump(Printer pw, String prefix) {
   pw.println(prefix + this);
   pw.println(prefix + "mRun=" + mRun);
   pw.println(prefix + "mThread=" + mThread);
   pw.println(prefix + "mQueue=" + ((mQueue != null) ? mQueue : "(null"));
   if (mQueue != null) {
     synchronized (mQueue) {
       long now = SystemClock.uptimeMillis();
       Message msg = mQueue.mMessages;
       int n = 0;
       while (msg != null) {
         pw.println(prefix + "  Message " + n + ": " + msg.toString(now));
         n++;
         msg = msg.next;
       }
       pw.println(prefix + "(Total messages: " + n + ")");
     }
   }
 }
  /** Dump the report to a Printer. */
  public void dump(Printer pw, String prefix) {
    pw.println(prefix + "type: " + type);
    pw.println(prefix + "packageName: " + packageName);
    pw.println(prefix + "installerPackageName: " + installerPackageName);
    pw.println(prefix + "processName: " + processName);
    pw.println(prefix + "time: " + time);
    pw.println(prefix + "systemApp: " + systemApp);

    switch (type) {
      case TYPE_CRASH:
        crashInfo.dump(pw, prefix);
        break;
      case TYPE_ANR:
        anrInfo.dump(pw, prefix);
        break;
      case TYPE_BATTERY:
        batteryInfo.dump(pw, prefix);
        break;
    }
  }
Example #8
0
 public void dump(Printer pw, String prefix) {
   pw.println(prefix + toString());
   mQueue.dump(pw, prefix + "  ");
 }
 /**
  * Dumps the state of the looper for debugging purposes.
  *
  * @param pw A printer to receive the contents of the dump.
  * @param prefix A prefix to prepend to each line which is printed.
  */
 public void dump(@NonNull Printer pw, @NonNull String prefix) {
   pw.println(prefix + toString());
   mQueue.dump(pw, prefix + "  ");
 }
 public void dump(Printer pw, String prefix) {
   super.dumpFront(pw, prefix);
   if (className != null) {
     pw.println(prefix + "className=" + className);
   }
   if (permission != null) {
     pw.println(prefix + "permission=" + permission);
   }
   pw.println(prefix + "processName=" + processName);
   pw.println(prefix + "taskAffinity=" + taskAffinity);
   pw.println(
       prefix
           + "uid="
           + uid
           + " flags=0x"
           + Integer.toHexString(flags)
           + " theme=0x"
           + Integer.toHexString(theme));
   pw.println(
       prefix
           + "requiresSmallestWidthDp="
           + requiresSmallestWidthDp
           + " compatibleWidthLimitDp="
           + compatibleWidthLimitDp
           + " largestWidthLimitDp="
           + largestWidthLimitDp);
   pw.println(prefix + "sourceDir=" + sourceDir);
   if (!Objects.equals(sourceDir, publicSourceDir)) {
     pw.println(prefix + "publicSourceDir=" + publicSourceDir);
   }
   if (!ArrayUtils.isEmpty(splitSourceDirs)) {
     pw.println(prefix + "splitSourceDirs=" + Arrays.toString(splitSourceDirs));
   }
   if (!ArrayUtils.isEmpty(splitPublicSourceDirs)
       && !Arrays.equals(splitSourceDirs, splitPublicSourceDirs)) {
     pw.println(prefix + "splitPublicSourceDirs=" + Arrays.toString(splitPublicSourceDirs));
   }
   if (resourceDirs != null) {
     pw.println(prefix + "resourceDirs=" + resourceDirs);
   }
   if (seinfo != null) {
     pw.println(prefix + "seinfo=" + seinfo);
   }
   pw.println(prefix + "dataDir=" + dataDir);
   if (sharedLibraryFiles != null) {
     pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles);
   }
   pw.println(
       prefix
           + "enabled="
           + enabled
           + " targetSdkVersion="
           + targetSdkVersion
           + " versionCode="
           + versionCode);
   if (manageSpaceActivityName != null) {
     pw.println(prefix + "manageSpaceActivityName=" + manageSpaceActivityName);
   }
   if (descriptionRes != 0) {
     pw.println(prefix + "description=0x" + Integer.toHexString(descriptionRes));
   }
   if (uiOptions != 0) {
     pw.println(prefix + "uiOptions=0x" + Integer.toHexString(uiOptions));
   }
   pw.println(prefix + "supportsRtl=" + (hasRtlSupport() ? "true" : "false"));
   super.dumpBack(pw, prefix);
 }
  void doDump(FileDescriptor fd, PrintWriter fout, String[] args) {
    final Printer p = new PrintWriterPrinter(fout);
    p.println("Input method client state for " + this + ":");

    p.println("  mService=" + mService);
    p.println("  mMainLooper=" + mMainLooper);
    p.println("  mIInputContext=" + mIInputContext);
    p.println(
        "  mActive="
            + mActive
            + " mHasBeenInactive="
            + mHasBeenInactive
            + " mBindSequence="
            + mBindSequence
            + " mCurId="
            + mCurId);
    p.println("  mCurMethod=" + mCurMethod);
    p.println("  mCurRootView=" + mCurRootView);
    p.println("  mServedView=" + mServedView);
    p.println(
        "  mNextServedNeedsStart=" + mNextServedNeedsStart + " mNextServedView=" + mNextServedView);
    p.println("  mServedConnecting=" + mServedConnecting);
    if (mCurrentTextBoxAttribute != null) {
      p.println("  mCurrentTextBoxAttribute:");
      mCurrentTextBoxAttribute.dump(p, "    ");
    } else {
      p.println("  mCurrentTextBoxAttribute: null");
    }
    p.println("  mServedInputConnection=" + mServedInputConnection);
    p.println("  mCompletions=" + mCompletions);
    p.println("  mCursorRect=" + mCursorRect);
    p.println(
        "  mCursorSelStart="
            + mCursorSelStart
            + " mCursorSelEnd="
            + mCursorSelEnd
            + " mCursorCandStart="
            + mCursorCandStart
            + " mCursorCandEnd="
            + mCursorCandEnd);
  }
 /** Dump a BatteryInfo instance to a Printer. */
 public void dump(Printer pw, String prefix) {
   pw.println(prefix + "durationMillis: " + durationMillis);
   pw.println(prefix + "serviceDetails: " + serviceDetails);
 }
 /** Dump a BatteryInfo instance to a Printer. */
 public void dump(Printer pw, String prefix) {
   pw.println(prefix + "usagePercent: " + usagePercent);
   pw.println(prefix + "durationMicros: " + durationMicros);
   pw.println(prefix + "usageDetails: " + usageDetails);
   pw.println(prefix + "checkinDetails: " + checkinDetails);
 }
 /** Dump an AnrInfo instance to a Printer. */
 public void dump(Printer pw, String prefix) {
   pw.println(prefix + "activity: " + activity);
   pw.println(prefix + "cause: " + cause);
   pw.println(prefix + "info: " + info);
 }