Java Code Examples for android.util.Printer#println()

The following examples show how to use android.util.Printer#println() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextUtils.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
/**
 * Debugging tool to print the spans in a CharSequence.  The output will
 * be printed one span per line.  If the CharSequence is not a Spanned,
 * then the entire string will be printed on a single line.
 */
public static void dumpSpans(CharSequence cs, Printer printer, String prefix) {
    if (cs instanceof Spanned) {
        Spanned sp = (Spanned) cs;
        Object[] os = sp.getSpans(0, cs.length(), Object.class);

        for (int i = 0; i < os.length; i++) {
            Object o = os[i];
            printer.println(prefix + cs.subSequence(sp.getSpanStart(o),
                    sp.getSpanEnd(o)) + ": "
                    + Integer.toHexString(System.identityHashCode(o))
                    + " " + o.getClass().getCanonicalName()
                     + " (" + sp.getSpanStart(o) + "-" + sp.getSpanEnd(o)
                     + ") fl=#" + sp.getSpanFlags(o));
        }
    } else {
        printer.println(prefix + cs + ": (no spans)");
    }
}
 
Example 2
Source File: LatinIME.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 6 votes vote down vote up
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  VersionCode = " + ApplicationUtils.getVersionCode(this));
    p.println("  VersionName = " + ApplicationUtils.getVersionName(this));
    final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
    final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
    p.println("  Keyboard mode = " + keyboardMode);
    final SettingsValues settingsValues = mSettings.getCurrent();
    p.println(settingsValues.dump());
    p.println(mDictionaryFacilitator.dump(this /* context */));
    // TODO: Dump all settings values
}
 
Example 3
Source File: CountryDetectorService.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unused")
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
    if (!DumpUtils.checkDumpPermission(mContext, TAG, fout)) return;
    if (!DEBUG) return;
    try {
        final Printer p = new PrintWriterPrinter(fout);
        p.println("CountryDetectorService state:");
        p.println("  Number of listeners=" + mReceivers.keySet().size());
        if (mCountryDetector == null) {
            p.println("  ComprehensiveCountryDetector not initialized");
        } else {
            p.println("  " + mCountryDetector.toString());
        }
    } catch (Exception e) {
        Slog.e(TAG, "Failed to dump CountryDetectorService: ", e);
    }
}
 
Example 4
Source File: LatinIME.java    From openboard with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  VersionCode = " + ApplicationUtils.getVersionCode(this));
    p.println("  VersionName = " + ApplicationUtils.getVersionName(this));
    final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
    final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
    p.println("  Keyboard mode = " + keyboardMode);
    final SettingsValues settingsValues = mSettings.getCurrent();
    p.println(settingsValues.dump());
    p.println(mDictionaryFacilitator.dump(this /* context */));
    // TODO: Dump all settings values
}
 
Example 5
Source File: Handler.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
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 + "  ");
    }
}
 
Example 6
Source File: ComponentInfo.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
void dumpBack(Printer pw, String prefix, int dumpFlags) {
    if ((dumpFlags & DUMP_FLAG_APPLICATION) != 0) {
        if (applicationInfo != null) {
            pw.println(prefix + "ApplicationInfo:");
            applicationInfo.dump(pw, prefix + "  ", dumpFlags);
        } else {
            pw.println(prefix + "ApplicationInfo: null");
        }
    }
    super.dumpBack(pw, prefix);
}
 
