Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdbe7d1c authored by Colin Cross's avatar Colin Cross
Browse files

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
parent 4c8fa81d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 $$< $$@
+4 −2
Original line number Diff line number Diff line
@@ -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
            }

+4 −4
Original line number Diff line number Diff line
@@ -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"))
    }

}