forked from oppia/oppia-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kenya study-specific alpha build flavor.
This new build flavor automatically enables the study-specific learner study feature flag.
- Loading branch information
1 parent
01d5dfb
commit eef2f4c
Showing
8 changed files
with
312 additions
and
1 deletion.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
.../main/java/org/oppia/android/app/application/alphakenya/AlphaKenyaApplicationComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package org.oppia.android.app.application.alphakenya | ||
|
||
import dagger.Component | ||
import org.oppia.android.app.application.ApplicationComponent | ||
import org.oppia.android.app.application.ApplicationModule | ||
import org.oppia.android.app.application.ApplicationStartupListenerModule | ||
import org.oppia.android.app.devoptions.DeveloperOptionsModule | ||
import org.oppia.android.app.player.state.itemviewmodel.SplitScreenInteractionModule | ||
import org.oppia.android.app.shim.IntentFactoryShimModule | ||
import org.oppia.android.app.shim.ViewBindingShimModule | ||
import org.oppia.android.app.topic.PracticeTabModule | ||
import org.oppia.android.app.translation.ActivityRecreatorProdModule | ||
import org.oppia.android.data.backends.gae.NetworkConfigProdModule | ||
import org.oppia.android.data.backends.gae.NetworkModule | ||
import org.oppia.android.domain.classify.InteractionsModule | ||
import org.oppia.android.domain.classify.rules.algebraicexpressioninput.AlgebraicExpressionInputModule | ||
import org.oppia.android.domain.classify.rules.continueinteraction.ContinueModule | ||
import org.oppia.android.domain.classify.rules.dragAndDropSortInput.DragDropSortInputModule | ||
import org.oppia.android.domain.classify.rules.fractioninput.FractionInputModule | ||
import org.oppia.android.domain.classify.rules.imageClickInput.ImageClickInputModule | ||
import org.oppia.android.domain.classify.rules.itemselectioninput.ItemSelectionInputModule | ||
import org.oppia.android.domain.classify.rules.mathequationinput.MathEquationInputModule | ||
import org.oppia.android.domain.classify.rules.multiplechoiceinput.MultipleChoiceInputModule | ||
import org.oppia.android.domain.classify.rules.numberwithunits.NumberWithUnitsRuleModule | ||
import org.oppia.android.domain.classify.rules.numericexpressioninput.NumericExpressionInputModule | ||
import org.oppia.android.domain.classify.rules.numericinput.NumericInputRuleModule | ||
import org.oppia.android.domain.classify.rules.ratioinput.RatioInputModule | ||
import org.oppia.android.domain.classify.rules.textinput.TextInputRuleModule | ||
import org.oppia.android.domain.exploration.lightweightcheckpointing.ExplorationStorageModule | ||
import org.oppia.android.domain.hintsandsolution.HintsAndSolutionConfigModule | ||
import org.oppia.android.domain.hintsandsolution.HintsAndSolutionProdModule | ||
import org.oppia.android.domain.onboarding.ExpirationMetaDataRetrieverModule | ||
import org.oppia.android.domain.oppialogger.LogStorageModule | ||
import org.oppia.android.domain.oppialogger.LoggingIdentifierModule | ||
import org.oppia.android.domain.oppialogger.analytics.ApplicationLifecycleModule | ||
import org.oppia.android.domain.oppialogger.exceptions.UncaughtExceptionLoggerModule | ||
import org.oppia.android.domain.oppialogger.loguploader.LogUploadWorkerModule | ||
import org.oppia.android.domain.platformparameter.PlatformParameterAlphaKenyaModule | ||
import org.oppia.android.domain.platformparameter.PlatformParameterSingletonModule | ||
import org.oppia.android.domain.platformparameter.syncup.PlatformParameterSyncUpWorkerModule | ||
import org.oppia.android.domain.question.QuestionModule | ||
import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule | ||
import org.oppia.android.domain.workmanager.WorkManagerConfigurationModule | ||
import org.oppia.android.util.accessibility.AccessibilityProdModule | ||
import org.oppia.android.util.caching.AssetModule | ||
import org.oppia.android.util.caching.CachingModule | ||
import org.oppia.android.util.gcsresource.GcsResourceModule | ||
import org.oppia.android.util.locale.LocaleProdModule | ||
import org.oppia.android.util.logging.LoggerModule | ||
import org.oppia.android.util.logging.SyncStatusModule | ||
import org.oppia.android.util.logging.firebase.FirebaseLogUploaderModule | ||
import org.oppia.android.util.logging.firebase.LogReportingModule | ||
import org.oppia.android.util.networking.NetworkConnectionDebugUtilModule | ||
import org.oppia.android.util.networking.NetworkConnectionUtilProdModule | ||
import org.oppia.android.util.parser.html.HtmlParserEntityTypeModule | ||
import org.oppia.android.util.parser.image.GlideImageLoaderModule | ||
import org.oppia.android.util.parser.image.ImageParsingModule | ||
import org.oppia.android.util.system.OppiaClockModule | ||
import org.oppia.android.util.threading.DispatcherModule | ||
import javax.inject.Singleton | ||
|
||
/** | ||
* Root Dagger component for the alpha version of the application specific to a user study in Kenya. | ||
* | ||
* All application-scoped modules should be included in this component. | ||
*/ | ||
@Singleton | ||
@Component( | ||
modules = [ | ||
ApplicationModule::class, DispatcherModule::class, LoggerModule::class, OppiaClockModule::class, | ||
ContinueModule::class, FractionInputModule::class, ItemSelectionInputModule::class, | ||
MultipleChoiceInputModule::class, NumberWithUnitsRuleModule::class, | ||
NumericInputRuleModule::class, TextInputRuleModule::class, DragDropSortInputModule::class, | ||
InteractionsModule::class, GcsResourceModule::class, GlideImageLoaderModule::class, | ||
ImageParsingModule::class, HtmlParserEntityTypeModule::class, CachingModule::class, | ||
QuestionModule::class, AccessibilityProdModule::class, ImageClickInputModule::class, | ||
LogStorageModule::class, IntentFactoryShimModule::class, ViewBindingShimModule::class, | ||
PrimeTopicAssetsControllerModule::class, ExpirationMetaDataRetrieverModule::class, | ||
RatioInputModule::class, UncaughtExceptionLoggerModule::class, | ||
ApplicationStartupListenerModule::class, LogUploadWorkerModule::class, | ||
WorkManagerConfigurationModule::class, HintsAndSolutionConfigModule::class, | ||
FirebaseLogUploaderModule::class, NetworkModule::class, PracticeTabModule::class, | ||
PlatformParameterAlphaKenyaModule::class, PlatformParameterSingletonModule::class, | ||
ExplorationStorageModule::class, DeveloperOptionsModule::class, | ||
PlatformParameterSyncUpWorkerModule::class, NetworkConfigProdModule::class, AssetModule::class, | ||
LocaleProdModule::class, ActivityRecreatorProdModule::class, | ||
NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, | ||
MathEquationInputModule::class, SplitScreenInteractionModule::class, | ||
LoggingIdentifierModule::class, ApplicationLifecycleModule::class, | ||
NetworkConnectionDebugUtilModule::class, LoggingIdentifierModule::class, | ||
SyncStatusModule::class, LogReportingModule::class, NetworkConnectionUtilProdModule::class, | ||
HintsAndSolutionProdModule::class, AlphaKenyaBuildFlavorModule::class | ||
] | ||
) | ||
interface AlphaKenyaApplicationComponent : ApplicationComponent { | ||
/** | ||
* The [ApplicationComponent.Builder] for this component. Dagger will generate an implementation | ||
* of this builder for use. | ||
*/ | ||
@Component.Builder | ||
interface Builder : ApplicationComponent.Builder { | ||
override fun build(): AlphaKenyaApplicationComponent | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...src/main/java/org/oppia/android/app/application/alphakenya/AlphaKenyaBuildFlavorModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.oppia.android.app.application.alphakenya | ||
|
||
import dagger.Module | ||
import dagger.Provides | ||
import org.oppia.android.app.model.BuildFlavor | ||
|
||
/** | ||
* Module for providing the compile-time [BuildFlavor] of the Kenya-specific alpha build of the app. | ||
*/ | ||
@Module | ||
class AlphaKenyaBuildFlavorModule { | ||
@Provides | ||
fun provideAlphaKenyaBuildFlavor(): BuildFlavor = BuildFlavor.ALPHA | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/org/oppia/android/app/application/alphakenya/AlphaKenyaOppiaApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.oppia.android.app.application.alphakenya | ||
|
||
import org.oppia.android.app.application.AbstractOppiaApplication | ||
|
||
// TODO(#4419): Remove this application class & broader Kenya-specific alpha package. | ||
/** The root [AbstractOppiaApplication] for the Kenya-specific alpha build of the Oppia app. */ | ||
class AlphaKenyaOppiaApplication : AbstractOppiaApplication( | ||
DaggerAlphaKenyaApplicationComponent::builder | ||
) |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/org/oppia/android/app/application/alphakenya/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
This package contains the root application definitions for a Kenya user study specific alpha build | ||
of the app. | ||
""" | ||
|
||
load("@dagger//:workspace_defs.bzl", "dagger_rules") | ||
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library") | ||
|
||
kt_android_library( | ||
name = "alpha_kenya_application", | ||
srcs = [ | ||
"AlphaKenyaApplicationComponent.kt", | ||
"AlphaKenyaBuildFlavorModule.kt", | ||
"AlphaKenyaOppiaApplication.kt", | ||
], | ||
visibility = ["//:oppia_binary_visibility"], | ||
deps = [ | ||
":dagger", | ||
"//app", | ||
"//app/src/main/java/org/oppia/android/app/application:abstract_application", | ||
"//app/src/main/java/org/oppia/android/app/application:application_component", | ||
"//app/src/main/java/org/oppia/android/app/application:common_application_modules", | ||
"//utility/src/main/java/org/oppia/android/util/logging/firebase:prod_module", | ||
"//utility/src/main/java/org/oppia/android/util/networking:prod_module", | ||
], | ||
) | ||
|
||
dagger_rules() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
...main/java/org/oppia/android/domain/platformparameter/PlatformParameterAlphaKenyaModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
package org.oppia.android.domain.platformparameter | ||
|
||
import dagger.Module | ||
import dagger.Provides | ||
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_LANGUAGE_SELECTION_UI_DEFAULT_VALUE | ||
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.EnableLanguageSelectionUi | ||
import org.oppia.android.util.platformparameter.EnablePerformanceMetricsCollection | ||
import org.oppia.android.util.platformparameter.LEARNER_STUDY_ANALYTICS | ||
import org.oppia.android.util.platformparameter.LearnerStudyAnalytics | ||
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 | ||
import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_LOW_FREQUENCY_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL | ||
import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_UPLOAD_TIME_INTERVAL_IN_MINUTES | ||
import org.oppia.android.util.platformparameter.PERFORMANCE_METRICS_COLLECTION_UPLOAD_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL | ||
import org.oppia.android.util.platformparameter.PerformanceMetricsCollectionHighFrequencyTimeIntervalInMinutes | ||
import org.oppia.android.util.platformparameter.PerformanceMetricsCollectionLowFrequencyTimeIntervalInMinutes | ||
import org.oppia.android.util.platformparameter.PerformanceMetricsCollectionUploadTimeIntervalInMinutes | ||
import org.oppia.android.util.platformparameter.PlatformParameterSingleton | ||
import org.oppia.android.util.platformparameter.PlatformParameterValue | ||
import org.oppia.android.util.platformparameter.SPLASH_SCREEN_WELCOME_MSG | ||
import org.oppia.android.util.platformparameter.SPLASH_SCREEN_WELCOME_MSG_DEFAULT_VALUE | ||
import org.oppia.android.util.platformparameter.SYNC_UP_WORKER_TIME_PERIOD_IN_HOURS | ||
import org.oppia.android.util.platformparameter.SYNC_UP_WORKER_TIME_PERIOD_IN_HOURS_DEFAULT_VALUE | ||
import org.oppia.android.util.platformparameter.SplashScreenWelcomeMsg | ||
import org.oppia.android.util.platformparameter.SyncUpWorkerTimePeriodHours | ||
|
||
// TODO(#4419): Remove this module. | ||
/** | ||
* Dagger module that provides bindings for platform parameters for the Kenya-specific alpha build | ||
* of the app. | ||
*/ | ||
@Module | ||
class PlatformParameterAlphaKenyaModule { | ||
@Provides | ||
@SplashScreenWelcomeMsg | ||
fun provideSplashScreenWelcomeMsgParam( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Boolean> { | ||
return platformParameterSingleton.getBooleanPlatformParameter(SPLASH_SCREEN_WELCOME_MSG) | ||
?: PlatformParameterValue.createDefaultParameter(SPLASH_SCREEN_WELCOME_MSG_DEFAULT_VALUE) | ||
} | ||
|
||
@Provides | ||
@SyncUpWorkerTimePeriodHours | ||
fun provideSyncUpWorkerTimePeriod( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Int> { | ||
return platformParameterSingleton.getIntegerPlatformParameter( | ||
SYNC_UP_WORKER_TIME_PERIOD_IN_HOURS | ||
) ?: PlatformParameterValue.createDefaultParameter( | ||
SYNC_UP_WORKER_TIME_PERIOD_IN_HOURS_DEFAULT_VALUE | ||
) | ||
} | ||
|
||
@Provides | ||
@EnableLanguageSelectionUi | ||
fun provideEnableLanguageSelectionUi(): PlatformParameterValue<Boolean> { | ||
return PlatformParameterValue.createDefaultParameter( | ||
ENABLE_LANGUAGE_SELECTION_UI_DEFAULT_VALUE | ||
) | ||
} | ||
|
||
@Provides | ||
@LearnerStudyAnalytics | ||
fun provideLearnerStudyAnalytics( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Boolean> { | ||
// Turn on the learner study platform parameter by default. | ||
return platformParameterSingleton.getBooleanPlatformParameter(LEARNER_STUDY_ANALYTICS) | ||
?: PlatformParameterValue.createDefaultParameter(true) | ||
} | ||
|
||
@Provides | ||
@CacheLatexRendering | ||
fun provideCacheLatexRendering( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Boolean> { | ||
return platformParameterSingleton.getBooleanPlatformParameter(CACHE_LATEX_RENDERING) | ||
?: PlatformParameterValue.createDefaultParameter(CACHE_LATEX_RENDERING_DEFAULT_VALUE) | ||
} | ||
|
||
@Provides | ||
@EnablePerformanceMetricsCollection | ||
fun provideEnablePerformanceMetricCollection( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Boolean> { | ||
return platformParameterSingleton.getBooleanPlatformParameter( | ||
ENABLE_PERFORMANCE_METRICS_COLLECTION | ||
) ?: PlatformParameterValue.createDefaultParameter( | ||
ENABLE_PERFORMANCE_METRICS_COLLECTION_DEFAULT_VALUE | ||
) | ||
} | ||
|
||
@Provides | ||
@PerformanceMetricsCollectionUploadTimeIntervalInMinutes | ||
fun providePerformanceMetricsCollectionUploadTimeIntervalInMinutes( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Int> { | ||
return platformParameterSingleton.getIntegerPlatformParameter( | ||
PERFORMANCE_METRICS_COLLECTION_UPLOAD_TIME_INTERVAL_IN_MINUTES | ||
) ?: PlatformParameterValue.createDefaultParameter( | ||
PERFORMANCE_METRICS_COLLECTION_UPLOAD_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL | ||
) | ||
} | ||
|
||
@Provides | ||
@PerformanceMetricsCollectionHighFrequencyTimeIntervalInMinutes | ||
fun providePerformanceMetricsCollectionHighFrequencyTimeIntervalInMinutes( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Int> { | ||
return platformParameterSingleton.getIntegerPlatformParameter( | ||
PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES | ||
) ?: PlatformParameterValue.createDefaultParameter( | ||
PERFORMANCE_METRICS_COLLECTION_HIGH_FREQUENCY_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL | ||
) | ||
} | ||
|
||
@Provides | ||
@PerformanceMetricsCollectionLowFrequencyTimeIntervalInMinutes | ||
fun providePerformanceMetricsCollectionLowFrequencyTimeIntervalInMinutes( | ||
platformParameterSingleton: PlatformParameterSingleton | ||
): PlatformParameterValue<Int> { | ||
return platformParameterSingleton.getIntegerPlatformParameter( | ||
PERFORMANCE_METRICS_COLLECTION_LOW_FREQUENCY_TIME_INTERVAL_IN_MINUTES | ||
) ?: PlatformParameterValue.createDefaultParameter( | ||
PERFORMANCE_METRICS_COLLECTION_LOW_FREQUENCY_TIME_INTERVAL_IN_MINUTES_DEFAULT_VAL | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters