OSDN Git Service

Rename android.utils.Pools to com.android.photos.util.Pools
authorJiyong Park <jiyong@google.com>
Thu, 5 Apr 2018 07:12:39 +0000 (16:12 +0900)
committerJiyong Park <jiyong@google.com>
Thu, 5 Apr 2018 09:45:43 +0000 (18:45 +0900)
android.utils.Pools is a class copied from frameworks/base. It was
copied because the framework one has been marked as @hide. This caused
the class to be duplicated into the Gallery2 apk and the boot classpath.
At run-time, the class from bootclasspath was used because the
classloader tries to load a class from the parent class loader first.

However, this combined with the recent activation of the kill-switch
caused a runtime error. Working around the issue by renaming the class
copied into the app so that it does not collide with the
framework-defined one.

Bug: 77544391
Test: build aosp_walleye. Take a video and see it via the Gallery2.
The app does not crash.

Change-Id: Ia0af4da84242044da2e0ab63e38df243d9769418

Android.mk
jarjar-rules.txt [new file with mode: 0644]
proguard.flags

index 68d573a..34d7cb4 100644 (file)
@@ -39,6 +39,8 @@ LOCAL_PROGUARD_FLAG_FILES := proguard.flags
 
 LOCAL_JAVA_LIBRARIES += org.apache.http.legacy
 
+LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
+
 include $(BUILD_PACKAGE)
 
 ifeq ($(strip $(LOCAL_PACKAGE_OVERRIDES)),)
diff --git a/jarjar-rules.txt b/jarjar-rules.txt
new file mode 100644 (file)
index 0000000..99555e4
--- /dev/null
@@ -0,0 +1 @@
+rule android.util.Pools** com.android.photos.util.Pools@1
index c8ba2ff..72cba51 100644 (file)
@@ -84,5 +84,3 @@
 -keep class com.android.gallery3d.jpegstream.StreamUtils { *; }
 
 
-# TODO: remove or rename android.util.Pools.java from our source.
--dontwarn android.util.Pools*