Example 7
Source File: InputMethodManager.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
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
            + " mRestartOnNextWindowFocus=" + mRestartOnNextWindowFocus
            + " mBindSequence=" + mBindSequence
            + " mCurId=" + mCurId);
    p.println("  mFullscreenMode=" + mFullscreenMode);
    p.println("  mCurMethod=" + mCurMethod);
    p.println("  mCurRootView=" + mCurRootView);
    p.println("  mServedView=" + mServedView);
    p.println("  mNextServedView=" + mNextServedView);
    p.println("  mServedConnecting=" + mServedConnecting);
    if (mCurrentTextBoxAttribute != null) {
        p.println("  mCurrentTextBoxAttribute:");
        mCurrentTextBoxAttribute.dump(p, "    ");
    } else {
        p.println("  mCurrentTextBoxAttribute: null");
    }
    p.println("  mServedInputConnectionWrapper=" + mServedInputConnectionWrapper);
    p.println("  mCompletions=" + Arrays.toString(mCompletions));
    p.println("  mCursorRect=" + mCursorRect);
    p.println("  mCursorSelStart=" + mCursorSelStart
            + " mCursorSelEnd=" + mCursorSelEnd
            + " mCursorCandStart=" + mCursorCandStart
            + " mCursorCandEnd=" + mCursorCandEnd);
    p.println("  mNextUserActionNotificationSequenceNumber="
            + mNextUserActionNotificationSequenceNumber
            + " mLastSentUserActionNotificationSequenceNumber="
            + mLastSentUserActionNotificationSequenceNumber);
}
 
Example 8
Source File: ProviderInfo.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/** @hide */
public void dump(Printer pw, String prefix, int dumpFlags) {
    super.dumpFront(pw, prefix);
    pw.println(prefix + "authority=" + authority);
    pw.println(prefix + "flags=0x" + Integer.toHexString(flags));
    super.dumpBack(pw, prefix, dumpFlags);
}
 
Example 9
Source File: SQLiteConnection.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public void dump(Printer printer, boolean verbose) {
    synchronized (mOperations) {
        printer.println("  Most recently executed operations:");
        int index = mIndex;
        Operation operation = mOperations[index];
        if (operation != null) {
            // Note: SimpleDateFormat is not thread-safe, cannot be compile-time created,
            // and is relatively expensive to create during preloading. This method is only
            // used when dumping a connection, which is a rare (mainly error) case.
            SimpleDateFormat opDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
            int n = 0;
            do {
                StringBuilder msg = new StringBuilder();
                msg.append("    ").append(n).append(": [");
                String formattedStartTime = opDF.format(new Date(operation.mStartWallTime));
                msg.append(formattedStartTime);
                msg.append("] ");
                operation.describe(msg, verbose);
                printer.println(msg.toString());

                if (index > 0) {
                    index -= 1;
                } else {
                    index = MAX_RECENT_OPERATIONS - 1;
                }
                n += 1;
                operation = mOperations[index];
            } while (operation != null && n < MAX_RECENT_OPERATIONS);
        } else {
            printer.println("    <none>");
        }
    }
}
 
Example 10
Source File: SQLiteConnection.java    From sqlite-android with Apache License 2.0 5 votes vote down vote up
/**
 * Dumps debugging information about this connection, in the case where the
 * caller might not actually own the connection.
 *
 * This function is written so that it may be called by a thread that does not
 * own the connection.  We need to be very careful because the connection state is
 * not synchronized.
 *
 * At worst, the method may return stale or slightly wrong data, however
 * it should not crash.  This is ok as it is only used for diagnostic purposes.
 *
 * @param printer The printer to receive the dump, not null.
 * @param verbose True to dump more verbose information.
 */
void dumpUnsafe(Printer printer, boolean verbose) {
    printer.println("Connection #" + mConnectionId + ":");
    if (verbose) {
        printer.println("  connectionPtr: 0x" + Long.toHexString(mConnectionPtr));
    }
    printer.println("  isPrimaryConnection: " + mIsPrimaryConnection);
    printer.println("  onlyAllowReadOnlyOperations: " + mOnlyAllowReadOnlyOperations);

    mRecentOperations.dump(printer, verbose);

    if (verbose) {
        mPreparedStatementCache.dump(printer);
    }
}
 
