Skip to content

Commit 164e1a2

Browse files
BrettyWhitejoeygrover
authored andcommitted
Hotfix IllegalStateException starting service (#834)
* fix illegalstateexception starting service * bump version to 4.6.2 * update versionCode
1 parent 71de69e commit 164e1a2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

sdl_android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ android {
55
defaultConfig {
66
minSdkVersion 8
77
targetSdkVersion 19
8-
versionCode 5
9-
versionName "4.6.1"
8+
versionCode 6
9+
versionName "4.6.2"
1010
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1111
resValue "string", "SDL_LIB_VERSION", '\"' + versionName + '\"'
1212
}
@@ -54,4 +54,4 @@ buildscript {
5454
}
5555
}
5656

57-
apply from: 'bintray.gradle'
57+
apply from: 'bintray.gradle'

sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,12 @@ protected static void pingRouterService(Context context, String packageName, Str
294294
Intent intent = new Intent();
295295
intent.setClassName(packageName, className);
296296
intent.putExtra(TransportConstants.PING_ROUTER_SERVICE_EXTRA, true);
297-
context.startService(intent);
297+
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
298+
intent.putExtra(FOREGROUND_EXTRA, true);
299+
context.startForegroundService(intent);
300+
}else {
301+
context.startService(intent);
302+
}
298303
}catch(SecurityException e){
299304
Log.e(TAG, "Security exception, process is bad");
300305
// This service could not be started

0 commit comments

Comments
 (0)