Revert "Switch Gallery over to RS compatibility library."

This reverts commit 0746ce0977cde616d25ce35fee0d8d554235a21c

Change-Id: Ic0fb6c60e5f40b53ad032afeafe2f9ff70c26b50
diff --git a/Android.mk b/Android.mk
index 1ef2fab..a5efe55 100644
--- a/Android.mk
+++ b/Android.mk
@@ -8,17 +8,12 @@
 LOCAL_STATIC_JAVA_LIBRARIES += com.android.gallery3d.common2
 LOCAL_STATIC_JAVA_LIBRARIES += xmp_toolkit
 LOCAL_STATIC_JAVA_LIBRARIES += mp4parser
-LOCAL_STATIC_JAVA_LIBRARIES += android.support.v8.renderscript
-
-LOCAL_RENDERSCRIPT_TARGET_API := 18
-LOCAL_RENDERSCRIPT_COMPATIBILITY := 18
-LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=android.support.v8.renderscript
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 LOCAL_SRC_FILES += $(call all-java-files-under, src_pd)
 LOCAL_SRC_FILES += $(call all-java-files-under, ../Camera/src)
 
-LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
+LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res 
 LOCAL_RESOURCE_DIR += packages/apps/Camera/res
 
 LOCAL_AAPT_FLAGS := --auto-add-overlay \
@@ -34,9 +29,9 @@
 # the libraries in the APK, otherwise just put them in /system/lib and
 # leave them out of the APK
 ifneq (,$(TARGET_BUILD_APPS))
-  LOCAL_JNI_SHARED_LIBRARIES := libjni_mosaic libjni_eglfence libjni_filtershow_filters librsjni
+  LOCAL_JNI_SHARED_LIBRARIES := libjni_mosaic libjni_eglfence libjni_filtershow_filters
 else
-  LOCAL_REQUIRED_MODULES := libjni_mosaic libjni_eglfence libjni_filtershow_filters librsjni
+  LOCAL_REQUIRED_MODULES := libjni_mosaic libjni_eglfence libjni_filtershow_filters
 endif
 
 LOCAL_PROGUARD_FLAG_FILES := proguard.flags
diff --git a/proguard.flags b/proguard.flags
index dce9d07..b54b0c7 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -45,8 +45,6 @@
 # Disable the warnings of using dynamic method calls in EffectsRecorder
 -dontnote com.android.camera.EffectsRecorder
 
--keep class android.support.v8.renderscript.** { *; }
-
 # Required for ActionBarSherlock
 -keep class android.support.v4.app.** { *; }
 -keep interface android.support.v4.app.** { *; }
diff --git a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
index 802b556..a1dbe8e 100644
--- a/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
+++ b/src/com/android/gallery3d/filtershow/cache/FilteringPipeline.java
@@ -19,7 +19,9 @@
 import android.graphics.Bitmap;
 import android.os.*;
 import android.os.Process;
-import android.support.v8.renderscript.*;
+import android.renderscript.Allocation;
+import android.renderscript.Allocation.MipmapControl;
+import android.renderscript.RenderScript;
 import android.util.Log;
 
 import com.android.gallery3d.filtershow.filters.ImageFilterRS;
@@ -142,13 +144,13 @@
             mFiltersOnlyOriginalAllocation.destroy();
         }
         mFiltersOnlyOriginalAllocation = Allocation.createFromBitmap(RS, mOriginalBitmap,
-                Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
+                MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
         if (mOriginalAllocation != null) {
             mOriginalAllocation.destroy();
         }
         mResizedOriginalBitmap = preset.applyGeometry(mOriginalBitmap);
         mOriginalAllocation = Allocation.createFromBitmap(RS, mResizedOriginalBitmap,
-                Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
+                MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
         mPreviousGeometry = new GeometryMetadata(geometry);
         return true;
     }
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
index 368e29a..63dc82c 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
@@ -18,7 +18,9 @@
 
 import android.app.Activity;
 import android.graphics.Bitmap;
-import android.support.v8.renderscript.*;
+import android.renderscript.Allocation;
+import android.renderscript.Allocation.MipmapControl;
+import android.renderscript.RenderScript;
 import android.util.Log;
 
 public class ImageFilterRS extends ImageFilter {
@@ -46,7 +48,7 @@
             }
             Bitmap bitmapBuffer = bitmap.copy(mBitmapConfig, true);
             mOutPixelsAllocation = Allocation.createFromBitmap(mRS, bitmapBuffer,
-                    Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
+                    MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT);
             mInPixelsAllocation = Allocation.createTyped(mRS,
                     mOutPixelsAllocation.getType());
             sOldBitmap = bitmap;