parent
f008d29bf3
commit
6ec0d46f6b
|
@ -13,9 +13,22 @@
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<!-- Allows changing locales -->
|
<!-- Allows changing locales -->
|
||||||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
|
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"
|
||||||
|
tools:ignore="ProtectedPermissions" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
tools:replace="android:name"
|
tools:replace="android:name"
|
||||||
android:name="org.mozilla.fenix.DebugFenixApplication"/>
|
android:name="org.mozilla.fenix.DebugFenixApplication">
|
||||||
</manifest>
|
|
||||||
|
<service android:name=".customtabs.CustomTabsService">
|
||||||
|
<!-- Trusted Web Activities are currently only supported in nightly. -->
|
||||||
|
<intent-filter tools:node="removeAll" />
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
||||||
|
<category android:name="androidx.browser.trusted.category.TrustedWebActivities" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
package="org.mozilla.fenix">
|
||||||
|
|
||||||
|
<application>
|
||||||
|
|
||||||
|
<service android:name=".customtabs.CustomTabsService">
|
||||||
|
<!-- Trusted Web Activities are currently only supported in nightly. -->
|
||||||
|
<intent-filter tools:node="removeAll" />
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
||||||
|
<category android:name="androidx.browser.trusted.category.TrustedWebActivities" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
|
@ -31,7 +31,14 @@ class Components(private val context: Context) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val intentProcessors by lazy {
|
val intentProcessors by lazy {
|
||||||
IntentProcessors(context, core.sessionManager, useCases.sessionUseCases, useCases.searchUseCases)
|
IntentProcessors(
|
||||||
|
context,
|
||||||
|
core.sessionManager,
|
||||||
|
useCases.sessionUseCases,
|
||||||
|
useCases.searchUseCases,
|
||||||
|
core.client,
|
||||||
|
core.customTabsStore
|
||||||
|
)
|
||||||
}
|
}
|
||||||
val analytics by lazy { Analytics(context) }
|
val analytics by lazy { Analytics(context) }
|
||||||
val publicSuffixList by lazy { PublicSuffixList(context) }
|
val publicSuffixList by lazy { PublicSuffixList(context) }
|
||||||
|
|
|
@ -6,12 +6,16 @@ package org.mozilla.fenix.components
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import mozilla.components.browser.session.SessionManager
|
import mozilla.components.browser.session.SessionManager
|
||||||
|
import mozilla.components.concept.fetch.Client
|
||||||
import mozilla.components.feature.customtabs.CustomTabIntentProcessor
|
import mozilla.components.feature.customtabs.CustomTabIntentProcessor
|
||||||
|
import mozilla.components.feature.customtabs.store.CustomTabsServiceStore
|
||||||
import mozilla.components.feature.intent.processing.TabIntentProcessor
|
import mozilla.components.feature.intent.processing.TabIntentProcessor
|
||||||
import mozilla.components.feature.pwa.ManifestStorage
|
import mozilla.components.feature.pwa.ManifestStorage
|
||||||
import mozilla.components.feature.pwa.intent.WebAppIntentProcessor
|
import mozilla.components.feature.pwa.intent.WebAppIntentProcessor
|
||||||
|
import mozilla.components.feature.pwa.intent.TrustedWebActivityIntentProcessor
|
||||||
import mozilla.components.feature.search.SearchUseCases
|
import mozilla.components.feature.search.SearchUseCases
|
||||||
import mozilla.components.feature.session.SessionUseCases
|
import mozilla.components.feature.session.SessionUseCases
|
||||||
|
import org.mozilla.fenix.BuildConfig
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.test.Mockable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +26,9 @@ class IntentProcessors(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
private val sessionManager: SessionManager,
|
private val sessionManager: SessionManager,
|
||||||
private val sessionUseCases: SessionUseCases,
|
private val sessionUseCases: SessionUseCases,
|
||||||
private val searchUseCases: SearchUseCases
|
private val searchUseCases: SearchUseCases,
|
||||||
|
private val httpClient: Client,
|
||||||
|
private val customTabsStore: CustomTabsServiceStore
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* Provides intent processing functionality for ACTION_VIEW and ACTION_SEND intents.
|
* Provides intent processing functionality for ACTION_VIEW and ACTION_SEND intents.
|
||||||
|
@ -40,6 +46,14 @@ class IntentProcessors(
|
||||||
|
|
||||||
val externalAppIntentProcessors by lazy {
|
val externalAppIntentProcessors by lazy {
|
||||||
listOf(
|
listOf(
|
||||||
|
TrustedWebActivityIntentProcessor(
|
||||||
|
sessionManager = sessionManager,
|
||||||
|
loadUrlUseCase = sessionUseCases.loadUrl,
|
||||||
|
httpClient = httpClient,
|
||||||
|
packageManager = context.packageManager,
|
||||||
|
apiKey = BuildConfig.DIGITAL_ASSET_LINKS_TOKEN,
|
||||||
|
store = customTabsStore
|
||||||
|
),
|
||||||
WebAppIntentProcessor(sessionManager, sessionUseCases.loadUrl, ManifestStorage(context)),
|
WebAppIntentProcessor(sessionManager, sessionUseCases.loadUrl, ManifestStorage(context)),
|
||||||
CustomTabIntentProcessor(sessionManager, sessionUseCases.loadUrl, context.resources)
|
CustomTabIntentProcessor(sessionManager, sessionUseCases.loadUrl, context.resources)
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,9 +6,12 @@ package org.mozilla.fenix.customtabs
|
||||||
|
|
||||||
import mozilla.components.concept.engine.Engine
|
import mozilla.components.concept.engine.Engine
|
||||||
import mozilla.components.feature.customtabs.AbstractCustomTabsService
|
import mozilla.components.feature.customtabs.AbstractCustomTabsService
|
||||||
|
import org.mozilla.fenix.BuildConfig.DIGITAL_ASSET_LINKS_TOKEN
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
|
|
||||||
class CustomTabsService : AbstractCustomTabsService() {
|
class CustomTabsService : AbstractCustomTabsService() {
|
||||||
override val engine: Engine by lazy { applicationContext.components.core.engine }
|
override val engine: Engine by lazy { applicationContext.components.core.engine }
|
||||||
override val customTabsServiceStore by lazy { applicationContext.components.core.customTabsStore }
|
override val customTabsServiceStore by lazy { applicationContext.components.core.customTabsStore }
|
||||||
|
override val httpClient by lazy { applicationContext.components.core.client }
|
||||||
|
override val apiKey: String? = DIGITAL_ASSET_LINKS_TOKEN
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue