diff options
author | Tor Norbye <tnorbye@google.com> | 2012-05-31 13:36:27 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-05-31 13:36:27 -0700 |
commit | 6b0a56859a50f24bf7d9e53626f066b031d68862 (patch) | |
tree | 6a0a76868be5699d366a33b3272f9fa09ac4d4bf | |
parent | b7e8d98c68beba6f5f7e3ae1c37f7cda830da7a7 (diff) | |
parent | 34230d8dd05143b85d520f5e34a5ea4f055e0e96 (diff) | |
download | sdk-6b0a56859a50f24bf7d9e53626f066b031d68862.zip sdk-6b0a56859a50f24bf7d9e53626f066b031d68862.tar.gz sdk-6b0a56859a50f24bf7d9e53626f066b031d68862.tar.bz2 |
Merge "Fix bug in manifest metadata handler"
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java index 8479b0d..993b6fc 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java @@ -226,7 +226,6 @@ public class ManifestInfo { } NodeList applications = root.getElementsByTagName(AndroidManifest.NODE_APPLICATION); - String defaultTheme = null; if (applications.getLength() > 0) { assert applications.getLength() == 1; Element application = (Element) applications.item(0); @@ -237,23 +236,22 @@ public class ManifestInfo { mApplicationLabel = application.getAttributeNS(NS_RESOURCES, ATTRIBUTE_LABEL); } - defaultTheme = application.getAttributeNS(NS_RESOURCES, ATTRIBUTE_THEME); + String defaultTheme = application.getAttributeNS(NS_RESOURCES, ATTRIBUTE_THEME); + if (defaultTheme != null && !defaultTheme.isEmpty()) { + // From manifest theme documentation: + // "If that attribute is also not set, the default system theme is used." + mManifestTheme = defaultTheme; + } } // Look up target SDK - if (defaultTheme == null || defaultTheme.length() == 0) { - // From manifest theme documentation: - // "If that attribute is also not set, the default system theme is used." - - NodeList usesSdks = root.getElementsByTagName(NODE_USES_SDK); - if (usesSdks.getLength() > 0) { - Element usesSdk = (Element) usesSdks.item(0); - mMinSdk = getApiVersion(usesSdk, ATTRIBUTE_MIN_SDK_VERSION, 1); - mTargetSdk = getApiVersion(usesSdk, ATTRIBUTE_TARGET_SDK_VERSION, mMinSdk); - } - } else { - mManifestTheme = defaultTheme; + NodeList usesSdks = root.getElementsByTagName(NODE_USES_SDK); + if (usesSdks.getLength() > 0) { + Element usesSdk = (Element) usesSdks.item(0); + mMinSdk = getApiVersion(usesSdk, ATTRIBUTE_MIN_SDK_VERSION, 1); + mTargetSdk = getApiVersion(usesSdk, ATTRIBUTE_TARGET_SDK_VERSION, mMinSdk); } + } catch (SAXException e) { AdtPlugin.log(e, "Malformed manifest"); } catch (Exception e) { |