summaryrefslogtreecommitdiff
path: root/src/clojure/io/cons/carddav_sync/authenticator.clj
blob: 2bd6b003332d25b717940794bed318b6186d4050 (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
55
56
57
(ns io.cons.carddav_sync.authenticator
  (:use io.cons.carddav_sync.log)
  (:require io.cons.carddav_sync.authenticator_activity)
  (:import android.accounts.AccountManager
           android.content.Intent
           android.os.Bundle
           [io.cons.carddav_sync authenticator_activity SplashActivity])
  (: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 [selector (Intent. (.context this) authenticator_activity)
        intent (Intent. (.context this) SplashActivity)
        bundle (Bundle.)]
    (.putExtra selector AccountManager/KEY_ACCOUNT_AUTHENTICATOR_RESPONSE
               response)
    (.setSelector intent selector)
    (.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)