Example 11
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
public void dump(Printer pw, String prefix, int flags) {
    super.dumpFront(pw, prefix);
    if ((flags&DUMP_FLAG_DETAILS) != 0 && className != null) {
        pw.println(prefix + "className=" + className);
    }
    if (permission != null) {
        pw.println(prefix + "permission=" + permission);
    }
    pw.println(prefix + "processName=" + processName);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "taskAffinity=" + taskAffinity);
    }
    pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
            + " privateFlags=0x" + Integer.toHexString(privateFlags)
            + " theme=0x" + Integer.toHexString(theme));
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        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=" + Arrays.toString(resourceDirs));
    }
    if ((flags&DUMP_FLAG_DETAILS) != 0 && seInfo != null) {
        pw.println(prefix + "seinfo=" + seInfo);
        pw.println(prefix + "seinfoUser=" + seInfoUser);
    }
    pw.println(prefix + "dataDir=" + dataDir);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir);
        pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir);
        if (sharedLibraryFiles != null) {
            pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
        }
    }
    pw.println(prefix + "enabled=" + enabled
            + " minSdkVersion=" + minSdkVersion
            + " targetSdkVersion=" + targetSdkVersion
            + " versionCode=" + versionCode
            + " targetSandboxVersion=" + targetSandboxVersion);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        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"));
        if (fullBackupContent > 0) {
            pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent);
        } else {
            pw.println(prefix + "fullBackupContent="
                    + (fullBackupContent < 0 ? "false" : "true"));
        }
        if (networkSecurityConfigRes != 0) {
            pw.println(prefix + "networkSecurityConfigRes=0x"
                    + Integer.toHexString(networkSecurityConfigRes));
        }
        if (category != CATEGORY_UNDEFINED) {
            pw.println(prefix + "category=" + category);
        }
    }
    super.dumpBack(pw, prefix);
}
 
Example 12
Source File: WallpaperInfo.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
public void dump(Printer pw, String prefix) {
    pw.println(prefix + "Service:");
    mService.dump(pw, prefix + "  ");
    pw.println(prefix + "mSettingsActivityName=" + mSettingsActivityName);
}
 
Example 13
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
public void dump(Printer pw, String prefix, int flags) {
    super.dumpFront(pw, prefix);
    if ((flags&DUMP_FLAG_DETAILS) != 0 && className != null) {
        pw.println(prefix + "className=" + className);
    }
    if (permission != null) {
        pw.println(prefix + "permission=" + permission);
    }
    pw.println(prefix + "processName=" + processName);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "taskAffinity=" + taskAffinity);
    }
    pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
            + " privateFlags=0x" + Integer.toHexString(privateFlags)
            + " theme=0x" + Integer.toHexString(theme));
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        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=" + Arrays.toString(resourceDirs));
    }
    if ((flags&DUMP_FLAG_DETAILS) != 0 && seinfo != null) {
        pw.println(prefix + "seinfo=" + seinfo);
    }
    pw.println(prefix + "dataDir=" + dataDir);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir);
        pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir);
        if (sharedLibraryFiles != null) {
            pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
        }
    }
    pw.println(prefix + "enabled=" + enabled
            + " minSdkVersion=" + minSdkVersion
            + " targetSdkVersion=" + targetSdkVersion
            + " versionCode=" + versionCode);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        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"));
        if (fullBackupContent > 0) {
            pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent);
        } else {
            pw.println(prefix + "fullBackupContent="
                    + (fullBackupContent < 0 ? "false" : "true"));
        }
        if (networkSecurityConfigRes != 0) {
            pw.println(prefix + "networkSecurityConfigRes=0x"
                    + Integer.toHexString(networkSecurityConfigRes));
        }
    }
    super.dumpBack(pw, prefix);
}
 
