mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Route calls through an entry point the native stack can implement
Adds the seam a native MatrixRTC call stack plugs into, with nothing behind it yet, so that the stack itself lands as a self-contained change. `FeatureFlags.NativeCall` is off by default and unfinished. `features/callnative/api` declares `NativeCallEntryPoint`, and `features/callnative/impl` provides a default that logs and does nothing: turning the flag on today gets no call and a line in the log. That is the honest outcome, where falling back to the WebView would make the flag look broken rather than unimplemented. `DefaultElementCallEntryPoint` forks on the flag. The read is asynchronous because the flag is storage-backed, and caching it in an eagerly started StateFlow would race a call placed just after app start onto the default value. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import extension.setupDependencyInjection
|
||||
import extension.testCommonDependencies
|
||||
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
plugins {
|
||||
id("io.element.android-library")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.element.android.features.callnative.impl"
|
||||
}
|
||||
|
||||
setupDependencyInjection()
|
||||
|
||||
dependencies {
|
||||
api(projects.features.callnative.api)
|
||||
|
||||
implementation(projects.features.call.api)
|
||||
implementation(projects.libraries.architecture)
|
||||
implementation(projects.libraries.di)
|
||||
implementation(projects.libraries.matrix.api)
|
||||
|
||||
testCommonDependencies(libs)
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.features.callnative.impl
|
||||
|
||||
import dev.zacsweers.metro.AppScope
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
import io.element.android.features.call.api.CallData
|
||||
import io.element.android.features.callnative.api.NativeCallEntryPoint
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
* What answers [NativeCallEntryPoint] until the native MatrixRTC stack is wired in: nothing.
|
||||
*
|
||||
* The seam exists so that `DefaultElementCallEntryPoint` can fork on `FeatureFlags.NativeCall` today,
|
||||
* and so that adding the stack later is a change to this module alone. A user who turns the flag on
|
||||
* before then gets no call and a line in the log, which is the honest outcome - falling back to the
|
||||
* WebView would make the flag look broken rather than unimplemented.
|
||||
*/
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultNativeCallEntryPoint : NativeCallEntryPoint {
|
||||
override fun startCall(callData: CallData) {
|
||||
Timber.w("Native call requested for ${callData.roomId} but no native call stack is present in this build")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user