diff options
| author | 2018-02-13 07:29:51 +0000 | |
|---|---|---|
| committer | 2018-02-13 07:29:51 +0000 | |
| commit | 6864210fe2011bd0e40ea1808dfed5dcd33c64a5 (patch) | |
| tree | cdedb5a78f164e37eceb2ffe33e75db7bd7b3290 | |
| parent | ea014edb58efb7975438995b0c56d014ba814364 (diff) | |
| parent | 0872f6d5e3454430e316a854ff892510934f85d8 (diff) | |
Merge "Don't put android.os.Parcelable in framework.aidl"
am: 0872f6d5e3
Change-Id: I3f6344774b44b43e2ec18f56c0a49fffc58a8629
| -rw-r--r-- | Android.mk | 2 | ||||
| -rw-r--r-- | tools/sdkparcelables/src/com/android/sdkparcelables/ParcelableDetector.kt | 6 | ||||
| -rw-r--r-- | tools/sdkparcelables/tests/com/android/sdkparcelables/ParcelableDetectorTest.kt | 8 |
3 files changed, 9 insertions, 7 deletions
diff --git a/Android.mk b/Android.mk index ea75b19c7ff8..71720a1740a5 100644 --- a/Android.mk +++ b/Android.mk @@ -36,7 +36,7 @@ aidl_parcelables := define stubs-to-aidl-parcelables gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl aidl_parcelables += $$(gen) - $$(gen): $(call java-lib-header-files,$1) | $(HOST_OUT_EXECUTABLES)/sdkparcelables + $$(gen): $(call java-lib-header-files,$1) $(HOST_OUT_EXECUTABLES)/sdkparcelables @echo Extract SDK parcelables: $$@ rm -f $$@ $(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@ diff --git a/tools/sdkparcelables/src/com/android/sdkparcelables/ParcelableDetector.kt b/tools/sdkparcelables/src/com/android/sdkparcelables/ParcelableDetector.kt index d6a0a4516a6d..45027b51d3ef 100644 --- a/tools/sdkparcelables/src/com/android/sdkparcelables/ParcelableDetector.kt +++ b/tools/sdkparcelables/src/com/android/sdkparcelables/ParcelableDetector.kt @@ -27,6 +27,8 @@ class ParcelableDetector { impl.build() return impl.parcelables } + + const val PARCELABLE_CLASS = "android/os/Parcelable" } private class Impl(val ancestors: Map<String, Ancestors>) { @@ -35,7 +37,7 @@ class ParcelableDetector { fun build() { val classList = ancestors.keys - classList.filterTo(parcelables, this::isParcelable) + classList.filterTo(parcelables, { (it != PARCELABLE_CLASS) && isParcelable(it) }) parcelables.sort() } @@ -44,7 +46,7 @@ class ParcelableDetector { return false } - if (c == "android/os/Parcelable") { + if (c == PARCELABLE_CLASS) { return true } diff --git a/tools/sdkparcelables/tests/com/android/sdkparcelables/ParcelableDetectorTest.kt b/tools/sdkparcelables/tests/com/android/sdkparcelables/ParcelableDetectorTest.kt index c9bcbc9cadcf..f08173d5b2f1 100644 --- a/tools/sdkparcelables/tests/com/android/sdkparcelables/ParcelableDetectorTest.kt +++ b/tools/sdkparcelables/tests/com/android/sdkparcelables/ParcelableDetectorTest.kt @@ -28,7 +28,7 @@ class ParcelableDetectorTest { val parcelables = ParcelableDetector.ancestorsToParcelables(ancestorMap) - assertEquals(parcelables, listOf("android/os/Parcelable", "android/test/Parcelable")) + assertEquals(parcelables, listOf("android/test/Parcelable")) } @Test @@ -39,7 +39,7 @@ class ParcelableDetectorTest { val parcelables = ParcelableDetector.ancestorsToParcelables(ancestorMap) - assertEquals(parcelables, listOf("android/os/Parcelable", "android/test/Parcelable")) + assertEquals(parcelables, listOf("android/test/Parcelable")) } @Test @@ -51,7 +51,7 @@ class ParcelableDetectorTest { val parcelables = ParcelableDetector.ancestorsToParcelables(ancestorMap) - assertEquals(parcelables, listOf("android/os/Parcelable", "android/test/Parcelable", "android/test/SuperParcelable")) + assertEquals(parcelables, listOf("android/test/Parcelable", "android/test/SuperParcelable")) } @Test @@ -63,7 +63,7 @@ class ParcelableDetectorTest { val parcelables = ParcelableDetector.ancestorsToParcelables(ancestorMap) - assertEquals(parcelables, listOf("android/os/Parcelable", "android/test/IParcelable", "android/test/Parcelable")) + assertEquals(parcelables, listOf("android/test/IParcelable", "android/test/Parcelable")) } } |