summaryrefslogtreecommitdiff
path: root/tools/sdkparcelables
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-02-09 11:24:14 -0800
committerColin Cross <ccross@android.com>2018-02-09 11:29:15 -0800
commitfdbe7d1ca90ac40f9b629524d9aea26e59899c50 (patch)
tree136ed4bf0b85a3bf73654be606a1c1385e8072a3 /tools/sdkparcelables
parent4c8fa81d177bfd2f144ebe153df74edb8b332f5a (diff)
Don't put android.os.Parcelable in framework.aidl
Parcelable shouldn't be in the list of parcelables in framework.aidl. Remove it to fix warning when running aidl: framework.aidl:287 attempt to redefine built in class android.os.Parcelable Also make the dependency on sdk_parcelables not be order-only so framework.aidl gets rebuilt when sdk_parcelables changes. Bug: 73135791 Test: ParcelableDetectorTest Test: out/target/common/obj/framework.aidl does not contain android.os.Parcelable Change-Id: If5222879be9ec1e5fa08810adc624ec526ddc0ec
Diffstat (limited to 'tools/sdkparcelables')
-rw-r--r--tools/sdkparcelables/src/com/android/sdkparcelables/ParcelableDetector.kt6
-rw-r--r--tools/sdkparcelables/tests/com/android/sdkparcelables/ParcelableDetectorTest.kt8
2 files changed, 8 insertions, 6 deletions
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"))
}
}