Search in sources :

Example 1 with ApprovedPrintServices

use of com.android.printspooler.util.ApprovedPrintServices in project android_frameworks_base by AOSPA.

the class PrintSpoolerService method dump.

@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    String prefix = (args.length > 0) ? args[0] : "";
    String tab = "  ";
    synchronized (mLock) {
        pw.append(prefix).append("print jobs:").println();
        final int printJobCount = mPrintJobs.size();
        for (int i = 0; i < printJobCount; i++) {
            PrintJobInfo printJob = mPrintJobs.get(i);
            pw.append(prefix).append(tab).append(printJob.toString());
            pw.println();
        }
        pw.append(prefix).append("print job files:").println();
        File[] files = getFilesDir().listFiles();
        if (files != null) {
            final int fileCount = files.length;
            for (int i = 0; i < fileCount; i++) {
                File file = files[i];
                if (file.isFile() && file.getName().startsWith(PRINT_JOB_FILE_PREFIX)) {
                    pw.append(prefix).append(tab).append(file.getName()).println();
                }
            }
        }
    }
    pw.append(prefix).append("approved print services:").println();
    Set<String> approvedPrintServices = (new ApprovedPrintServices(this)).getApprovedServices();
    if (approvedPrintServices != null) {
        for (String approvedService : approvedPrintServices) {
            pw.append(prefix).append(tab).append(approvedService).println();
        }
    }
}
Also used : PrintJobInfo(android.print.PrintJobInfo) ApprovedPrintServices(com.android.printspooler.util.ApprovedPrintServices) AtomicFile(android.util.AtomicFile) File(java.io.File)

Example 2 with ApprovedPrintServices

use of com.android.printspooler.util.ApprovedPrintServices in project android_frameworks_base by crdroidandroid.

the class PrintSpoolerService method dump.

@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    String prefix = (args.length > 0) ? args[0] : "";
    String tab = "  ";
    synchronized (mLock) {
        pw.append(prefix).append("print jobs:").println();
        final int printJobCount = mPrintJobs.size();
        for (int i = 0; i < printJobCount; i++) {
            PrintJobInfo printJob = mPrintJobs.get(i);
            pw.append(prefix).append(tab).append(printJob.toString());
            pw.println();
        }
        pw.append(prefix).append("print job files:").println();
        File[] files = getFilesDir().listFiles();
        if (files != null) {
            final int fileCount = files.length;
            for (int i = 0; i < fileCount; i++) {
                File file = files[i];
                if (file.isFile() && file.getName().startsWith(PRINT_JOB_FILE_PREFIX)) {
                    pw.append(prefix).append(tab).append(file.getName()).println();
                }
            }
        }
    }
    pw.append(prefix).append("approved print services:").println();
    Set<String> approvedPrintServices = (new ApprovedPrintServices(this)).getApprovedServices();
    if (approvedPrintServices != null) {
        for (String approvedService : approvedPrintServices) {
            pw.append(prefix).append(tab).append(approvedService).println();
        }
    }
}
Also used : PrintJobInfo(android.print.PrintJobInfo) ApprovedPrintServices(com.android.printspooler.util.ApprovedPrintServices) AtomicFile(android.util.AtomicFile) File(java.io.File)

Example 3 with ApprovedPrintServices

use of com.android.printspooler.util.ApprovedPrintServices in project platform_frameworks_base by android.

the class PrintSpoolerService method dump.

@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    String prefix = (args.length > 0) ? args[0] : "";
    String tab = "  ";
    synchronized (mLock) {
        pw.append(prefix).append("print jobs:").println();
        final int printJobCount = mPrintJobs.size();
        for (int i = 0; i < printJobCount; i++) {
            PrintJobInfo printJob = mPrintJobs.get(i);
            pw.append(prefix).append(tab).append(printJob.toString());
            pw.println();
        }
        pw.append(prefix).append("print job files:").println();
        File[] files = getFilesDir().listFiles();
        if (files != null) {
            final int fileCount = files.length;
            for (int i = 0; i < fileCount; i++) {
                File file = files[i];
                if (file.isFile() && file.getName().startsWith(PRINT_JOB_FILE_PREFIX)) {
                    pw.append(prefix).append(tab).append(file.getName()).println();
                }
            }
        }
    }
    pw.append(prefix).append("approved print services:").println();
    Set<String> approvedPrintServices = (new ApprovedPrintServices(this)).getApprovedServices();
    if (approvedPrintServices != null) {
        for (String approvedService : approvedPrintServices) {
            pw.append(prefix).append(tab).append(approvedService).println();
        }
    }
}
Also used : PrintJobInfo(android.print.PrintJobInfo) ApprovedPrintServices(com.android.printspooler.util.ApprovedPrintServices) AtomicFile(android.util.AtomicFile) File(java.io.File)

