No need for ProxyActivity
This commit is contained in:
@ -61,12 +61,6 @@
|
|||||||
<data android:scheme="sip" />
|
<data android:scheme="sip" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
|
||||||
android:name=".ProxyActivity"
|
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:noHistory="true" >
|
|
||||||
</activity>
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".AccountsActivity"
|
android:name=".AccountsActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
|
|||||||
@ -643,14 +643,8 @@ class BaresipService: Service() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!Utils.isVisible()) {
|
if (!Utils.isVisible()) {
|
||||||
val intent = if (isMainAlive)
|
val intent = Intent(applicationContext, MainActivity::class.java)
|
||||||
Intent(applicationContext, ProxyActivity::class.java)
|
intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP or
|
||||||
else
|
|
||||||
Intent(applicationContext, MainActivity::class.java)
|
|
||||||
intent.flags = if (isMainAlive)
|
|
||||||
Intent.FLAG_ACTIVITY_NEW_TASK
|
|
||||||
else
|
|
||||||
Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP or
|
|
||||||
Intent.FLAG_ACTIVITY_NEW_TASK
|
Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
intent.putExtra("action", "call show")
|
intent.putExtra("action", "call show")
|
||||||
.putExtra("callp", callp)
|
.putExtra("callp", callp)
|
||||||
|
|||||||
@ -731,13 +731,16 @@ class MainActivity : AppCompatActivity() {
|
|||||||
// Called when MainActivity already exists at the top of current task
|
// Called when MainActivity already exists at the top of current task
|
||||||
super.onNewIntent(intent)
|
super.onNewIntent(intent)
|
||||||
|
|
||||||
|
Utils.setShowWhenLocked(this, true)
|
||||||
|
Utils.setTurnScreenOn(this, true)
|
||||||
|
|
||||||
resumeAction = ""
|
resumeAction = ""
|
||||||
resumeUri = ""
|
resumeUri = ""
|
||||||
|
|
||||||
if (intent.action == ACTION_CALL) {
|
if (intent.action == ACTION_CALL) {
|
||||||
Log.d(TAG, "onNewIntent $ACTION_CALL ${intent.data}")
|
Log.d(TAG, "onNewIntent $ACTION_CALL ${intent.data}")
|
||||||
if (Call.calls().isNotEmpty() || UserAgent.uas().isEmpty()) {
|
if (Call.calls().isNotEmpty() || UserAgent.uas().isEmpty())
|
||||||
return
|
return
|
||||||
}
|
|
||||||
val uri: Uri? = intent.data
|
val uri: Uri? = intent.data
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
val uriStr = URLDecoder.decode(uri.toString(), "UTF-8")
|
val uriStr = URLDecoder.decode(uri.toString(), "UTF-8")
|
||||||
@ -1105,8 +1108,9 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Toast.LENGTH_LONG).show()
|
Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
restoreActivities()
|
restoreActivities()
|
||||||
if (Build.VERSION.SDK_INT >= 22 && kgm.isDeviceLocked)
|
if ((Build.VERSION.SDK_INT >= 22 && kgm.isDeviceLocked) ||
|
||||||
moveTaskToBack(true)
|
(Build.VERSION.SDK_INT < 22 && kgm.isKeyguardLocked() && kgm.isKeyguardSecure()))
|
||||||
|
Utils.setShowWhenLocked(this, false)
|
||||||
}
|
}
|
||||||
"message", "message show", "message reply" -> {
|
"message", "message show", "message reply" -> {
|
||||||
val peer = params[1]
|
val peer = params[1]
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
package com.tutpro.baresip
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.os.Bundle
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
|
||||||
|
|
||||||
class ProxyActivity : AppCompatActivity() {
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
|
|
||||||
Utils.setShowWhenLocked(this, true)
|
|
||||||
Utils.setTurnScreenOn(this, true)
|
|
||||||
|
|
||||||
Log.d(TAG, "ProxyActivity onCreate")
|
|
||||||
|
|
||||||
val intent = Intent(applicationContext, MainActivity::class.java)
|
|
||||||
intent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or
|
|
||||||
Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK
|
|
||||||
intent.putExtras(getIntent())
|
|
||||||
startActivity(intent)
|
|
||||||
|
|
||||||
finish()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user