Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a73a855d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add print job logging" into main

parents dc4c4aa9 1aed69d4
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -59,6 +59,21 @@ android_library {
        "android-support-core-ui",
        "android-support-fragment",
        "android-support-annotations",
        "printspooler_aconfig_flags_java_lib",
    ],
    manifest: "AndroidManifest.xml",
}

aconfig_declarations {
    name: "printspooler_aconfig_declarations",
    package: "com.android.printspooler.flags",
    container: "system",
    srcs: [
        "flags/flags.aconfig",
    ],
}

java_aconfig_library {
    name: "printspooler_aconfig_flags_java_lib",
    aconfig_declarations: "printspooler_aconfig_declarations",
}
+9 −0
Original line number Diff line number Diff line
package: "com.android.printspooler.flags"
container: "system"

flag {
  name: "log_print_jobs"
  namespace: "printing"
  description: "Log print job creation and state transitions."
  bug: "385340868"
}
+4 −3
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import com.android.internal.util.Preconditions;
import com.android.internal.util.dump.DualDumpOutputStream;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.printspooler.R;
import com.android.printspooler.flags.Flags;
import com.android.printspooler.util.ApprovedPrintServices;

import libcore.io.IoUtils;
@@ -493,7 +494,7 @@ public final class PrintSpoolerService extends Service {
            keepAwakeLocked();
        }

        if (DEBUG_PRINT_JOB_LIFECYCLE) {
        if (Flags.logPrintJobs() || DEBUG_PRINT_JOB_LIFECYCLE) {
            Slog.i(LOG_TAG, "[ADD] " + printJob);
        }
    }
@@ -506,7 +507,7 @@ public final class PrintSpoolerService extends Service {
                PrintJobInfo printJob = mPrintJobs.get(i);
                if (isObsoleteState(printJob.getState())) {
                    mPrintJobs.remove(i);
                    if (DEBUG_PRINT_JOB_LIFECYCLE) {
                    if (Flags.logPrintJobs() || DEBUG_PRINT_JOB_LIFECYCLE) {
                        Slog.i(LOG_TAG, "[REMOVE] " + printJob.getId().flattenToString());
                    }
                    removePrintJobFileLocked(printJob.getId());
@@ -568,7 +569,7 @@ public final class PrintSpoolerService extends Service {
                    checkIfStillKeepAwakeLocked();
                }

                if (DEBUG_PRINT_JOB_LIFECYCLE) {
                if (Flags.logPrintJobs() || DEBUG_PRINT_JOB_LIFECYCLE) {
                    Slog.i(LOG_TAG, "[STATE CHANGED] " + printJob);
                }