Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81ffd969 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Merge tag '4.3.5.2-ose' into 1292-Update_with_upstream

parents 34038194 fcb9d7f5
Loading
Loading
Loading
Loading
Loading
+22 −16
Original line number Diff line number Diff line
@@ -2,11 +2,14 @@
 * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
 **************************************************************************************************/

apply plugin: 'com.android.application'
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
plugins {
    id 'com.android.application'
    id 'com.google.devtools.ksp'
    id 'com.mikepenz.aboutlibraries.plugin'
    id 'dagger.hilt.android.plugin'
    id 'kotlin-android'
    id 'kotlin-kapt'     // remove as soon as Hilt supports KSP [https://issuetracker.google.com/179057202]
}

// Android configuration
android {
@@ -16,8 +19,8 @@ android {
    defaultConfig {
        applicationId "foundation.e.accountmanager"

        versionCode 403050100
        versionName '4.3.5.1'
        versionCode 403050200
        versionName '4.3.5.2'

        buildConfigField "long", "buildTime", System.currentTimeMillis() + "L"

@@ -29,12 +32,6 @@ android {
        buildConfigField "String", "userAgent", "\"DAVx5\""

        testInstrumentationRunner "at.bitfire.davdroid.CustomTestRunner"

        kapt {
            arguments {
                arg("room.schemaLocation", "$projectDir/schemas")
            }
        }
    }

    compileOptions {
@@ -62,9 +59,10 @@ android {
    // Java namespace for our classes (not to be confused with Android package ID)
    namespace 'at.bitfire.davdroid'

    flavorDimensions "distribution"
    flavorDimensions = [ "distribution" ]
    productFlavors {
        ose {
            dimension "distribution"
            versionNameSuffix "-ose"
        }
    }
@@ -120,6 +118,14 @@ android {
                "googleAuthRedirectScheme": retrieveKey("GOOGLE_REDIRECT_URI")
        ]
    }

    androidResources {
        generateLocaleConfig true
    }
}

ksp {
    arg("room.schemaLocation", "$projectDir/schemas")
}

configurations {
@@ -139,7 +145,7 @@ dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'

    implementation "com.google.dagger:hilt-android:${versions.hilt}"
    kapt "com.google.dagger:hilt-android-compiler:${versions.hilt}"
    kapt "com.google.dagger:hilt-android-compiler:${versions.hilt}"     // replace by KSP when ready [https://issuetracker.google.com/179057202]

    // support libs
    implementation 'androidx.appcompat:appcompat:1.6.1'
@@ -174,7 +180,7 @@ dependencies {
    implementation "androidx.room:room-runtime:${versions.room}"
    implementation "androidx.room:room-ktx:${versions.room}"
    implementation "androidx.room:room-paging:${versions.room}"
    kapt "androidx.room:room-compiler:${versions.room}"
    ksp "androidx.room:room-compiler:${versions.room}"
    androidTestImplementation "androidx.room:room-testing:${versions.room}"

    // own libraries
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ class AccountSettings(
                KEY_SYNC_INTERVAL_TASKS
            TaskProvider.ProviderName.values().any { it.authority == authority } ->
                KEY_SYNC_INTERVAL_TASKS
            else -> throw IllegalArgumentException("Authority does not exist: $authority")
            else -> KEY_SYNC_INTERVAL_CALENDARS
        }
        return accountManager.getUserData(account, key)?.toLong()
    }
+0 −4
Original line number Diff line number Diff line
@@ -13,14 +13,10 @@ import android.content.Context
import android.content.Intent
import android.content.SyncResult
import android.os.Bundle
import androidx.lifecycle.Observer
import androidx.work.WorkInfo
import androidx.work.WorkManager
import at.bitfire.davdroid.InvalidAccountException
import at.bitfire.davdroid.log.Logger
import at.bitfire.davdroid.settings.AccountSettings
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import java.util.logging.Level

abstract class SyncAdapterService: Service() {
+6 −22
Original line number Diff line number Diff line
@@ -17,21 +17,11 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.activity.result.contract.ActivityResultContract
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Card
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Warning
import androidx.compose.runtime.Composable
@@ -39,13 +29,13 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.intl.Locale
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
@@ -68,14 +58,7 @@ import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import net.openid.appauth.AuthState
import net.openid.appauth.AuthorizationException
import net.openid.appauth.AuthorizationRequest
import net.openid.appauth.AuthorizationResponse
import net.openid.appauth.AuthorizationService
import net.openid.appauth.AuthorizationServiceConfiguration
import net.openid.appauth.ResponseTypeValues
import net.openid.appauth.TokenResponse
import net.openid.appauth.*
import org.apache.commons.lang3.StringUtils
import java.net.URI
import java.util.logging.Level
@@ -87,7 +70,7 @@ class GoogleLoginFragment(private val defaultEmail: String? = null): Fragment()
    companion object {

        // Google API Services User Data Policy
        val GOOGLE_POLICY_URL = "https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes"
        const val GOOGLE_POLICY_URL = "https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes"

        // Support site
        val URI_TESTED_WITH_GOOGLE: Uri = Uri.parse("https://www.davx5.com/tested-with/google")
@@ -152,6 +135,7 @@ class GoogleLoginFragment(private val defaultEmail: String? = null): Fragment()
                    val authRequest = authRequestBuilder(clientId)
                        .setScopes(*SCOPES)
                        .setLoginHint(accountEmail)
                        .setUiLocales(Locale.current.toLanguageTag())
                        .build()

                    try {
+8 −3
Original line number Diff line number Diff line
@@ -9,14 +9,16 @@ import android.app.Application
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.provider.Browser
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.UiThread
import androidx.annotation.WorkerThread
import androidx.browser.customtabs.CustomTabsIntent
import androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION
import androidx.compose.ui.text.intl.Locale
import androidx.core.net.toUri
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
@@ -24,10 +26,10 @@ import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.MutableLiveData
import at.bitfire.dav4jvm.exception.DavException
import at.bitfire.dav4jvm.exception.HttpException
import at.bitfire.davdroid.network.HttpClient
import at.bitfire.davdroid.R
import at.bitfire.davdroid.db.Credentials
import at.bitfire.davdroid.log.Logger
import at.bitfire.davdroid.network.HttpClient
import at.bitfire.davdroid.ui.DebugInfoActivity
import at.bitfire.davdroid.ui.UiUtils.haveCustomTabs
import com.google.android.material.snackbar.Snackbar
@@ -51,7 +53,6 @@ import java.net.HttpURLConnection
import java.net.URI
import javax.inject.Inject


class NextcloudLoginFlowFragment: Fragment() {

    companion object {
@@ -94,6 +95,10 @@ class NextcloudLoginFlowFragment: Fragment() {
                    .setToolbarColor(resources.getColor(R.color.primaryColor))
                    .build()
                browser.intent.data = loginUri
                browser.intent.putExtra(
                    Browser.EXTRA_HEADERS,
                    bundleOf("Accept-Language" to Locale.current.toLanguageTag())
                )
                startActivityForResult(browser.intent, REQUEST_BROWSER, browser.startAnimationBundle)

            } else {
Loading