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

Commit 6e75e7dd authored by Chris Wren's avatar Chris Wren Committed by Android (Google) Code Review
Browse files

Merge "Instrument printing service for metrics collection." into mnc-dev

parents f92a1fdb dcc34fd8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.util.Log;
import android.util.Slog;
import android.util.Xml;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.os.HandlerCaller;
import com.android.internal.util.FastXmlSerializer;
import com.android.printspooler.R;
@@ -493,6 +494,7 @@ public final class PrintSpoolerService extends Service {
                    Slog.i(LOG_TAG, "[STATE CHANGED] " + printJob);
                }

                MetricsLogger.histogram(this, "print_job_state", state);
                switch (state) {
                    case PrintJobInfo.STATE_COMPLETED:
                    case PrintJobInfo.STATE_CANCELED:
+4 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;

import com.android.internal.logging.MetricsLogger;
import com.android.printspooler.R;
import com.android.printspooler.model.MutexFileProvider;
import com.android.printspooler.model.PrintSpoolerProvider;
@@ -325,6 +326,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
        if (mState != STATE_INITIALIZING && mCurrentPrinter != null) {
            mPrinterRegistry.setTrackedPrinter(mCurrentPrinter.getId());
        }
        MetricsLogger.count(this, "print_preview", 1);
    }

    @Override
@@ -1074,6 +1076,8 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
    private void confirmPrint() {
        setState(STATE_PRINT_CONFIRMED);

        MetricsLogger.count(this, "print_confirmed", 1);

        updateOptionsUi();
        addCurrentPrinterToHistory();