diff options
author | Mohamed <mohamed@zenadi.com> | 2017-06-23 13:15:36 +0200 |
---|---|---|
committer | Mohamed <mohamed@zenadi.com> | 2017-06-23 13:15:36 +0200 |
commit | fca7f8267b2602f3d4b7b671278cad181f64eb63 (patch) | |
tree | e6467e0a0bb785cf9842074020f9be0ea6488239 /app | |
parent | 2a3b82eb8a14160d7dc1294b66ffcb961148ada7 (diff) |
reuse git sync from gitactivity
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 2fe1cf10..28fa3d4a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -354,14 +354,11 @@ public class PasswordStore extends AppCompatActivity { int currentTime = (int) Calendar.getInstance().getTimeInMillis() / 1000; if (settings.getBoolean("git_auto_sync", false) && currentTime > lastSync + 3600) { Toast.makeText(getApplicationContext(), "Running git auto sync", Toast.LENGTH_LONG).show(); - SyncOperation op = new SyncOperation(localDir.getAbsoluteFile(), activity).setCommands(); - try { - String connectionMode = settings.getString("git_remote_auth", "ssh-key"); - op.executeAfterAuthentication(connectionMode, settings.getString("git_remote_username", "git"), new File(getFilesDir() + "/.ssh_key"), false); - } catch (Exception e) { - e.printStackTrace(); - } + Intent intent; + intent = new Intent(this, GitActivity.class); + intent.putExtra("Operation", GitActivity.REQUEST_SYNC); + startActivityForResult(intent, GitActivity.REQUEST_SYNC); settings.edit().putInt("last_sync", currentTime).apply(); } } |