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

Commit 4a54c1cd authored by Svetoslav's avatar Svetoslav Committed by The Android Automerger
Browse files

Not change the print options on printer change if possible.

If the user selects some print options from the dialog and then
changes the printer to one that has the same capabilities the
selections in the UI should not change.

bug:10631856

Change-Id: Ia76ce58c446815e3498d2f4b4739dee62d11d96a
parent bacef820
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -226,6 +226,12 @@ public final class PrintAttributes implements Parcelable {
        StringBuilder builder = new StringBuilder();
        builder.append("PrintAttributes{");
        builder.append("mediaSize: ").append(mMediaSize);
        if (mMediaSize != null) {
            builder.append(", orientation: ").append(mMediaSize.isPortrait()
                    ? "portrait" : "landscape");
        } else {
            builder.append(", orientation: ").append("null");
        }
        builder.append(", resolution: ").append(mResolution);
        builder.append(", margins: ").append(mMargins);
        builder.append(", colorMode: ").append(colorModeToString(mColorMode));
@@ -880,12 +886,6 @@ public final class PrintAttributes implements Parcelable {
         * @param bottomMils The bottom margin in mils (thousands of an inch).
         */
        public Margins(int leftMils, int topMils, int rightMils, int bottomMils) {
            if (leftMils > rightMils) {
                throw new IllegalArgumentException("leftMils cannot be less than rightMils.");
            }
            if (topMils > bottomMils) {
                throw new IllegalArgumentException("topMils cannot be less than bottomMils.");
            }
            mTopMils = topMils;
            mLeftMils = leftMils;
            mRightMils = rightMils;
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.print;


/**
 * This class represents a print job from the perspective of
 * an application.
+201 −115

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Diff line number Diff line
@@ -447,7 +447,9 @@ final class RemotePrintService implements DeathRecipient {
                Slog.i(LOG_TAG, "[user: " + mUserId + "] stopPrinterTracking()");
            }
            // We are no longer tracking the printer.
            mTrackedPrinterList.remove(printerId);
            if (mTrackedPrinterList == null || !mTrackedPrinterList.remove(printerId)) {
                return;
            }
            if (mTrackedPrinterList.isEmpty()) {
                mTrackedPrinterList = null;
            }