Skip to content

Commit 26b62c1

Browse files
authored
Rename flag for disabling remote commands (#1929)
1 parent 911406c commit 26b62c1

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

Common/FeatureFlags.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct FeatureFlagConfiguration: Decodable {
2626
let observeHealthKitCarbSamplesFromOtherApps: Bool
2727
let observeHealthKitDoseSamplesFromOtherApps: Bool
2828
let observeHealthKitGlucoseSamplesFromOtherApps: Bool
29-
let remoteOverridesEnabled: Bool
29+
let remoteCommandsEnabled: Bool
3030
let predictedGlucoseChartClampEnabled: Bool
3131
let scenariosEnabled: Bool
3232
let sensitivityOverridesEnabled: Bool
@@ -161,10 +161,10 @@ struct FeatureFlagConfiguration: Decodable {
161161
#endif
162162

163163
// Swift compiler config is inverse, since the default state is enabled.
164-
#if REMOTE_OVERRIDES_DISABLED
165-
self.remoteOverridesEnabled = false
164+
#if REMOTE_COMMANDS_DISABLED || REMOTE_OVERRIDES_DISABLED //REMOTE_OVERRIDES_DISABLED: backwards compatibility of Loop 3 & prior
165+
self.remoteCommandsEnabled = false
166166
#else
167-
self.remoteOverridesEnabled = true
167+
self.remoteCommandsEnabled = true
168168
#endif
169169

170170
#if SCENARIOS_ENABLED
@@ -240,7 +240,7 @@ extension FeatureFlagConfiguration : CustomDebugStringConvertible {
240240
"* observeHealthKitDoseSamplesFromOtherApps: \(observeHealthKitDoseSamplesFromOtherApps)",
241241
"* observeHealthKitGlucoseSamplesFromOtherApps: \(observeHealthKitGlucoseSamplesFromOtherApps)",
242242
"* predictedGlucoseChartClampEnabled: \(predictedGlucoseChartClampEnabled)",
243-
"* remoteOverridesEnabled: \(remoteOverridesEnabled)",
243+
"* remoteCommandsEnabled: \(remoteCommandsEnabled)",
244244
"* scenariosEnabled: \(scenariosEnabled)",
245245
"* sensitivityOverridesEnabled: \(sensitivityOverridesEnabled)",
246246
"* showEventualBloodGlucoseOnWatchEnabled: \(showEventualBloodGlucoseOnWatchEnabled)",

Loop/Managers/DeviceDataManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,8 @@ extension DeviceDataManager {
13471347
log.default("Remote Notification: Finished handling")
13481348
}
13491349

1350-
guard FeatureFlags.remoteOverridesEnabled else {
1351-
log.error("Remote Notification: Overrides not enabled.")
1350+
guard FeatureFlags.remoteCommandsEnabled else {
1351+
log.error("Remote Notification: Remote Commands not enabled.")
13521352
return
13531353
}
13541354

Loop/Managers/LoopAppManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class LoopAppManager: NSObject {
106106

107107
registerBackgroundTasks()
108108

109-
if FeatureFlags.remoteOverridesEnabled {
109+
if FeatureFlags.remoteCommandsEnabled {
110110
DispatchQueue.main.async {
111111
#if targetEnvironment(simulator)
112112
self.remoteNotificationRegistrationDidFinish(.failure(SimulatorError.remoteNotificationsNotAvailable))

Loop/Managers/SettingsManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class SettingsManager {
160160

161161
latestSettings = mergedSettings
162162

163-
if remoteNotificationRegistrationResult == nil && FeatureFlags.remoteOverridesEnabled {
163+
if remoteNotificationRegistrationResult == nil && FeatureFlags.remoteCommandsEnabled {
164164
// remote notification registration not finished
165165
return
166166
}

0 commit comments

Comments
 (0)