summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2014-07-16 10:23:28 -0700
committerDeepanshu Gupta <deepanshu@google.com>2014-07-16 10:23:28 -0700
commit6c57fc30198e8f3a2756aab6bc832450391eec94 (patch)
treeac071fc0610bbfcab22ce9c42aff209abbde69e4 /tools
parentc8fcb3bcdb71fe16624bea146a67b13c150adb82 (diff)
downloadframeworks_base-6c57fc30198e8f3a2756aab6bc832450391eec94.zip
frameworks_base-6c57fc30198e8f3a2756aab6bc832450391eec94.tar.gz
frameworks_base-6c57fc30198e8f3a2756aab6bc832450391eec94.tar.bz2
DO NOT MERGE - Fix LayoutLib.
This fixes a bad merge and contains partial cherrypicks of the following commits to make LayoutLib working again: 103d40960daa0420995aa12881bef33892a0a2ab 803d77d8904a8fd66f0370cca6ed7f8b7cf68907 6a08225cee197e5baf80dd06dae46988db284122 Bug: 15987446 Change-Id: I41563305206d30ecdbc7f609c4b90d53edb42689
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java25
-rw-r--r--tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java10
2 files changed, 18 insertions, 17 deletions
diff --git a/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java b/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
index d7c971b..71947b0 100644
--- a/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
+++ b/tools/layoutlib/bridge/src/libcore/icu/ICU_Delegate.java
@@ -18,6 +18,7 @@ package libcore.icu;
import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
import com.ibm.icu.text.DateTimePatternGenerator;
+import com.ibm.icu.util.Currency;
import com.ibm.icu.util.ULocale;
import java.util.Locale;
@@ -117,6 +118,11 @@ public class ICU_Delegate {
}
@LayoutlibDelegate
+ /*package*/ static int getCurrencyNumericCode(String currencyCode) {
+ return Currency.getInstance(currencyCode).getNumericCode();
+ }
+
+ @LayoutlibDelegate
/*package*/ static String getCurrencySymbol(String locale, String currencyCode) {
return "";
}
@@ -142,12 +148,12 @@ public class ICU_Delegate {
}
@LayoutlibDelegate
- /*package*/ static String getISO3CountryNative(String locale) {
+ /*package*/ static String getISO3Country(String locale) {
return "";
}
@LayoutlibDelegate
- /*package*/ static String getISO3LanguageNative(String locale) {
+ /*package*/ static String getISO3Language(String locale) {
return "";
}
@@ -178,21 +184,6 @@ public class ICU_Delegate {
}
@LayoutlibDelegate
- /*package*/ static String languageTagForLocale(String locale) {
- return "";
- }
-
- @LayoutlibDelegate
- /*package*/ static String localeForLanguageTag(String languageTag, boolean strict) {
- return "";
- }
-
- @LayoutlibDelegate
- /*package*/ static String languageTagForLocale(String locale) {
- return "";
- }
-
- @LayoutlibDelegate
/*package*/ static boolean initLocaleDataNative(String locale, LocaleData result) {
// Used by Calendar.
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java
index b2caa25..d5c4a47 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/AbstractClassAdapter.java
@@ -176,6 +176,16 @@ public abstract class AbstractClassAdapter extends ClassVisitor {
interfaces[i] = renameInternalType(interfaces[i]);
}
}
+ /* Java 7 verifies the StackMapTable of a class if its version number is greater than 50.0.
+ * However, the check is disabled if the class version number is 50.0 or less. Generation
+ * of the StackMapTable requires a rewrite using the tree API of ASM. As a workaround,
+ * we rewrite the version number of the class to be 50.0
+ *
+ * http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6693236
+ */
+ if (version > 50) {
+ version = 50;
+ }
super.visit(version, access, name, signature, superName, interfaces);
}