Files now saving with the file picker, not with the sharing mechanism
This commit is contained in:
parent
5f85bf62f5
commit
8d45af2034
6 changed files with 53 additions and 64 deletions
|
|
@ -32,7 +32,6 @@ class VPNServiceBinder(service: VPNService) : Binder() {
|
|||
const val resumeActivate = 7
|
||||
const val setNotificationText = 8
|
||||
const val setFallBackNotification = 9
|
||||
const val shareConfig = 10
|
||||
const val importConfig = 11
|
||||
}
|
||||
|
||||
|
|
@ -139,20 +138,6 @@ class VPNServiceBinder(service: VPNService) : Binder() {
|
|||
return true
|
||||
}
|
||||
|
||||
ACTIONS.shareConfig -> {
|
||||
val byteArray = data.createByteArray()
|
||||
val json = byteArray?.let { String(it) }
|
||||
val config = JSONObject(json)
|
||||
val configContent = config.getString("data")
|
||||
val suggestedName = config.getString("suggestedName")
|
||||
|
||||
val filePath = mService.saveAsFile(configContent, suggestedName)
|
||||
Log.i(tag, "save file: $filePath")
|
||||
|
||||
mService.shareFile(filePath)
|
||||
return true
|
||||
}
|
||||
|
||||
ACTIONS.importConfig -> {
|
||||
val buffer = data.readString()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue