summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-09-25 15:42:15 -0700
committerDeepanshu Gupta <deepanshu@google.com>2014-09-25 23:01:08 +0000
commitc8cbff8bdc6c8e61a177eeb1aa728038e0aa86dd (patch)
tree7290bfd2dc6d80fbfabd8409b95bfb73c2901e30
parent5ba31e6e9afb34781fe5b927354502d9c6190bc5 (diff)
downloadframeworks_base-c8cbff8bdc6c8e61a177eeb1aa728038e0aa86dd.zip
frameworks_base-c8cbff8bdc6c8e61a177eeb1aa728038e0aa86dd.tar.gz
frameworks_base-c8cbff8bdc6c8e61a177eeb1aa728038e0aa86dd.tar.bz2
Fix error when using list as actionBarNavMode. [DO NOT MERGE]
A bug in the framework leads to the wrong argument being passed to defStyleRes when obtaining styled attributes. The framework however just ignores the attribute in such a case. LayoutLib logs an error to help developers find bugs in their code. The bug was seen when using list as the actionBarNavMode. This change ignores the attribute if it detects that it's the framework bug. Also, we change the error to a warning. Change-Id: I58e1fe4469de0329a27b577d75c0a59c48d0381b
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 625f108..0a6795b 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -630,10 +630,15 @@ public final class BridgeContext extends Context {
defStyleRes, value.getSecond()),
null /*data*/);
}
+ } else if (value.getFirst() == ResourceType.ATTR) {
+ // Ignore. There's a bug in the framework where sometimes defStyleAttr ends up
+ // in defStyleRes. The framework ignores the attribute when it's not a style.
+ // But to let the developers find bugs in their code, we log an error for other
+ // cases.
} else {
- Bridge.getLog().error(null,
+ Bridge.getLog().warning(null,
String.format(
- "Resouce id 0x%x is not of type STYLE (instead %s)",
+ "Resource id 0x%x is not of type STYLE (instead %s)",
defStyleRes, value.getFirst().toString()),
null /*data*/);
}