diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d2949099..9d475ec7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -140,6 +140,7 @@ + diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index 0aa831d3..cc3fe041 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -83,11 +83,19 @@ class BaresipService: Service() { super.onCreate() } - override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int { + override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { - Log.d(LOG_TAG, "Received onStartCommand action ${intent.getAction()}") + val action: String - when (intent.getAction()) { + if (intent == null) { + action = "Start" + Log.d(LOG_TAG, "Received onStartCommand with null intent") + } else { + action = intent.getAction() + Log.d(LOG_TAG, "Received onStartCommand action $action") + } + + when (action) { "Start" -> { val pm = getSystemService(Context.POWER_SERVICE) as PowerManager diff --git a/build.gradle b/build.gradle index 20e557d1..88d52ef7 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' + classpath 'com.android.tools.build:gradle:3.1.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong