Merge "Correct page order for some face-up printers"
diff --git a/jni/ipphelper/ipphelper.c b/jni/ipphelper/ipphelper.c
index 27a4090..7daf8af 100644
--- a/jni/ipphelper/ipphelper.c
+++ b/jni/ipphelper/ipphelper.c
@@ -1051,6 +1051,15 @@
             capabilities->faceDownTray = 0;
         }
     }
+    if ((attrptr = ippFindAttribute(response, "printer-output-tray", IPP_TAG_STRING)) != NULL) {
+        for (i = 0; i < ippGetCount(attrptr); i++) {
+            int length = 0;
+            const char *tray_str = ippGetOctetString(attrptr, i, &length);
+            if (strstr(tray_str, "faceUp") != NULL) {
+                capabilities->faceDownTray = 0;
+            }
+        }
+    }
 
     // Determine supported document format details
     if ((attrptr = ippFindAttribute(response, "document-format-details-supported",
diff --git a/jni/ipphelper/ippstatus_capabilities.c b/jni/ipphelper/ippstatus_capabilities.c
index 9c596cb..f6c8ea7 100644
--- a/jni/ipphelper/ippstatus_capabilities.c
+++ b/jni/ipphelper/ippstatus_capabilities.c
@@ -56,6 +56,7 @@
         "output-bin-supported",
         "print-color-mode-supported",
         "print-quality-supported",
+        "printer-output-tray",
         "printer-resolution-supported",
         "sides-supported",
         "printer-device-id",