Loading app/src/main/AndroidManifest.xml +101 −2 Original line number Diff line number Diff line Loading @@ -405,7 +405,7 @@ <!-- account type "eelo Address book" --> <service android:name=".syncadapter.EeloNullAuthenticatorService" android:name=".syncadapter.EeloAddressBookAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> Loading Loading @@ -490,7 +490,7 @@ <!-- account type "Google Address book" --> <service android:name=".syncadapter.GoogleNullAuthenticatorService" android:name=".syncadapter.GoogleAddressBookAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> Loading Loading @@ -546,6 +546,105 @@ android:resource="@xml/google_sync_email" /> </service> <!-- account type "Google" --> <service android:name=".syncadapter.YahooAccountAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> </intent-filter> <meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/yahoo_account_authenticator" /> </service> <service android:name=".syncadapter.YahooCalendarsSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_calendars" /> </service> <service android:name=".syncadapter.YahooTasksSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_tasks" /> </service> <service android:name=".syncadapter.YahooEmailSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_email" /> </service> <!-- account type "Yahoo Address book" --> <service android:name=".syncadapter.YahooAddressBookAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> </intent-filter> <meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/account_authenticator_yahoo_address_book" /> </service> <service android:name=".syncadapter.YahooAddressBooksSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_address_books" /> </service> <service android:name=".syncadapter.YahooContactsSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_contacts" /> <meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="@xml/contacts" /> </service> <service android:name="com.owncloud.android.services.AccountManagerService" android:enabled="true" Loading app/src/main/java/at/bitfire/davdroid/authorization/IdentityProvider.java +11 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,17 @@ public class IdentityProvider { null ); public static final IdentityProvider YAHOO = new IdentityProvider( "https://api.login.yahoo.com/.well-known/openid-configuration", null, null, BuildConfig.YAHOO_CLIENT_ID, null, BuildConfig.APPLICATION_ID + "://oauth2redirect", "openid openid2 profile email mail-w sdct-w ycal-w", null ); @Nullable private final Uri mDiscoveryEndpoint; Loading app/src/main/java/at/bitfire/davdroid/servicedetection/DavResourceFinder.kt +1 −1 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ class DavResourceFinder( fun queryEmailAddress(principal: HttpUrl): List<String> { val mailboxes = LinkedList<String>() try { DavResource(httpClient.okHttpClient, principal, null, log).propfind(0, CalendarUserAddressSet.NAME) { response, _ -> DavResource(httpClient.okHttpClient, principal, loginModel.credentials?.authState?.accessToken, log).propfind(0, CalendarUserAddressSet.NAME) { response, _ -> response[CalendarUserAddressSet::class.java]?.let { addressSet -> for (href in addressSet.hrefs) try { Loading app/src/main/java/at/bitfire/davdroid/servicedetection/RefreshCollectionsWorker.kt +6 −1 Original line number Diff line number Diff line Loading @@ -321,7 +321,12 @@ class RefreshCollectionsWorker @AssistedInject constructor( // this collection doesn't belong to a homeset anymore, otherwise it would have been confirmed info.homeSetId = null DavResource(httpClient, url).propfind(0, *DAV_COLLECTION_PROPERTIES) { response, _ -> var accessToken : String? = null service.authState?.let { accessToken = AuthState.jsonDeserialize(it).accessToken } DavResource(httpClient, url, accessToken).propfind(0, *DAV_COLLECTION_PROPERTIES) { response, _ -> if (!response.isSuccess()) return@propfind Loading app/src/main/java/at/bitfire/davdroid/syncadapter/AccountUtils.kt +21 −10 Original line number Diff line number Diff line Loading @@ -73,7 +73,8 @@ object AccountUtils { listOf( context.getString(R.string.account_type), context.getString(R.string.eelo_account_type), context.getString(R.string.google_account_type) context.getString(R.string.google_account_type), context.getString(R.string.yahoo_account_type) ) fun getMainAccounts(context: Context): List<Account> { Loading @@ -92,7 +93,8 @@ object AccountUtils { listOf( context.getString(R.string.account_type_address_book), context.getString(R.string.account_type_eelo_address_book), context.getString(R.string.account_type_google_address_book) context.getString(R.string.account_type_google_address_book), context.getString(R.string.account_type_yahoo_address_book) ) fun getAddressBookAccounts(context: Context): List<Account> { Loading @@ -107,12 +109,21 @@ object AccountUtils { return accounts } fun getAddressBookType(context: Context, mainType: String): String? { return when(mainType) { context.getString(R.string.account_type) -> context.getString(R.string.account_type_address_book) context.getString(R.string.eelo_account_type) -> context.getString(R.string.account_type_eelo_address_book) context.getString(R.string.google_account_type) -> context.getString(R.string.account_type_google_address_book) else -> null fun getOpenIdMainAccountTypes(context: Context) = listOf( context.getString(R.string.google_account_type), context.getString(R.string.yahoo_account_type) ) fun getOpenIdMainAccounts(context: Context): List<Account> { val accountManager = AccountManager.get(context) val accounts = mutableListOf<Account>() getOpenIdMainAccountTypes(context) .forEach { accounts.addAll(accountManager.getAccountsByType(it)) } return accounts } } Loading
app/src/main/AndroidManifest.xml +101 −2 Original line number Diff line number Diff line Loading @@ -405,7 +405,7 @@ <!-- account type "eelo Address book" --> <service android:name=".syncadapter.EeloNullAuthenticatorService" android:name=".syncadapter.EeloAddressBookAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> Loading Loading @@ -490,7 +490,7 @@ <!-- account type "Google Address book" --> <service android:name=".syncadapter.GoogleNullAuthenticatorService" android:name=".syncadapter.GoogleAddressBookAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> Loading Loading @@ -546,6 +546,105 @@ android:resource="@xml/google_sync_email" /> </service> <!-- account type "Google" --> <service android:name=".syncadapter.YahooAccountAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> </intent-filter> <meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/yahoo_account_authenticator" /> </service> <service android:name=".syncadapter.YahooCalendarsSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_calendars" /> </service> <service android:name=".syncadapter.YahooTasksSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_tasks" /> </service> <service android:name=".syncadapter.YahooEmailSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_email" /> </service> <!-- account type "Yahoo Address book" --> <service android:name=".syncadapter.YahooAddressBookAuthenticatorService" android:exported="false"> <intent-filter> <action android:name="android.accounts.AccountAuthenticator" /> </intent-filter> <meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/account_authenticator_yahoo_address_book" /> </service> <service android:name=".syncadapter.YahooAddressBooksSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_address_books" /> </service> <service android:name=".syncadapter.YahooContactsSyncAdapterService" android:exported="true" android:process=":sync" tools:ignore="ExportedService"> <intent-filter> <action android:name="android.content.SyncAdapter" /> </intent-filter> <meta-data android:name="android.content.SyncAdapter" android:resource="@xml/yahoo_sync_contacts" /> <meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="@xml/contacts" /> </service> <service android:name="com.owncloud.android.services.AccountManagerService" android:enabled="true" Loading
app/src/main/java/at/bitfire/davdroid/authorization/IdentityProvider.java +11 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,17 @@ public class IdentityProvider { null ); public static final IdentityProvider YAHOO = new IdentityProvider( "https://api.login.yahoo.com/.well-known/openid-configuration", null, null, BuildConfig.YAHOO_CLIENT_ID, null, BuildConfig.APPLICATION_ID + "://oauth2redirect", "openid openid2 profile email mail-w sdct-w ycal-w", null ); @Nullable private final Uri mDiscoveryEndpoint; Loading
app/src/main/java/at/bitfire/davdroid/servicedetection/DavResourceFinder.kt +1 −1 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ class DavResourceFinder( fun queryEmailAddress(principal: HttpUrl): List<String> { val mailboxes = LinkedList<String>() try { DavResource(httpClient.okHttpClient, principal, null, log).propfind(0, CalendarUserAddressSet.NAME) { response, _ -> DavResource(httpClient.okHttpClient, principal, loginModel.credentials?.authState?.accessToken, log).propfind(0, CalendarUserAddressSet.NAME) { response, _ -> response[CalendarUserAddressSet::class.java]?.let { addressSet -> for (href in addressSet.hrefs) try { Loading
app/src/main/java/at/bitfire/davdroid/servicedetection/RefreshCollectionsWorker.kt +6 −1 Original line number Diff line number Diff line Loading @@ -321,7 +321,12 @@ class RefreshCollectionsWorker @AssistedInject constructor( // this collection doesn't belong to a homeset anymore, otherwise it would have been confirmed info.homeSetId = null DavResource(httpClient, url).propfind(0, *DAV_COLLECTION_PROPERTIES) { response, _ -> var accessToken : String? = null service.authState?.let { accessToken = AuthState.jsonDeserialize(it).accessToken } DavResource(httpClient, url, accessToken).propfind(0, *DAV_COLLECTION_PROPERTIES) { response, _ -> if (!response.isSuccess()) return@propfind Loading
app/src/main/java/at/bitfire/davdroid/syncadapter/AccountUtils.kt +21 −10 Original line number Diff line number Diff line Loading @@ -73,7 +73,8 @@ object AccountUtils { listOf( context.getString(R.string.account_type), context.getString(R.string.eelo_account_type), context.getString(R.string.google_account_type) context.getString(R.string.google_account_type), context.getString(R.string.yahoo_account_type) ) fun getMainAccounts(context: Context): List<Account> { Loading @@ -92,7 +93,8 @@ object AccountUtils { listOf( context.getString(R.string.account_type_address_book), context.getString(R.string.account_type_eelo_address_book), context.getString(R.string.account_type_google_address_book) context.getString(R.string.account_type_google_address_book), context.getString(R.string.account_type_yahoo_address_book) ) fun getAddressBookAccounts(context: Context): List<Account> { Loading @@ -107,12 +109,21 @@ object AccountUtils { return accounts } fun getAddressBookType(context: Context, mainType: String): String? { return when(mainType) { context.getString(R.string.account_type) -> context.getString(R.string.account_type_address_book) context.getString(R.string.eelo_account_type) -> context.getString(R.string.account_type_eelo_address_book) context.getString(R.string.google_account_type) -> context.getString(R.string.account_type_google_address_book) else -> null fun getOpenIdMainAccountTypes(context: Context) = listOf( context.getString(R.string.google_account_type), context.getString(R.string.yahoo_account_type) ) fun getOpenIdMainAccounts(context: Context): List<Account> { val accountManager = AccountManager.get(context) val accounts = mutableListOf<Account>() getOpenIdMainAccountTypes(context) .forEach { accounts.addAll(accountManager.getAccountsByType(it)) } return accounts } }