Skip to content

Commit aeef759

Browse files
authored
Bug 1996032 - Remove deprecated globalUserParticipation functions (#7033)
1 parent 134bc8d commit aeef759

File tree

4 files changed

+0
-58
lines changed

4 files changed

+0
-58
lines changed

components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,6 @@ open class Nimbus(
159159
}
160160
}
161161

162-
override var globalUserParticipation: Boolean
163-
get() = nimbusClient.getGlobalUserParticipation()
164-
set(active) {
165-
dbScope.launch {
166-
setExperimentParticipationOnThisThread(active)
167-
setRolloutParticipationOnThisThread(active)
168-
}
169-
}
170-
171162
init {
172163
NullVariables.instance.setContext(context)
173164

@@ -439,17 +430,6 @@ open class Nimbus(
439430
}
440431
}
441432

442-
@WorkerThread
443-
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
444-
internal fun setGlobalUserParticipationOnThisThread(active: Boolean) =
445-
withCatchAll("setGlobalUserParticipation") {
446-
val enrolmentChanges = nimbusClient.setGlobalUserParticipation(active)
447-
if (enrolmentChanges.isNotEmpty()) {
448-
recordExperimentTelemetryEvents(enrolmentChanges)
449-
postEnrolmentCalculation()
450-
}
451-
}
452-
453433
override fun optOut(experimentId: String) {
454434
dbScope.launch {
455435
optOutOnThisThread(experimentId)

components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/NimbusInterface.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ interface NimbusInterface : FeaturesInterface, NimbusMessagingInterface, NimbusE
198198
*/
199199
fun resetTelemetryIdentifiers() = Unit
200200

201-
var globalUserParticipation: Boolean
202-
get() = experimentParticipation && rolloutParticipation
203-
set(value) {
204-
experimentParticipation = value
205-
rolloutParticipation = value
206-
}
207-
208201
/**
209202
* Control the opt out for experiments. This is likely a user action.
210203
* When set to false, the user will be opted out of all experiments but not rollouts.

components/nimbus/src/nimbus.udl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,6 @@ interface NimbusClient {
259259
[Throws=NimbusError]
260260
sequence<EnrollmentChangeEvent> set_rollout_participation(boolean opt_in);
261261

262-
/// Getter and setter for global user participation (applies to both experiments and rollouts).
263-
/// For simplicity, the getter returns the experiment participation value.
264-
[Throws=NimbusError]
265-
boolean get_global_user_participation();
266-
267-
[Throws=NimbusError]
268-
sequence<EnrollmentChangeEvent> set_global_user_participation(boolean opt_in);
269-
270262
/// Fetches the list of experiments from the server. This does not affect the list
271263
/// of active experiments or experiment enrolment.
272264
/// Fetched experiments are not applied until `apply_pending_updates()` is called.

components/nimbus/src/stateful/nimbus_client.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -297,29 +297,6 @@ impl NimbusClient {
297297
Ok(events)
298298
}
299299

300-
// DEPRECATED: Will be removed once Firefox is using the
301-
// new get_experiment_participation and get_rollout_participation
302-
pub fn get_global_user_participation(&self) -> Result<bool> {
303-
// For simplicity, just return the experiment participation value
304-
self.get_experiment_participation()
305-
}
306-
307-
// DEPRECATED: Will be removed once Firefox is using the
308-
// new set_experiment_participation and set_rollout_participation
309-
pub fn set_global_user_participation(
310-
&self,
311-
user_participating: bool,
312-
) -> Result<Vec<EnrollmentChangeEvent>> {
313-
// Call both set_experiment_participation and set_rollout_participation with the same value
314-
let experiment_events = self.set_experiment_participation(user_participating)?;
315-
let rollout_events = self.set_rollout_participation(user_participating)?;
316-
317-
// Combine the events from both calls
318-
let mut all_events = experiment_events;
319-
all_events.extend(rollout_events);
320-
Ok(all_events)
321-
}
322-
323300
pub fn get_active_experiments(&self) -> Result<Vec<EnrolledExperiment>> {
324301
self.database_cache.get_active_experiments()
325302
}

0 commit comments

Comments
 (0)