From b05a5338b65fa90df2f26e7a5c71da3cb419691b Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Thu, 15 Mar 2012 12:51:05 +0000 Subject: [PATCH] Revert "Use Application rather than Context in CuriousHostKeyRepository" This reverts commit 6a90dcc9a6a2330d2091eb0513dcf5e94cea8280, which seems to do the opposite of what it's commit message states... --- .../madgag/agit/ssh/CuriousHostKeyRepository.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/agit/src/main/java/com/madgag/agit/ssh/CuriousHostKeyRepository.java b/agit/src/main/java/com/madgag/agit/ssh/CuriousHostKeyRepository.java index db847654..c20f9570 100644 --- a/agit/src/main/java/com/madgag/agit/ssh/CuriousHostKeyRepository.java +++ b/agit/src/main/java/com/madgag/agit/ssh/CuriousHostKeyRepository.java @@ -21,17 +21,17 @@ import java.util.Arrays; import java.util.Map; -import android.content.Context; +import android.app.Application; @Singleton public class CuriousHostKeyRepository implements HostKeyRepository { Map knownKeys = newHashMap(); - private final Context context; + private final Application application; private final Provider blockingPromptService; @Inject - public CuriousHostKeyRepository(Context context, Provider blockingPromptService) { - this.context = context; + public CuriousHostKeyRepository(Application application, Provider blockingPromptService) { + this.application = application; this.blockingPromptService = blockingPromptService; } @@ -45,8 +45,8 @@ public int check(String host, byte[] key) { private int userCheckKey(String host, byte[] key) { String keyFingerprint = ""+code(encodeHex(md5(key)))+"
"; - String ticker = context.getString(ask_host_key_ok_ticker, code(host)); - String message = context.getString(ask_host_key_ok, code(host)+"
", keyFingerprint); + String ticker = application.getString(ask_host_key_ok_ticker, code(host)); + String message = application.getString(ask_host_key_ok, code(host)+"
", keyFingerprint); boolean userConfirmKeyGood = TRUE == blockingPromptService.get().request(promptYesOrNo(alert(fromHtml(ticker), "SSH", centered(message)))); if (userConfirmKeyGood) { knownKeys.put(host,key); @@ -75,6 +75,6 @@ public HostKey[] getHostKey() { } public HostKey[] getHostKey(String host, String type) { - return new HostKey[0]; //To change body of implemented methods use File | Settings | File Templates. + return new HostKey[0]; } }