From d16223338c3e43da4386b2428089be0bc21b1907 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 16 Oct 2017 15:01:32 +0200 Subject: [PATCH] Fix compilation on other than android and fix runtime issue with getSystemService(class) --- coreapi/android-helpers.cpp | 4 ++-- java/impl/org/linphone/core/util/AndroidPlatformHelper.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/coreapi/android-helpers.cpp b/coreapi/android-helpers.cpp index bc1970a68..b5fa9d2ed 100644 --- a/coreapi/android-helpers.cpp +++ b/coreapi/android-helpers.cpp @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - +#ifdef __ANDROID__ #include "private.h" #include "platform-helpers.h" @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -#ifdef __ANDROID__ + namespace LinphonePrivate{ diff --git a/java/impl/org/linphone/core/util/AndroidPlatformHelper.java b/java/impl/org/linphone/core/util/AndroidPlatformHelper.java index aeb44e15b..d5fe34f68 100644 --- a/java/impl/org/linphone/core/util/AndroidPlatformHelper.java +++ b/java/impl/org/linphone/core/util/AndroidPlatformHelper.java @@ -49,7 +49,7 @@ public class AndroidPlatformHelper{ public AndroidPlatformHelper(Object ctx_obj){ Context ctx = (Context) ctx_obj; - WifiManager wifiMgr = ctx.getSystemService(WifiManager.class); + WifiManager wifiMgr = (WifiManager)ctx.getSystemService(Context.WIFI_SERVICE); mPowerManager = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE); mConnectivityManager = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);