Add hooks to allow providing additional feature flags in EX pro

We modify the existing `FeaturesProvider` interface so that there can be more
than one of them, and the Features provided by *all* of the instances are
shown. We can then make another instance in element-android-enterprise, which
exposes enterprise-only features.
This commit is contained in:
Richard van der Hoff
2026-08-12 09:30:49 +01:00
parent fae7df16f9
commit 5b728d911b
3 changed files with 27 additions and 8 deletions
@@ -0,0 +1,21 @@
/*
* 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.libraries.featureflag.api
/**
* Provides a list of available [Feature]s that the application supports.
* Used by [FeatureFlagService.getAvailableFeatures] to obtain a list of features
* that can be presented to the user.
*
* Multiple instances can exist within the application, and all instances are polled
* to provide features for the list. This means that additional features can be provided
* by compile-time extensions.
*/
fun interface FeaturesProvider {
fun provide(): List<Feature>
}