From fca7f8267b2602f3d4b7b671278cad181f64eb63 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Fri, 23 Jun 2017 13:15:36 +0200 Subject: reuse git sync from gitactivity --- app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'app/src') 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(); } } -- cgit v1.2.3