From 17fe37dd42cb1bf7f9af53348d56d497512b5342 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 2 Aug 2011 08:22:38 -0700 Subject: [PATCH] Bug 5108531 Report the correct API level Use build macro PLATFORM_SDK_VERSION to automatically update the reported value, however the test program will still need manual updates. Change-Id: Iae044605db65021c7d1e9825aab80ab5d6b552a8 --- wilhelm/src/Android.mk | 1 + wilhelm/src/itf/IEngine.c | 6 +++++- wilhelm/tests/sandbox/object.c | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/wilhelm/src/Android.mk b/wilhelm/src/Android.mk index 95120202..de848e6d 100644 --- a/wilhelm/src/Android.mk +++ b/wilhelm/src/Android.mk @@ -43,6 +43,7 @@ LOCAL_CFLAGS += -DUSE_PROFILES=0 -DUSE_TRACE -DUSE_DEBUG -UNDEBUG \ -DUSE_LOG=SLAndroidLogLevel_Info # trace all the OpenSL ES method enter/exit in the logs #LOCAL_CFLAGS += -DSL_TRACE_DEFAULT=SL_TRACE_ALL +LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) # Reduce size of .so and hide internal global symbols LOCAL_CFLAGS += -fvisibility=hidden -DLI_API='__attribute__((visibility("default")))' diff --git a/wilhelm/src/itf/IEngine.c b/wilhelm/src/itf/IEngine.c index a114e0cb..6e2b2835 100644 --- a/wilhelm/src/itf/IEngine.c +++ b/wilhelm/src/itf/IEngine.c @@ -847,7 +847,11 @@ static SLresult IEngine_QuerySupportedInterfaces(SLEngineItf self, static const char * const extensionNames[] = { #ifdef ANDROID - "ANDROID_SDK_LEVEL_12", // Android 3.0+ aka "Honeycomb MR1" +#define _(n) #n +#define __(n) _(n) + "ANDROID_SDK_LEVEL_" __(PLATFORM_SDK_VERSION), +#undef _ +#undef __ #else "WILHELM_DESKTOP", #endif diff --git a/wilhelm/tests/sandbox/object.c b/wilhelm/tests/sandbox/object.c index 4515e039..6c44700c 100644 --- a/wilhelm/tests/sandbox/object.c +++ b/wilhelm/tests/sandbox/object.c @@ -156,7 +156,9 @@ int main(int arg, char **argv) assert(SL_BOOLEAN_FALSE == isSupported); SLchar *supportedExt; #ifdef ANDROID - supportedExt = (SLchar *) "ANDROID_SDK_LEVEL_12"; + // whereas the implementation uses PLATFORM_SDK_VERSION, use a hard-coded value here + // so that we're actually testing for a particular expected value + supportedExt = (SLchar *) "ANDROID_SDK_LEVEL_13"; #else supportedExt = (SLchar *) "WILHELM_DESKTOP"; #endif -- 2.11.0