From b9ecb4fd257f8f0e7b697c8feca88eea0e100961 Mon Sep 17 00:00:00 2001
From: Tor Norbye <tnorbye@google.com>
Date: Wed, 27 Feb 2019 00:21:27 +0000
Subject: [PATCH] Revert "Remove MbmsDownloadServiceBase special case"

This reverts commit 9da4edace169cd6e29ddf176528143c416a23b8b.

Reason for revert: b/126374865

Change-Id: I55d05da395dcba2562db61f0f0a873105eef6302
---
 .../com/android/tools/metalava/model/ClassItem.kt    | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/main/java/com/android/tools/metalava/model/ClassItem.kt b/src/main/java/com/android/tools/metalava/model/ClassItem.kt
index a26b71b..0d072fa 100644
--- a/src/main/java/com/android/tools/metalava/model/ClassItem.kt
+++ b/src/main/java/com/android/tools/metalava/model/ClassItem.kt
@@ -670,6 +670,18 @@ interface ClassItem : Item {
                 if (!predicate.test(superClass)) {
                     superClass.filteredInterfaceTypes(predicate, types, true, includeParents, target)
                 } else if (includeSelf && superClass.isInterface()) {
+                    // Special case: Arguably, IInterface should be included in the system API by the
+                    // general rules. However, this was just added to the system API in 28 at the same
+                    // time as metalava, which did not include some hidden super classes in its analysis.
+                    // This is now marked as an incompatible API change, so treat this the same way as in
+                    // API 28 until this is clarified.
+                    if (superClass.simpleName() == "IInterface" &&
+                        (target.qualifiedName() == "android.telephony.mbms.vendor.MbmsDownloadServiceBase" ||
+                            target.qualifiedName() == "android.telephony.mbms.vendor.MbmsStreamingServiceBase")
+                    ) {
+                        return types
+                    }
+
                     types.add(superClassType)
                     if (includeParents) {
                         superClass.filteredInterfaceTypes(predicate, types, true, includeParents, target)
-- 
GitLab