Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ class SyncInterface(context: Context) {
Os.setenv("XDG_CACHE_HOME", cacheDir, true)
Os.setenv("XDG_CONFIG_HOME", "$filesDir/config", true)
Os.setenv("XDG_DATA_HOME", "$filesDir/data", true)

System.loadLibrary("aw_sync")
// libaw_sync.so has its own ANDROID_DATA_DIR static; RustInterface.setDataDir
// only updates libaw_server.so. Point this copy at filesDir so sync reads
// the same config.toml as the embedded server (ActivityWatch/aw-server-rust#666).
setDataDir(filesDir)
Log.i(TAG, "aw-sync initialized with sync dir: $syncDir")
}

Expand All @@ -72,6 +76,7 @@ class SyncInterface(context: Context) {
}

// Native JNI functions
private external fun setDataDir(path: String)
private external fun syncPullAll(port: Int, hostname: String): String
private external fun syncPull(port: Int, hostname: String): String
private external fun syncPush(port: Int, hostname: String): String
Expand Down
Loading