summaryrefslogtreecommitdiff
path: root/src/clojure/io/cons/carddav_sync/authenticator.clj
blob: c8bd3495345d61946d72168d818f712fead1cd5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(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 context
   :init init))

(defn -init
  [context]
  [[context] context])

(defn -addAccount
  [this response accountType authTokenType requiredFeatures options]
  (log-i "addAccount")
  (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]
  (log-i "confirmCredentials")
  nil)

(defn -editProperties
  [this response accountType]
  (log-i "editProperties")
  nil)

(defn -getAuthToken
  [this response account authTokenType options]
  (log-i "getAuthToken")
  nil)

(defn -getAuthTokenLabel
  [this authTokenType]
  (log-i "getAuthTokenLabel")
  nil)

(defn -hasFeatures
  [this response account features]
  (log-i "hasFeatures")
  nil)

(defn -updateCredentials
  [this response account authTokenType options]
  (log-i "updateCredentials")
  nil)