Example 14
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
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 (sourceDir == null) {
        if (publicSourceDir != null) {
            pw.println(prefix + "publicSourceDir=" + publicSourceDir);
        }
    } else if (!sourceDir.equals(publicSourceDir)) {
        pw.println(prefix + "publicSourceDir=" + publicSourceDir);
    }
    if (resourceDirs != null) {
        pw.println(prefix + "resourceDirs=" + resourceDirs);
    }
    pw.println(prefix + "dataDir=" + dataDir);
    if (sharedLibraryFiles != null) {
        pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles);
    }
    pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion);
    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);
}
 
Example 15
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
public void dump(Printer pw, String prefix, int dumpFlags) {
    super.dumpFront(pw, prefix);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && className != null) {
        pw.println(prefix + "className=" + className);
    }
    if (permission != null) {
        pw.println(prefix + "permission=" + permission);
    }
    pw.println(prefix + "processName=" + processName);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "taskAffinity=" + taskAffinity);
    }
    pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
            + " privateFlags=0x" + Integer.toHexString(privateFlags)
            + " theme=0x" + Integer.toHexString(theme));
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        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=" + Arrays.toString(resourceDirs));
    }
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && seInfo != null) {
        pw.println(prefix + "seinfo=" + seInfo);
        pw.println(prefix + "seinfoUser=" + seInfoUser);
    }
    pw.println(prefix + "dataDir=" + dataDir);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir);
        pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir);
        if (sharedLibraryFiles != null) {
            pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
        }
    }
    if (classLoaderName != null) {
        pw.println(prefix + "classLoaderName=" + classLoaderName);
    }
    if (!ArrayUtils.isEmpty(splitClassLoaderNames)) {
        pw.println(prefix + "splitClassLoaderNames=" + Arrays.toString(splitClassLoaderNames));
    }

    pw.println(prefix + "enabled=" + enabled
            + " minSdkVersion=" + minSdkVersion
            + " targetSdkVersion=" + targetSdkVersion
            + " versionCode=" + longVersionCode
            + " targetSandboxVersion=" + targetSandboxVersion);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        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"));
        if (fullBackupContent > 0) {
            pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent);
        } else {
            pw.println(prefix + "fullBackupContent="
                    + (fullBackupContent < 0 ? "false" : "true"));
        }
        if (networkSecurityConfigRes != 0) {
            pw.println(prefix + "networkSecurityConfigRes=0x"
                    + Integer.toHexString(networkSecurityConfigRes));
        }
        if (category != CATEGORY_UNDEFINED) {
            pw.println(prefix + "category=" + category);
        }
        pw.println(prefix + "HiddenApiEnforcementPolicy=" + getHiddenApiEnforcementPolicy());
        pw.println(prefix + "usesNonSdkApi=" + usesNonSdkApi());
        pw.println(prefix + "allowsPlaybackCapture="
                    + (isAudioPlaybackCaptureAllowed() ? "true" : "false"));
    }
    super.dumpBack(pw, prefix);
}
 
Example 16
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 17
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
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 (sourceDir == null) {
        if (publicSourceDir != null) {
            pw.println(prefix + "publicSourceDir=" + publicSourceDir);
        }
    } else if (!sourceDir.equals(publicSourceDir)) {
        pw.println(prefix + "publicSourceDir=" + publicSourceDir);
    }
    if (resourceDirs != null) {
        pw.println(prefix + "resourceDirs=" + resourceDirs);
    }
    pw.println(prefix + "dataDir=" + dataDir);
    if (sharedLibraryFiles != null) {
        pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles);
    }
    pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion);
    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));
    }
    super.dumpBack(pw, prefix);
}
 
