disable print on older system.

Change-Id: I003aa965c885e6c7f65ade51b024bad400e8e458
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 0fe1dd5..c89316d 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -993,6 +993,10 @@
         MenuItem undoItem = mMenu.findItem(R.id.undoButton);
         MenuItem redoItem = mMenu.findItem(R.id.redoButton);
         MenuItem resetItem = mMenu.findItem(R.id.resetHistoryButton);
+        MenuItem printItem = mMenu.findItem(R.id.printButton);
+        if (!PrintJob.systemSupportsPrint()) {
+            printItem.setVisible(false);
+        }
         mMasterImage.getHistory().setMenuItems(undoItem, redoItem, resetItem);
     }
 
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 48cbe73..cbf9a87 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -39,6 +39,7 @@
 import com.android.gallery3d.filtershow.crop.CropActivity;
 import com.android.gallery3d.util.Future;
 import com.android.gallery3d.util.GalleryUtils;
+import com.android.gallery3d.util.PrintJob;
 import com.android.gallery3d.util.ThreadPool.Job;
 import com.android.gallery3d.util.ThreadPool.JobContext;
 
@@ -178,6 +179,7 @@
         boolean supportEdit = (supported & MediaObject.SUPPORT_EDIT) != 0;
         boolean supportInfo = (supported & MediaObject.SUPPORT_INFO) != 0;
         boolean supportPrint = (supported & MediaObject.SUPPORT_PRINT) != 0;
+        supportPrint &= PrintJob.systemSupportsPrint();
 
         setMenuItemVisible(menu, R.id.action_delete, supportDelete);
         setMenuItemVisible(menu, R.id.action_rotate_ccw, supportRotate);
diff --git a/src/com/android/gallery3d/util/PrintJob.java b/src/com/android/gallery3d/util/PrintJob.java
index c08f078..a593c2d 100644
--- a/src/com/android/gallery3d/util/PrintJob.java
+++ b/src/com/android/gallery3d/util/PrintJob.java
@@ -22,6 +22,7 @@
 import android.graphics.RectF;
 import android.graphics.pdf.PdfDocument.Page;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.CancellationSignal;
 import android.os.ParcelFileDescriptor;
@@ -44,6 +45,13 @@
     // with a worst case of 150 dpi
     private final static int MAX_PRINT_SIZE = 3500;
 
+    /**
+     * @return true if the system supports print
+     */
+    public static boolean systemSupportsPrint() {
+        return (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2);
+    }
+
     public static void printBitmap(final Context context, final String jobName,
             final Bitmap bitmap) {
         if (bitmap == null) {