Add minSdkVersion to default manifests
If the default manifest that doesn't set minSdkVersion is passed to
manifest merger along with a library manifest that does, it will fail
with:
.../DefaultManifest.xml Error:
uses-sdk:minSdkVersion 1 cannot be smaller than version 14 declared in library ...
Translate LOCAL_MIN_SDK_VERSION or LOCAL_SDK_VERSION to minSdkVersion
in DefaultManifest.xml.
Bug: 79481102
Test: m checkbuild
Change-Id: I4d792d48612e6a1111e05a9e4a71bb4d87eae1ad
diff --git a/core/definitions.mk b/core/definitions.mk
index fc0abc7..e18f9a4 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2150,11 +2150,13 @@
define _create-default-manifest-file
$(1):
rm -f $1
- echo '<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="missing.manifest"></manifest>' > $1
+ (echo '<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="missing.manifest">' && \
+ echo ' <uses-sdk android:minSdkVersion="$(2)" />' && \
+ echo '</manifest>' ) > $1
endef
define create-default-manifest-file
- $(eval $(call _create-default-manifest-file,$(1)))
+ $(eval $(call _create-default-manifest-file,$(1),$(2)))
endef