summaryrefslogtreecommitdiff
path: root/src/clojure/io/cons/carddav_sync/authenticator.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/io/cons/carddav_sync/authenticator.clj')
-rw-r--r--src/clojure/io/cons/carddav_sync/authenticator.clj15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/clojure/io/cons/carddav_sync/authenticator.clj b/src/clojure/io/cons/carddav_sync/authenticator.clj
index 99aefe7..c8bd349 100644
--- a/src/clojure/io/cons/carddav_sync/authenticator.clj
+++ b/src/clojure/io/cons/carddav_sync/authenticator.clj
@@ -1,18 +1,27 @@
(ns io.cons.carddav_sync.authenticator
(:use io.cons.carddav_sync.log)
+ (:import android.accounts.AccountManager
+ android.content.Intent
+ android.os.Bundle
+ io.cons.carddav_sync.authenticator_activity)
(:gen-class
:extends android.accounts.AbstractAccountAuthenticator
- :state state
+ :state context
:init init))
(defn -init
[context]
- [[context] nil])
+ [[context] context])
(defn -addAccount
[this response accountType authTokenType requiredFeatures options]
(log-i "addAccount")
- nil)
+ (let [intent (Intent. (.context this) authenticator_activity)
+ bundle (Bundle.)]
+ (.putExtra intent AccountManager/KEY_ACCOUNT_AUTHENTICATOR_RESPONSE
+ response)
+ (.putParcelable bundle AccountManager/KEY_INTENT intent)
+ bundle))
(defn -confirmCredentials
[this response account options]