Commit 2ce897f7 authored by Thomas Markiewicz's avatar Thomas Markiewicz
Browse files

Started integrating AccountManager but it comes back with no accounts

parent 08f95492
Pipeline #50568 passed with stages
in 14 minutes and 11 seconds
......@@ -3,6 +3,9 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.keylesspalace.tusky">
<uses-permission
android:name="android.permission.GET_ACCOUNTS"
android:maxSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
......
package com.keylesspalace.tusky
import android.accounts.AccountManager
import android.content.Context
import android.content.Intent
import android.os.Bundle
......@@ -44,6 +45,17 @@ class OnboardingActivity : AppCompatActivity() {
}
findViewById<Button>(R.id.buttonLogin).setOnClickListener {
// TODO: use system Librem One account
// SEE: https://developer.android.com/reference/android/accounts/AccountManager
val am = AccountManager.get(this)
val accounts = am.getAccountsByType("Librem One")
if( accounts.isNotEmpty()) {
val account = accounts[0]
}
// TODO: why does it come back empty?
val intent = Intent(this, LoginActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment