From 74b8b55bb28629eb2a2d275f744688b34c2efa5e Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 9 Nov 2016 19:39:42 +0000 Subject: [PATCH] Revert "Use the platform SDK version from the config." This reverts commit 9bef52380933a3f1444607739d94a98506e0b441. Reason for revert: Broke things Change-Id: Ic3deac4fb6992572ac0cc95fa04d003e0c29f113 --- android/config.go | 6 +----- cc/ndk_library.go | 11 ++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/android/config.go b/android/config.go index 725f43de0..f6ca2e75e 100644 --- a/android/config.go +++ b/android/config.go @@ -323,12 +323,8 @@ func (c *config) PlatformVersion() string { return "M" } -func (c *config) PlatformSdkVersionInt() int { - return *c.ProductVariables.Platform_sdk_version -} - func (c *config) PlatformSdkVersion() string { - return strconv.Itoa(c.PlatformSdkVersionInt()) + return strconv.Itoa(*c.ProductVariables.Platform_sdk_version) } func (c *config) BuildNumber() string { diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 94be17c5b..48fbf4ddf 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -139,7 +139,16 @@ func normalizeNdkApiLevel(apiLevel string, arch android.Arch) (int, error) { } func generateStubApiVariants(mctx android.BottomUpMutatorContext, c *stubDecorator) { - maxVersion := mctx.AConfig().PlatformSdkVersionInt() + // TODO(danalbert): Use PlatformSdkVersion when possible. + // This is an interesting case because for the moment we actually need 24 + // even though the latest released version in aosp is 23. prebuilts/ndk/r11 + // has android-24 versions of libraries, and as platform libraries get + // migrated the libraries in prebuilts will need to depend on them. + // + // Once everything is all moved over to the new stuff (when there isn't a + // prebuilts/ndk any more) then this should be fixable, but for now I think + // it needs to remain as-is. + maxVersion := 24 firstVersion, err := normalizeNdkApiLevel(c.properties.First_version, mctx.Arch())