Skip to content

Commit

Permalink
Hotfix IllegalStateException starting service (#834)
Browse files Browse the repository at this point in the history
* fix illegalstateexception starting service

* bump version to 4.6.2

* update versionCode
  • Loading branch information
BrettyWhite authored and joeygrover committed Aug 8, 2018
1 parent 71de69e commit 164e1a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sdl_android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '\"'
}
Expand Down Expand Up @@ -54,4 +54,4 @@ buildscript {
}
}

apply from: 'bintray.gradle'
apply from: 'bintray.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 164e1a2

Please sign in to comment.