diff --git a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt index 87ef4a4f809..42ffafbc2e3 100644 --- a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt +++ b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt @@ -1,10 +1,13 @@ package org.oppia.android.domain.platformparameter +import android.content.Context import dagger.Module import dagger.Provides +import org.oppia.android.app.utility.getVersionCode import org.oppia.android.util.platformparameter.CACHE_LATEX_RENDERING import org.oppia.android.util.platformparameter.CACHE_LATEX_RENDERING_DEFAULT_VALUE import org.oppia.android.util.platformparameter.CacheLatexRendering +import org.oppia.android.util.platformparameter.ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_CONTINUE_BUTTON_ANIMATION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_DOWNLOADS_SUPPORT_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_EDIT_ACCOUNTS_OPTIONS_UI_DEFAULT_VALUE @@ -14,6 +17,7 @@ import org.oppia.android.util.platformparameter.ENABLE_LANGUAGE_SELECTION_UI_DEF import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_SPOTLIGHT_UI_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.EnableAppAndOsDeprecation import org.oppia.android.util.platformparameter.EnableContinueButtonAnimation import org.oppia.android.util.platformparameter.EnableDownloadsSupport import org.oppia.android.util.platformparameter.EnableEditAccountsOptionsUi @@ -23,7 +27,14 @@ import org.oppia.android.util.platformparameter.EnableLanguageSelectionUi import org.oppia.android.util.platformparameter.EnableLearnerStudyAnalytics import org.oppia.android.util.platformparameter.EnablePerformanceMetricsCollection import org.oppia.android.util.platformparameter.EnableSpotlightUi +import org.oppia.android.util.platformparameter.FORCED_APP_UPDATE_VERSION_CODE +import org.oppia.android.util.platformparameter.ForcedAppUpdateVersionCode import org.oppia.android.util.platformparameter.LEARNER_STUDY_ANALYTICS +import org.oppia.android.util.platformparameter.LOWEST_SUPPORTED_API_LEVEL +import org.oppia.android.util.platformparameter.LOWEST_SUPPORTED_API_LEVEL_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.LowestSupportedApiLevel +import org.oppia.android.util.platformparameter.OPTIONAL_APP_UPDATE_VERSION_CODE +import org.oppia.android.util.platformparameter.OptionalAppUpdateVersionCode import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_LOW_FREQUENCY_TIME_INTERVAL_IN_MINUTES @@ -189,4 +200,50 @@ class PlatformParameterAlphaKenyaModule { ENABLE_SPOTLIGHT_UI_DEFAULT_VALUE ) } + + @Provides + @EnableAppAndOsDeprecation + fun provideEnableAppAndOsDeprecation(): PlatformParameterValue { + return PlatformParameterValue.createDefaultParameter( + ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE + ) + } + + @Provides + @OptionalAppUpdateVersionCode + fun provideOptionalAppUpdateVersionCode( + platformParameterSingleton: PlatformParameterSingleton, + context: Context + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + OPTIONAL_APP_UPDATE_VERSION_CODE + ) ?: PlatformParameterValue.createDefaultParameter( + context.getVersionCode() + ) + } + + @Provides + @ForcedAppUpdateVersionCode + fun provideForcedAppUpdateVersionCode( + platformParameterSingleton: PlatformParameterSingleton, + context: Context + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + FORCED_APP_UPDATE_VERSION_CODE + ) ?: PlatformParameterValue.createDefaultParameter( + context.getVersionCode() + ) + } + + @Provides + @LowestSupportedApiLevel + fun provideLowestSupportedApiLevel( + platformParameterSingleton: PlatformParameterSingleton + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + LOWEST_SUPPORTED_API_LEVEL + ) ?: PlatformParameterValue.createDefaultParameter( + LOWEST_SUPPORTED_API_LEVEL_DEFAULT_VALUE + ) + } } diff --git a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt index 161c27f8df9..4ce52320f39 100644 --- a/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt +++ b/domain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterModule.kt @@ -1,10 +1,13 @@ package org.oppia.android.domain.platformparameter +import android.content.Context import dagger.Module import dagger.Provides +import org.oppia.android.app.utility.getVersionCode import org.oppia.android.util.platformparameter.CACHE_LATEX_RENDERING import org.oppia.android.util.platformparameter.CACHE_LATEX_RENDERING_DEFAULT_VALUE import org.oppia.android.util.platformparameter.CacheLatexRendering +import org.oppia.android.util.platformparameter.ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_CONTINUE_BUTTON_ANIMATION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_DOWNLOADS_SUPPORT_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_EDIT_ACCOUNTS_OPTIONS_UI_DEFAULT_VALUE @@ -14,6 +17,7 @@ import org.oppia.android.util.platformparameter.ENABLE_LANGUAGE_SELECTION_UI_DEF import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_SPOTLIGHT_UI_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.EnableAppAndOsDeprecation import org.oppia.android.util.platformparameter.EnableContinueButtonAnimation import org.oppia.android.util.platformparameter.EnableDownloadsSupport import org.oppia.android.util.platformparameter.EnableEditAccountsOptionsUi @@ -23,8 +27,15 @@ import org.oppia.android.util.platformparameter.EnableLanguageSelectionUi import org.oppia.android.util.platformparameter.EnableLearnerStudyAnalytics import org.oppia.android.util.platformparameter.EnablePerformanceMetricsCollection import org.oppia.android.util.platformparameter.EnableSpotlightUi +import org.oppia.android.util.platformparameter.FORCED_APP_UPDATE_VERSION_CODE +import org.oppia.android.util.platformparameter.ForcedAppUpdateVersionCode import org.oppia.android.util.platformparameter.LEARNER_STUDY_ANALYTICS import org.oppia.android.util.platformparameter.LEARNER_STUDY_ANALYTICS_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.LOWEST_SUPPORTED_API_LEVEL +import org.oppia.android.util.platformparameter.LOWEST_SUPPORTED_API_LEVEL_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.LowestSupportedApiLevel +import org.oppia.android.util.platformparameter.OPTIONAL_APP_UPDATE_VERSION_CODE +import org.oppia.android.util.platformparameter.OptionalAppUpdateVersionCode import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_LOW_FREQUENCY_TIME_INTERVAL_IN_MINUTES @@ -185,4 +196,50 @@ class PlatformParameterModule { ENABLE_CONTINUE_BUTTON_ANIMATION_DEFAULT_VALUE ) } + + @Provides + @EnableAppAndOsDeprecation + fun provideEnableAppAndOsDeprecation(): PlatformParameterValue { + return PlatformParameterValue.createDefaultParameter( + ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE + ) + } + + @Provides + @OptionalAppUpdateVersionCode + fun provideOptionalAppUpdateVersionCode( + platformParameterSingleton: PlatformParameterSingleton, + context: Context + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + OPTIONAL_APP_UPDATE_VERSION_CODE + ) ?: PlatformParameterValue.createDefaultParameter( + context.getVersionCode() + ) + } + + @Provides + @ForcedAppUpdateVersionCode + fun provideForcedAppUpdateVersionCode( + platformParameterSingleton: PlatformParameterSingleton, + context: Context + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + FORCED_APP_UPDATE_VERSION_CODE + ) ?: PlatformParameterValue.createDefaultParameter( + context.getVersionCode() + ) + } + + @Provides + @LowestSupportedApiLevel + fun provideLowestSupportedApiLevel( + platformParameterSingleton: PlatformParameterSingleton + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + LOWEST_SUPPORTED_API_LEVEL + ) ?: PlatformParameterValue.createDefaultParameter( + LOWEST_SUPPORTED_API_LEVEL_DEFAULT_VALUE + ) + } } diff --git a/domain/src/test/java/org/oppia/android/domain/platformparameter/PlatformParameterModuleTest.kt b/domain/src/test/java/org/oppia/android/domain/platformparameter/PlatformParameterModuleTest.kt index f309b956197..1601eafc8c4 100644 --- a/domain/src/test/java/org/oppia/android/domain/platformparameter/PlatformParameterModuleTest.kt +++ b/domain/src/test/java/org/oppia/android/domain/platformparameter/PlatformParameterModuleTest.kt @@ -1,7 +1,10 @@ package org.oppia.android.domain.platformparameter import android.app.Application +import android.content.Context import androidx.test.core.app.ApplicationProvider +import androidx.test.core.content.pm.ApplicationInfoBuilder +import androidx.test.core.content.pm.PackageInfoBuilder import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.common.truth.Truth.assertThat import dagger.BindsInstance @@ -11,6 +14,7 @@ import dagger.Provides import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.model.PlatformParameter +import org.oppia.android.app.utility.getVersionCode import org.oppia.android.testing.platformparameter.TEST_BOOLEAN_PARAM_DEFAULT_VALUE import org.oppia.android.testing.platformparameter.TEST_BOOLEAN_PARAM_NAME import org.oppia.android.testing.platformparameter.TEST_BOOLEAN_PARAM_SERVER_VALUE @@ -24,8 +28,13 @@ import org.oppia.android.testing.platformparameter.TestBooleanParam import org.oppia.android.testing.platformparameter.TestIntegerParam import org.oppia.android.testing.platformparameter.TestPlatformParameterModule import org.oppia.android.testing.platformparameter.TestStringParam +import org.oppia.android.util.platformparameter.EnableAppAndOsDeprecation +import org.oppia.android.util.platformparameter.ForcedAppUpdateVersionCode +import org.oppia.android.util.platformparameter.LowestSupportedApiLevel +import org.oppia.android.util.platformparameter.OptionalAppUpdateVersionCode import org.oppia.android.util.platformparameter.PlatformParameterSingleton import org.oppia.android.util.platformparameter.PlatformParameterValue +import org.robolectric.Shadows import org.robolectric.annotation.Config import org.robolectric.annotation.LooperMode import javax.inject.Inject @@ -44,6 +53,9 @@ class PlatformParameterModuleTest { @Inject lateinit var platformParameterSingleton: PlatformParameterSingleton + @Inject + lateinit var context: Context + @field:[Inject TestStringParam] lateinit var stringPlatformParameterProvider: Provider> @@ -53,6 +65,18 @@ class PlatformParameterModuleTest { @field:[Inject TestBooleanParam] lateinit var booleanPlatformParameterProvider: Provider> + @field:[Inject EnableAppAndOsDeprecation] + lateinit var enableAppAndOsDeprecationProvider: Provider> + + @field:[Inject OptionalAppUpdateVersionCode] + lateinit var optionalAppUpdateVersionCodeProvider: Provider> + + @field:[Inject ForcedAppUpdateVersionCode] + lateinit var forcedAppUpdateVersionCodeProvider: Provider> + + @field:[Inject LowestSupportedApiLevel] + lateinit var lowestSupportedApiLevelProvider: Provider> + private val platformParameterMapWithValues by lazy { val mockStringPlatformParameter = PlatformParameter.newBuilder() .setString(TEST_STRING_PARAM_SERVER_VALUE).build() @@ -137,18 +161,71 @@ class PlatformParameterModuleTest { .isEqualTo(TEST_BOOLEAN_PARAM_SERVER_VALUE) } + @Test + fun testModule_injectEnableAppAndOsDeprecation_hasCorrectDefaultValue() { + setUpTestApplicationComponent(platformParameterMapWithValues) + assertThat(enableAppAndOsDeprecationProvider.get().value) + .isEqualTo(TEST_ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE) + } + + @Test + fun testModule_injectOptionalAppUpdateVersionCode_hasCorrectAppVersionCode() { + setUpTestApplicationComponent(platformParameterMapWithValues) + assertThat(optionalAppUpdateVersionCodeProvider.get().value) + .isEqualTo(context.getVersionCode()) + assertThat(optionalAppUpdateVersionCodeProvider.get().value) + .isEqualTo(TEST_APP_VERSION_CODE) + } + + @Test + fun testModule_injectForcedAppUpdateVersionCode_hasCorrectAppVersionCode() { + setUpTestApplicationComponent(platformParameterMapWithValues) + assertThat(forcedAppUpdateVersionCodeProvider.get().value) + .isEqualTo(context.getVersionCode()) + assertThat(forcedAppUpdateVersionCodeProvider.get().value) + .isEqualTo(TEST_APP_VERSION_CODE) + } + + @Test + fun testModule_injectLowestSupportedApiLevel_hasCorrectMinimumApiLevel() { + setUpTestApplicationComponent(platformParameterMapWithValues) + assertThat(lowestSupportedApiLevelProvider.get().value) + .isEqualTo(TEST_LOWEST_SUPPORTED_API_LEVEL) + } + + private fun registerTestApplication() { + val packageManager = Shadows.shadowOf(context.packageManager) + val applicationInfo = + ApplicationInfoBuilder.newBuilder() + .setPackageName(context.packageName) + .build() + val packageInfo = + PackageInfoBuilder.newBuilder() + .setPackageName(context.packageName) + .setApplicationInfo(applicationInfo) + .build() + packageInfo.versionName = TEST_APP_VERSION_NAME + packageInfo.longVersionCode = TEST_APP_VERSION_CODE + packageManager.installPackage(packageInfo) + } + private fun setUpTestApplicationComponent(platformParameterMap: Map) { ApplicationProvider.getApplicationContext().inject(this) platformParameterSingleton.setPlatformParameterMap(platformParameterMap) + registerTestApplication() } @Module class TestModule { @Provides - @Singleton fun providePlatformParameterSingleton( platformParameterSingletonImpl: PlatformParameterSingletonImpl ): PlatformParameterSingleton = platformParameterSingletonImpl + + @Provides + fun provideContext(application: Application): Context { + return application + } } // TODO(#89): Move this to a common test application component. @@ -180,4 +257,11 @@ class PlatformParameterModuleTest { component.inject(platformParameterModuleTest) } } + + private companion object { + private const val TEST_APP_VERSION_NAME = "oppia-android-test-0123456789" + private const val TEST_APP_VERSION_CODE = 125L + private const val TEST_LOWEST_SUPPORTED_API_LEVEL = 19 + private const val TEST_ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE = false + } } diff --git a/testing/src/main/java/org/oppia/android/testing/platformparameter/BUILD.bazel b/testing/src/main/java/org/oppia/android/testing/platformparameter/BUILD.bazel index 1b6b8298bf5..a724de2135e 100644 --- a/testing/src/main/java/org/oppia/android/testing/platformparameter/BUILD.bazel +++ b/testing/src/main/java/org/oppia/android/testing/platformparameter/BUILD.bazel @@ -35,6 +35,7 @@ kt_android_library( ":dagger", ":test_constants", "//utility", + "//utility/src/main/java/org/oppia/android/util/extensions:context_extensions", ], ) diff --git a/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt b/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt index 3909d19c7dd..6dd32e0d855 100644 --- a/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt +++ b/testing/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt @@ -1,11 +1,14 @@ package org.oppia.android.testing.platformparameter +import android.content.Context import androidx.annotation.VisibleForTesting import dagger.Module import dagger.Provides +import org.oppia.android.app.utility.getVersionCode import org.oppia.android.util.platformparameter.CACHE_LATEX_RENDERING import org.oppia.android.util.platformparameter.CACHE_LATEX_RENDERING_DEFAULT_VALUE import org.oppia.android.util.platformparameter.CacheLatexRendering +import org.oppia.android.util.platformparameter.ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_CONTINUE_BUTTON_ANIMATION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_DOWNLOADS_SUPPORT_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_EDIT_ACCOUNTS_OPTIONS_UI_DEFAULT_VALUE @@ -13,6 +16,7 @@ import org.oppia.android.util.platformparameter.ENABLE_EXTRA_TOPIC_TABS_UI_DEFAU import org.oppia.android.util.platformparameter.ENABLE_INTERACTION_CONFIG_CHANGE_STATE_RETENTION_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_LANGUAGE_SELECTION_UI_DEFAULT_VALUE import org.oppia.android.util.platformparameter.ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.EnableAppAndOsDeprecation import org.oppia.android.util.platformparameter.EnableContinueButtonAnimation import org.oppia.android.util.platformparameter.EnableDownloadsSupport import org.oppia.android.util.platformparameter.EnableEditAccountsOptionsUi @@ -22,7 +26,14 @@ import org.oppia.android.util.platformparameter.EnableLanguageSelectionUi import org.oppia.android.util.platformparameter.EnableLearnerStudyAnalytics import org.oppia.android.util.platformparameter.EnablePerformanceMetricsCollection import org.oppia.android.util.platformparameter.EnableSpotlightUi +import org.oppia.android.util.platformparameter.FORCED_APP_UPDATE_VERSION_CODE +import org.oppia.android.util.platformparameter.ForcedAppUpdateVersionCode import org.oppia.android.util.platformparameter.LEARNER_STUDY_ANALYTICS_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.LOWEST_SUPPORTED_API_LEVEL +import org.oppia.android.util.platformparameter.LOWEST_SUPPORTED_API_LEVEL_DEFAULT_VALUE +import org.oppia.android.util.platformparameter.LowestSupportedApiLevel +import org.oppia.android.util.platformparameter.OPTIONAL_APP_UPDATE_VERSION_CODE +import org.oppia.android.util.platformparameter.OptionalAppUpdateVersionCode import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_LOW_FREQUENCY_TIME_INTERVAL_IN_MINUTES @@ -193,6 +204,51 @@ class TestPlatformParameterModule { ) } + @Provides + @EnableAppAndOsDeprecation + fun provideEnableAppAndOsDeprecation(): PlatformParameterValue { + return PlatformParameterValue.createDefaultParameter(enableAppAndOsDeprecation) + } + + @Provides + @Singleton + @OptionalAppUpdateVersionCode + fun provideOptionalAppUpdateVersionCode( + platformParameterSingleton: PlatformParameterSingleton, + context: Context + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + OPTIONAL_APP_UPDATE_VERSION_CODE + ) ?: PlatformParameterValue.createDefaultParameter( + context.getVersionCode() + ) + } + + @Provides + @ForcedAppUpdateVersionCode + fun provideForcedAppUpdateVersionCode( + platformParameterSingleton: PlatformParameterSingleton, + context: Context + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + FORCED_APP_UPDATE_VERSION_CODE + ) ?: PlatformParameterValue.createDefaultParameter( + context.getVersionCode() + ) + } + + @Provides + @LowestSupportedApiLevel + fun provideLowestSupportedApiLevel( + platformParameterSingleton: PlatformParameterSingleton + ): PlatformParameterValue { + return platformParameterSingleton.getIntegerPlatformParameter( + LOWEST_SUPPORTED_API_LEVEL + ) ?: PlatformParameterValue.createDefaultParameter( + LOWEST_SUPPORTED_API_LEVEL_DEFAULT_VALUE + ) + } + companion object { private var enableDownloadsSupport = ENABLE_DOWNLOADS_SUPPORT_DEFAULT_VALUE private var enableLanguageSelectionUi = ENABLE_LANGUAGE_SELECTION_UI_DEFAULT_VALUE @@ -204,6 +260,7 @@ class TestPlatformParameterModule { private var enablePerformanceMetricsCollection = ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE private var enableSpotlightUi = true + private var enableAppAndOsDeprecation = ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE /** Enables forcing [EnableLanguageSelectionUi] platform parameter flag from tests. */ @VisibleForTesting(otherwise = VisibleForTesting.NONE) @@ -270,6 +327,7 @@ class TestPlatformParameterModule { enableInteractionConfigChangeStateRetention = ENABLE_INTERACTION_CONFIG_CHANGE_STATE_RETENTION_DEFAULT_VALUE enablePerformanceMetricsCollection = ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE + enableAppAndOsDeprecation = ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE } } } diff --git a/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt b/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt index 1d04df9960e..04b6f2b8ea6 100644 --- a/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt +++ b/utility/src/main/java/org/oppia/android/util/platformparameter/PlatformParameterConstants.kt @@ -231,3 +231,62 @@ annotation class EnableInteractionConfigChangeStateRetention * Default value for feature flag corresponding to [EnableInteractionConfigChangeStateRetention]. */ const val ENABLE_INTERACTION_CONFIG_CHANGE_STATE_RETENTION_DEFAULT_VALUE = false + +/** + * Qualifier for the [EnableAppAndOsDeprecation] feature flag that controls whether to enable + * app and OS deprecation or not. + */ +@Qualifier +annotation class EnableAppAndOsDeprecation + +/** + * Default value for the feature flag corresponding to [EnableAppAndOsDeprecation]. + */ +const val ENABLE_APP_AND_OS_DEPRECATION_DEFAULT_VALUE = false + +/** + * Qualifier for the platform parameter that contains the version code of the latest available + * optional app update, which is used to notify the app that a soft update is available. + */ +@Qualifier +annotation class OptionalAppUpdateVersionCode + +/** + * Name of the platform parameter that contains the integer version code of the latest available + * optional app update. + */ +const val OPTIONAL_APP_UPDATE_VERSION_CODE = "optional_app_update_version_code" + +/** + * Qualifier for the platform parameter that contains the version code of the latest available + * forced app update, which is used to notify the app that a mandatory update is available. + */ +@Qualifier +annotation class ForcedAppUpdateVersionCode + +/** + * Name of the platform parameter that contains the integer version code of the latest available + * forced app update. + */ +const val FORCED_APP_UPDATE_VERSION_CODE = "forced_app_update_version_code" + +/** + * Qualifier for the platform parameter that contains an integer indicating the lowest supported + * Android API Level. + */ +@Qualifier +annotation class LowestSupportedApiLevel + +/** + * Name of the platform parameter that contains an integer indicating the lowest supported Android + * API Level. + */ +const val LOWEST_SUPPORTED_API_LEVEL = "lowest_supported_api_level" + +/** + * Default value for the platform parameter that contains an integer indicating the lowest + * supported Android API Level. + * + * The current minimum supported API level is 19 (KitKat). + */ +const val LOWEST_SUPPORTED_API_LEVEL_DEFAULT_VALUE = 19