Merge remote-tracking branch 'origin/move-gplay-variant-to-ose' into move-gplay-variant-to-ose

This commit is contained in:
Arnau Mora
2025-10-25 14:09:58 +02:00
3 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<!--
~ Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<!-- AppAuth login flow redirect (duplicated in gplay/AndroidManifest.xml) -->
<activity
android:name="net.openid.appauth.RedirectUriReceiverActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
tools:ignore="AppLinkUrlError"
android:scheme="${applicationId}"
android:path="/oauth2/redirect"/>
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -0,0 +1,50 @@
/*
* Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
*/
package at.bitfire.davdroid
import android.content.Context
import at.bitfire.davdroid.ui.DebugInfoActivity
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import java.util.logging.Level
import java.util.logging.Logger
import javax.inject.Inject
class DebugInfoCrashHandler @Inject constructor(
@ApplicationContext private val context: Context,
private val logger: Logger
): Thread.UncaughtExceptionHandler {
@Module
@InstallIn(SingletonComponent::class)
interface DebugInfoCrashHandlerModule {
@Binds
fun debugInfoCrashHandler(
debugInfoCrashHandler: DebugInfoCrashHandler
): Thread.UncaughtExceptionHandler
}
// See https://developer.android.com/about/versions/oreo/android-8.0-changes#loue
val originalCrashHandler = Thread.getDefaultUncaughtExceptionHandler()
override fun uncaughtException(t: Thread, e: Throwable) {
logger.log(Level.SEVERE, "Unhandled exception in thread ${t.id}!", e)
// start debug info activity with exception (will be started in a new process)
val intent = DebugInfoActivity.IntentBuilder(context)
.withCause(e)
.newTask()
.build()
context.startActivity(intent)
// pass through to default handler to kill the process
originalCrashHandler?.uncaughtException(t, e)
}
}

View File

@@ -0,0 +1,25 @@
/*
* Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
*/
package at.bitfire.davdroid.di
import at.bitfire.davdroid.ui.AccountsDrawerHandler
import at.bitfire.davdroid.ui.StandardAccountsDrawerHandler
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
interface StandardModules {
@Module
@InstallIn(ActivityComponent::class)
interface ForActivities {
@Binds
fun accountsDrawerHandler(handler: StandardAccountsDrawerHandler): AccountsDrawerHandler
}
}