implement real gateway path.
This commit is contained in:
@@ -10,6 +10,7 @@ import org.vpnshare.gateway.VpnShareGatewayService
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
maybeStartShare(intent)
|
||||
|
||||
setContent {
|
||||
ShareScreen(
|
||||
@@ -28,4 +29,22 @@ class MainActivity : ComponentActivity() {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
maybeStartShare(intent)
|
||||
}
|
||||
|
||||
private fun maybeStartShare(intent: Intent?) {
|
||||
if (intent?.action == ACTION_START_FROM_DESKTOP) {
|
||||
startForegroundService(
|
||||
Intent(this, VpnShareGatewayService::class.java)
|
||||
.setAction(VpnShareGatewayService.ACTION_START)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val ACTION_START_FROM_DESKTOP = "org.vpnshare.action.START_FROM_DESKTOP"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user