parent
f6175c2c69
commit
3e02dfef63
22 changed files with 577 additions and 154 deletions
|
|
@ -29,20 +29,20 @@ class ImportConfigActivity : ComponentActivity() {
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
Log.v(TAG, "Create Import Config Activity: $intent")
|
||||
Log.d(TAG, "Create Import Config Activity: $intent")
|
||||
intent?.let(::readConfig)
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
super.onNewIntent(intent)
|
||||
Log.v(TAG, "onNewIntent: $intent")
|
||||
Log.d(TAG, "onNewIntent: $intent")
|
||||
intent?.let(::readConfig)
|
||||
}
|
||||
|
||||
private fun readConfig(intent: Intent) {
|
||||
when (intent.action) {
|
||||
ACTION_SEND -> {
|
||||
Log.v(TAG, "Process SEND action, type: ${intent.type}")
|
||||
Log.d(TAG, "Process SEND action, type: ${intent.type}")
|
||||
when (intent.type) {
|
||||
"application/octet-stream" -> {
|
||||
intent.getUriCompat()?.let { uri ->
|
||||
|
|
@ -60,7 +60,7 @@ class ImportConfigActivity : ComponentActivity() {
|
|||
}
|
||||
|
||||
ACTION_VIEW -> {
|
||||
Log.v(TAG, "Process VIEW action, scheme: ${intent.scheme}")
|
||||
Log.d(TAG, "Process VIEW action, scheme: ${intent.scheme}")
|
||||
when (intent.scheme) {
|
||||
"file", "content" -> {
|
||||
intent.data?.let { uri ->
|
||||
|
|
@ -128,7 +128,7 @@ class ImportConfigActivity : ComponentActivity() {
|
|||
|
||||
private fun startMainActivity(config: String) {
|
||||
if (config.isNotBlank()) {
|
||||
Log.v(TAG, "startMainActivity")
|
||||
Log.d(TAG, "startMainActivity")
|
||||
Intent(applicationContext, AmneziaActivity::class.java).apply {
|
||||
action = ACTION_IMPORT_CONFIG
|
||||
addCategory(CATEGORY_DEFAULT)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue