diff --git a/sdl_android/build.gradle b/sdl_android/build.gradle index fc29f66ffe..5429f3eea0 100644 --- a/sdl_android/build.gradle +++ b/sdl_android/build.gradle @@ -5,8 +5,8 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 5 - versionName "4.6.1" + versionCode 6 + versionName "4.6.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"' } @@ -54,4 +54,4 @@ buildscript { } } -apply from: 'bintray.gradle' \ No newline at end of file +apply from: 'bintray.gradle' diff --git a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java index defeb67fab..251765ed2e 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java +++ b/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java @@ -294,7 +294,12 @@ protected static void pingRouterService(Context context, String packageName, Str Intent intent = new Intent(); intent.setClassName(packageName, className); intent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true); - context.startService(intent); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){ + intent.putExtra(FOREGROUND_EXTRA, true); + context.startForegroundService(intent); + }else { + context.startService(intent); + } }catch(SecurityException e){ Log.e(TAG, "Security exception, process is bad"); // This service could not be started