@@ -35,9 +35,10 @@ struct FeatureFlagConfiguration: Decodable {
3535 let siriEnabled : Bool
3636 let simpleBolusCalculatorEnabled : Bool
3737 let usePositiveMomentumAndRCForManualBoluses : Bool
38- let dynamicCarbAbsorptionEnabled : Bool
3938 let adultChildInsulinModelSelectionEnabled : Bool
4039 let profileExpirationSettingsViewEnabled : Bool
40+ let missedMealNotifications : Bool
41+ let allowAlgorithmExperiments : Bool
4142
4243
4344 fileprivate init ( ) {
@@ -212,14 +213,25 @@ struct FeatureFlagConfiguration: Decodable {
212213 self . adultChildInsulinModelSelectionEnabled = false
213214 #endif
214215
215- self . dynamicCarbAbsorptionEnabled = true
216-
217216 // ProfileExpirationSettingsView is inverse, since the default state is enabled.
218217 #if PROFILE_EXPIRATION_SETTINGS_VIEW_DISABLED
219218 self . profileExpirationSettingsViewEnabled = false
220219 #else
221220 self . profileExpirationSettingsViewEnabled = true
222221 #endif
222+
223+ // Missed meal notifications compiler flag is inverse, since the default state is enabled.
224+ #if MISSED_MEAL_NOTIFICATIONS_DISABLED
225+ self . missedMealNotifications = false
226+ #else
227+ self . missedMealNotifications = true
228+ #endif
229+
230+ #if ALLOW_ALGORITHM_EXPERIMENTS
231+ self . allowAlgorithmExperiments = true
232+ #else
233+ self . allowAlgorithmExperiments = false
234+ #endif
223235 }
224236}
225237
@@ -251,9 +263,11 @@ extension FeatureFlagConfiguration : CustomDebugStringConvertible {
251263 " * allowDebugFeatures: \( allowDebugFeatures) " ,
252264 " * simpleBolusCalculatorEnabled: \( simpleBolusCalculatorEnabled) " ,
253265 " * usePositiveMomentumAndRCForManualBoluses: \( usePositiveMomentumAndRCForManualBoluses) " ,
254- " * dynamicCarbAbsorptionEnabled: \( dynamicCarbAbsorptionEnabled) " ,
255266 " * adultChildInsulinModelSelectionEnabled: \( adultChildInsulinModelSelectionEnabled) " ,
256- " * profileExpirationSettingsViewEnabled: \( profileExpirationSettingsViewEnabled) "
267+ " * profileExpirationSettingsViewEnabled: \( profileExpirationSettingsViewEnabled) " ,
268+ " * missedMealNotifications: \( missedMealNotifications) " ,
269+ " * allowAlgorithmExperiments: \( allowAlgorithmExperiments) " ,
270+ " * allowExperimentalFeatures: \( allowExperimentalFeatures) "
257271 ] . joined ( separator: " \n " )
258272 }
259273}
@@ -277,6 +291,20 @@ extension FeatureFlagConfiguration {
277291 #endif
278292 }
279293
294+ var allowExperimentalFeatures : Bool {
295+ #if EXPERIMENTAL_FEATURES_ENABLED
296+ return true
297+ #elseif EXPERIMENTAL_FEATURES_ENABLED_CONDITIONALLY
298+ if debugEnabled {
299+ return true
300+ } else {
301+ return UserDefaults . appGroup? . allowExperimentalFeatures ?? false
302+ }
303+ #else
304+ return false
305+ #endif
306+ }
307+
280308 var allowSimulators : Bool {
281309 #if SIMULATORS_ENABLED
282310 return true
0 commit comments