aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt
diff options
context:
space:
mode:
authorpacien2020-12-08 16:04:48 +0100
committerpacien2020-12-08 16:04:48 +0100
commit69445bffe7a17055ac47a41df5d33fe09b9aff3c (patch)
tree61a00dfe1c0d3085386f40c0c0d8c8cbb427a33b /app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt
parent9c0aa8bd9dc694854b5c4b5eb07ef4d8942709a8 (diff)
downloadtincapp-69445bffe7a17055ac47a41df5d33fe09b9aff3c.tar.gz
context: read configuration from and write logs and temp files to private app storage
The external app public storage directory is no longer reliably accessible on Android 11 and above. This makes editing the configuration and accessing the log files impossible in some cases. Let's move to the app private storage, to be made accessible to the user by some other mean. This has the benefit of also protecting the private keys that need to be stored encrypted otherwise. We also split the configuration and cache directory into specialised sub-directories. GitHub: related to #103
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt')
-rw-r--r--app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt
index d3cc803..b0bbddf 100644
--- a/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt
+++ b/app/src/main/java/org/pacien/tincapp/activities/start/NetworkListFragment.kt
@@ -1,6 +1,6 @@
1/* 1/*
2 * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon 2 * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon
3 * Copyright (C) 2017-2019 Pacien TRAN-GIRARD 3 * Copyright (C) 2017-2020 Pacien TRAN-GIRARD
4 * 4 *
5 * This program is free software: you can redistribute it and/or modify 5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -37,7 +37,6 @@ import org.pacien.tincapp.extensions.setElements
37 * @author pacien 37 * @author pacien
38 */ 38 */
39class NetworkListFragment : BaseFragment() { 39class NetworkListFragment : BaseFragment() {
40 private val appPaths = AppPaths
41 private val networkListViewModel by lazy { NetworkListViewModel() } 40 private val networkListViewModel by lazy { NetworkListViewModel() }
42 private val networkListAdapter by lazy { ArrayAdapter<String>(requireContext(), R.layout.start_network_list_item) } 41 private val networkListAdapter by lazy { ArrayAdapter<String>(requireContext(), R.layout.start_network_list_item) }
43 var connectToNetworkAction = { _: String -> Unit } 42 var connectToNetworkAction = { _: String -> Unit }
@@ -72,13 +71,8 @@ class NetworkListFragment : BaseFragment() {
72 } 71 }
73 72
74 private fun updatePlaceholder() { 73 private fun updatePlaceholder() {
75 val placeholderTextResource = when (appPaths.storageAvailable()) {
76 true -> R.string.start_network_list_empty_none_found
77 false -> R.string.start_network_list_empty_storage_not_available
78 }
79
80 start_network_list_placeholder.post { 74 start_network_list_placeholder.post {
81 start_network_list_placeholder_text?.text = getString(placeholderTextResource) 75 start_network_list_placeholder_text?.text = getString(R.string.start_network_list_empty_none_found)
82 } 76 }
83 } 77 }
84} 78}