run RunOnStartup also on Restart action
This commit is contained in:
@ -108,9 +108,10 @@
|
||||
android:value="com.tutpro.baresip.MainActivity" />
|
||||
</activity>
|
||||
|
||||
<service android:name=".BaresipService" >
|
||||
<service android:name=".BaresipService"
|
||||
android:enabled="true" >
|
||||
</service>
|
||||
|
||||
|
||||
<receiver
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
@ -118,6 +119,7 @@
|
||||
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
<action android:name="com.tutpro.baresip.Restart" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
|
||||
@ -4,11 +4,14 @@ import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
|
||||
class RunOnStartup : BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
|
||||
if ((intent.action == Intent.ACTION_BOOT_COMPLETED) or
|
||||
(intent.action == "com.tutpro.baresip.Restart")) {
|
||||
Log.d("Baresip", "Start baresip upon boot completed or restart")
|
||||
val i = Intent(context, MainActivity::class.java)
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
val b = Bundle()
|
||||
|
||||
Reference in New Issue
Block a user