Merge "LayoutLib: parsed resources were always set as platform res."
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 605b378..f484e7a 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
@@ -319,6 +319,8 @@
BridgeXmlBlockParser parser = null;
parser = (BridgeXmlBlockParser)set;
+ isPlatformFile = parser.isPlatformFile();
+
Object key = parser.getViewKey();
if (key != null) {
defaultPropMap = mDefaultPropMaps.get(key);
@@ -329,7 +331,9 @@
}
} else if (set instanceof BridgeLayoutParamsMapAttributes) {
- // good, nothing to do.
+ // this is only for temp layout params generated dynamically, so this is never
+ // platform content.
+ isPlatformFile = false;
} else if (set != null) { // null parser is ok
// really this should not be happening since its instantiated in Bridge
Bridge.getLog().error(null, "Parser is not a BridgeXmlBlockParser!");
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
index 6d52f92..fcbf5fa 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
@@ -328,6 +328,7 @@
}
// looks like were unable to resolve the color value.
+ assert false;
Bridge.getLog().warning(null, String.format(
"Unable to resolve color value \"%1$s\" in attribute \"%2$s\"",
value, mNames[index]));
@@ -405,6 +406,7 @@
}
// looks like we were unable to resolve the dimension value
+ assert false;
Bridge.getLog().warning(null, String.format(
"Unable to resolve dimension value \"%1$s\" in attribute \"%2$s\"",
s, mNames[index]));
@@ -534,6 +536,7 @@
}
// looks like we were unable to resolve the fraction value
+ assert false;
Bridge.getLog().warning(null, String.format(
"Unable to resolve fraction value \"%1$s\" in attribute \"%2$s\"",
value, mNames[index]));
@@ -641,6 +644,7 @@
return idValue.intValue();
}
+ assert false;
Bridge.getLog().warning(null, String.format(
"Unable to resolve id \"%1$s\" for attribute \"%2$s\"", value, mNames[index]));
return defValue;
@@ -675,6 +679,7 @@
}
// looks like we were unable to resolve the drawable
+ assert false;
Bridge.getLog().warning(null, String.format(
"Unable to resolve drawable \"%1$s\" in attribute \"%2$s\"", stringValue,
mNames[index]));
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
index d8cd2c1..6146cd4 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
@@ -918,6 +918,7 @@
return (StyleResourceValue)parent;
}
+ assert false;
mParams.getLog().error(null,
String.format("Unable to resolve parent style name: %s", parentName));