-
Notifications
You must be signed in to change notification settings - Fork 531
android: expand SAF FileOps implementation #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
618294d
to
8370ee8
Compare
18f446a
to
fcd9bb0
Compare
This expands the SAF FileOps to implement the refactored FileOps Updates tailscale/corp#29211 Signed-off-by: kari-ts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(still reviewing)
libtailscale/interfaces.go
Outdated
@@ -175,14 +175,45 @@ type OutputStream interface { | |||
|
|||
// ShareFileHelper corresponds to the Kotlin ShareFileHelper class | |||
type ShareFileHelper interface { | |||
// OpenFileWriter creates or truncates a file named fileName | |||
// and returns an OutputStream for writing to it from the beginning. | |||
// Returns nil if the file cannot be opened. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other interfaces defined in libtailscale
and implemented in Kotlin suggest that exceptions are supported will be translated to Go error
s.
tailscale-android/libtailscale/interfaces.go
Lines 59 to 60 in b3626fc
// GetSyspolicyStringValue returns the current string value for the given system policy. | |
GetSyspolicyStringValue(key string) (string, error) |
tailscale-android/android/src/main/java/com/tailscale/ipn/App.kt
Lines 347 to 355 in b3626fc
@Throws( | |
IOException::class, GeneralSecurityException::class, MDMSettings.NoSuchKeyException::class) | |
override fun getSyspolicyStringValue(key: String): String { | |
val setting = MDMSettings.allSettingsByKey[key]?.flow?.value | |
if (setting?.isSet != true) { | |
throw MDMSettings.NoSuchKeyException() | |
} | |
return setting.value?.toString() ?: "" | |
} |
If that's correct, is there a reason we chose to report errors by returning nil values here and in other ShareFileHelper
methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the androidFileInfo
marshalling fixed and other feedback considered.
} | ||
uri, err := ops.helper.GetFileURI(name) | ||
if err != nil { | ||
return nil, "", err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close wc
if GetFileURI
fails?
android/src/main/java/com/tailscale/ipn/util/ShareFileHelper.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/tailscale/ipn/util/ShareFileHelper.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/tailscale/ipn/util/ShareFileHelper.kt
Outdated
Show resolved
Hide resolved
OSS and Version updated to 1.87.25-t0f15e4419-gde3b6dbfd Signed-off-by: kari-ts <[email protected]>
Signed-off-by: kari-ts <[email protected]>
* android: expand SAF FileOps implementation This expands the SAF FileOps to implement the refactored FileOps Updates tailscale/corp#29211 Signed-off-by: kari-ts <[email protected]> (cherry picked from commit e71641a) Signed-off-by: kari-ts <[email protected]>
* android: expand SAF FileOps implementation This expands the SAF FileOps to implement the refactored FileOps Updates tailscale/corp#29211 Signed-off-by: kari-ts <[email protected]> (cherry picked from commit e71641a) Signed-off-by: kari-ts <[email protected]> Signed-off-by: Jonathan Nobels <[email protected]>
* android: expand SAF FileOps implementation This expands the SAF FileOps to implement the refactored FileOps Updates tailscale/corp#29211 (cherry picked from commit e71641a) Signed-off-by: kari-ts <[email protected]> Signed-off-by: Jonathan Nobels <[email protected]> Co-authored-by: kari-ts <[email protected]>
This expands the SAF FileOps to implement the refactored FileOps
Updates tailscale/corp#29211