Example 4 with ApprovedPrintServices

use of com.android.printspooler.util.ApprovedPrintServices in project android_frameworks_base by DirtyUnicorns.

the class PrintSpoolerService method dump.

@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    String prefix = (args.length > 0) ? args[0] : "";
    String tab = "  ";
    synchronized (mLock) {
        pw.append(prefix).append("print jobs:").println();
        final int printJobCount = mPrintJobs.size();
        for (int i = 0; i < printJobCount; i++) {
            PrintJobInfo printJob = mPrintJobs.get(i);
            pw.append(prefix).append(tab).append(printJob.toString());
            pw.println();
        }
        pw.append(prefix).append("print job files:").println();
        File[] files = getFilesDir().listFiles();
        if (files != null) {
            final int fileCount = files.length;
            for (int i = 0; i < fileCount; i++) {
                File file = files[i];
                if (file.isFile() && file.getName().startsWith(PRINT_JOB_FILE_PREFIX)) {
                    pw.append(prefix).append(tab).append(file.getName()).println();
                }
            }
        }
    }
    pw.append(prefix).append("approved print services:").println();
    Set<String> approvedPrintServices = (new ApprovedPrintServices(this)).getApprovedServices();
    if (approvedPrintServices != null) {
        for (String approvedService : approvedPrintServices) {
            pw.append(prefix).append(tab).append(approvedService).println();
        }
    }
}
Also used : PrintJobInfo(android.print.PrintJobInfo) ApprovedPrintServices(com.android.printspooler.util.ApprovedPrintServices) AtomicFile(android.util.AtomicFile) File(java.io.File)

Example 5 with ApprovedPrintServices

use of com.android.printspooler.util.ApprovedPrintServices in project android_frameworks_base by ResurrectionRemix.

the class PrintSpoolerService method dump.

@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    String prefix = (args.length > 0) ? args[0] : "";
    String tab = "  ";
    synchronized (mLock) {
        pw.append(prefix).append("print jobs:").println();
        final int printJobCount = mPrintJobs.size();
        for (int i = 0; i < printJobCount; i++) {
            PrintJobInfo printJob = mPrintJobs.get(i);
            pw.append(prefix).append(tab).append(printJob.toString());
            pw.println();
        }
        pw.append(prefix).append("print job files:").println();
        File[] files = getFilesDir().listFiles();
        if (files != null) {
            final int fileCount = files.length;
            for (int i = 0; i < fileCount; i++) {
                File file = files[i];
                if (file.isFile() && file.getName().startsWith(PRINT_JOB_FILE_PREFIX)) {
                    pw.append(prefix).append(tab).append(file.getName()).println();
                }
            }
        }
    }
    pw.append(prefix).append("approved print services:").println();
    Set<String> approvedPrintServices = (new ApprovedPrintServices(this)).getApprovedServices();
    if (approvedPrintServices != null) {
        for (String approvedService : approvedPrintServices) {
            pw.append(prefix).append(tab).append(approvedService).println();
        }
    }
}
Also used : PrintJobInfo(android.print.PrintJobInfo) ApprovedPrintServices(com.android.printspooler.util.ApprovedPrintServices) AtomicFile(android.util.AtomicFile) File(java.io.File)

Aggregations

PrintJobInfo (android.print.PrintJobInfo)5 AtomicFile (android.util.AtomicFile)5 ApprovedPrintServices (com.android.printspooler.util.ApprovedPrintServices)5 File (java.io.File)5