summaryrefslogtreecommitdiff
path: root/compiler/src/test/java/android/databinding/tool/reflection
diff options
context:
space:
mode:
authorYigit Boyar <yboyar@google.com>2015-09-29 16:39:35 -0700
committerYigit Boyar <yboyar@google.com>2015-09-29 16:39:35 -0700
commitf01c66d7aaafd713de64b499c568f5870855dcd5 (patch)
tree22d9584470ad7098ca4bb6cbc33f216f6b8c4316 /compiler/src/test/java/android/databinding/tool/reflection
parent99c02c7c337ea01ffa81ffde220babde2107e989 (diff)
downloaddata-binding-f01c66d7aaafd713de64b499c568f5870855dcd5.tar.gz
Load full SDK table
When loading methods from the SDK, we would only load methods that have since > Application.minApi. This way, we would keep the hash very small. On the other hand, this algorithm break if a newer API version adds a method that has the same signature with a subclass. This case happened when we added setForeground to View at API 23 but it has been in FrameLayout since 1. Bug:24509802 Change-Id: I7ac7ca5d1aac142a9afe8cd57ab9497dfb649650
Diffstat (limited to 'compiler/src/test/java/android/databinding/tool/reflection')
-rw-r--r--compiler/src/test/java/android/databinding/tool/reflection/SdkVersionTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/src/test/java/android/databinding/tool/reflection/SdkVersionTest.java b/compiler/src/test/java/android/databinding/tool/reflection/SdkVersionTest.java
index 00456645..b4ecb019 100644
--- a/compiler/src/test/java/android/databinding/tool/reflection/SdkVersionTest.java
+++ b/compiler/src/test/java/android/databinding/tool/reflection/SdkVersionTest.java
@@ -56,4 +56,12 @@ public class SdkVersionTest {
ModelMethod setElevation = view.getMethods("testCustomCode", 0)[0];
assertEquals(1, SdkUtil.getMinApi(setElevation));
}
+
+ @Test
+ public void testSetForeground() {
+ ModelClass view = ModelAnalyzer.getInstance()
+ .findClass("android.widget.FrameLayout", null);
+ ModelMethod setForeground = view.getMethods("setForeground", 1)[0];
+ assertEquals(1, SdkUtil.getMinApi(setForeground));
+ }
}