Restart app automatically when Microsoft workaround enabled (#150)
This commit is contained in:
parent
7ce2e8e27c
commit
d22f1a4459
@ -35,6 +35,7 @@ import java.io.IOException
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipOutputStream
|
||||
import javax.inject.Inject
|
||||
import kotlin.system.exitProcess
|
||||
import timber.log.Timber
|
||||
|
||||
@PerView
|
||||
@ -162,6 +163,11 @@ class SettingsPresenter @Inject internal constructor(
|
||||
})
|
||||
}
|
||||
|
||||
fun restartApp() {
|
||||
// process gets restarted so just exit it
|
||||
exitProcess(0)
|
||||
}
|
||||
|
||||
private inner class CreateErrorReportArchiveTask : AsyncTask<Void?, IOException?, File?>() {
|
||||
|
||||
override fun doInBackground(vararg params: Void?): File? {
|
||||
|
@ -105,7 +105,7 @@ class SettingsActivity : BaseActivity(),
|
||||
}
|
||||
|
||||
override fun onMicrosoftDisclaimerAccepted() {
|
||||
presenter.onDebugModeChanged(accepted())
|
||||
presenter.restartApp()
|
||||
}
|
||||
|
||||
override fun onMicrosoftDisclaimerRejected() {
|
||||
|
@ -411,7 +411,7 @@
|
||||
<string name="dialog_debug_mode_positive_button">Enable</string>
|
||||
<string name="dialog_debug_mode_negative_button" translatable="false">@string/dialog_button_cancel</string>
|
||||
|
||||
<string name="dialog_microsoft_workaround_disclaimer_hint">Due to a bug in Microsoft apps, we need to share the file with them in a public media folder. We only use this using those file types. After resuming to Cryptomator, we delete the public available file again but we can not influence what happens to this file in the meantime. So just enable it if this isn\'t a problem for you.\n\nIf enabled, please restart Cryptomator to apply this change.</string>
|
||||
<string name="dialog_microsoft_workaround_disclaimer_hint">Due to a bug in Microsoft apps, we need to share the file with them in a public media folder. We only use this using those file types. After resuming to Cryptomator, we delete the public available file again but we can not influence what happens to this file in the meantime. So just enable it if this isn\'t a problem for you.\n\nIf enabled, Cryptomator gets restarted.</string>
|
||||
<string name="dialog_microsoft_workaround_disclaimer_title" translatable="false">@string/dialog_debug_mode_disclaimer_title</string>
|
||||
<string name="dialog_microsoft_workaround_positive_button" translatable="false">@string/dialog_debug_mode_positive_button</string>
|
||||
<string name="dialog_microsoft_workaround_negative_button" translatable="false">@string/dialog_button_cancel</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user