Example 18
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
public void dump(Printer pw, String prefix, int dumpFlags) {
    super.dumpFront(pw, prefix);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && className != null) {
        pw.println(prefix + "className=" + className);
    }
    if (permission != null) {
        pw.println(prefix + "permission=" + permission);
    }
    pw.println(prefix + "processName=" + processName);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "taskAffinity=" + taskAffinity);
    }
    pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
            + " privateFlags=0x" + Integer.toHexString(privateFlags)
            + " theme=0x" + Integer.toHexString(theme));
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        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=" + Arrays.toString(resourceDirs));
    }
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && seInfo != null) {
        pw.println(prefix + "seinfo=" + seInfo);
        pw.println(prefix + "seinfoUser=" + seInfoUser);
    }
    pw.println(prefix + "dataDir=" + dataDir);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir);
        pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir);
        if (sharedLibraryFiles != null) {
            pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
        }
    }
    if (classLoaderName != null) {
        pw.println(prefix + "classLoaderName=" + classLoaderName);
    }
    if (!ArrayUtils.isEmpty(splitClassLoaderNames)) {
        pw.println(prefix + "splitClassLoaderNames=" + Arrays.toString(splitClassLoaderNames));
    }

    pw.println(prefix + "enabled=" + enabled
            + " minSdkVersion=" + minSdkVersion
            + " targetSdkVersion=" + targetSdkVersion
            + " versionCode=" + longVersionCode
            + " targetSandboxVersion=" + targetSandboxVersion);
    if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) {
        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"));
        if (fullBackupContent > 0) {
            pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent);
        } else {
            pw.println(prefix + "fullBackupContent="
                    + (fullBackupContent < 0 ? "false" : "true"));
        }
        if (networkSecurityConfigRes != 0) {
            pw.println(prefix + "networkSecurityConfigRes=0x"
                    + Integer.toHexString(networkSecurityConfigRes));
        }
        if (category != CATEGORY_UNDEFINED) {
            pw.println(prefix + "category=" + category);
        }
        pw.println(prefix + "HiddenApiEnforcementPolicy=" + getHiddenApiEnforcementPolicy());
    }
    super.dumpBack(pw, prefix);
}
 
Example 19
Source File: ApplicationInfo.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
public void dump(Printer pw, String prefix, int flags) {
    super.dumpFront(pw, prefix);
    if ((flags&DUMP_FLAG_DETAILS) != 0 && className != null) {
        pw.println(prefix + "className=" + className);
    }
    if (permission != null) {
        pw.println(prefix + "permission=" + permission);
    }
    pw.println(prefix + "processName=" + processName);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "taskAffinity=" + taskAffinity);
    }
    pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
            + " privateFlags=0x" + Integer.toHexString(privateFlags)
            + " theme=0x" + Integer.toHexString(theme));
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        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=" + Arrays.toString(resourceDirs));
    }
    if ((flags&DUMP_FLAG_DETAILS) != 0 && seinfo != null) {
        pw.println(prefix + "seinfo=" + seinfo);
    }
    pw.println(prefix + "dataDir=" + dataDir);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir);
        pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir);
        if (sharedLibraryFiles != null) {
            pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
        }
    }
    pw.println(prefix + "enabled=" + enabled
            + " minSdkVersion=" + minSdkVersion
            + " targetSdkVersion=" + targetSdkVersion
            + " versionCode=" + versionCode);
    if ((flags&DUMP_FLAG_DETAILS) != 0) {
        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"));
        if (fullBackupContent > 0) {
            pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent);
        } else {
            pw.println(prefix + "fullBackupContent="
                    + (fullBackupContent < 0 ? "false" : "true"));
        }
        if (networkSecurityConfigRes != 0) {
            pw.println(prefix + "networkSecurityConfigRes=0x"
                    + Integer.toHexString(networkSecurityConfigRes));
        }
    }
    super.dumpBack(pw, prefix);
}
 
Example 20
Source File: Looper.java    From android_9.0.0_r45 with Apache License 2.0 2 votes vote down vote up
/**
 * 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.
 * @param handler Only dump messages for this Handler.
 * @hide
 */
public void dump(@NonNull Printer pw, @NonNull String prefix, Handler handler) {
    pw.println(prefix + toString());
    mQueue.dump(pw, prefix + "  ", handler);
}