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

Commit cc65b0c3 authored by Svetoslav's avatar Svetoslav
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 26267660
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -226,6 +226,12 @@ public final class PrintAttributes implements Parcelable {
        StringBuilder builder = new StringBuilder();
        StringBuilder builder = new StringBuilder();
        builder.append("PrintAttributes{");
        builder.append("PrintAttributes{");
        builder.append("mediaSize: ").append(mMediaSize);
        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(", resolution: ").append(mResolution);
        builder.append(", margins: ").append(mMargins);
        builder.append(", margins: ").append(mMargins);
        builder.append(", colorMode: ").append(colorModeToString(mColorMode));
        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).
         * @param bottomMils The bottom margin in mils (thousands of an inch).
         */
         */
        public Margins(int leftMils, int topMils, int rightMils, int bottomMils) {
        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;
            mTopMils = topMils;
            mLeftMils = leftMils;
            mLeftMils = leftMils;
            mRightMils = rightMils;
            mRightMils = rightMils;
+0 −1
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package android.print;
package android.print;



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

File changed.

Preview size limit exceeded, changes collapsed.

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