getPrivacyLevel function
Get the current privacy level based on environment variables.
The resolved level is the most restrictive signal from: MAGE_DISABLE_NONESSENTIAL_TRAFFIC -> essentialTraffic DISABLE_TELEMETRY -> noTelemetry
Implementation
PrivacyLevel getPrivacyLevel() {
if (Platform.environment.containsKey(
'MAGE_DISABLE_NONESSENTIAL_TRAFFIC',
)) {
return PrivacyLevel.essentialTraffic;
}
if (Platform.environment.containsKey('DISABLE_TELEMETRY')) {
return PrivacyLevel.noTelemetry;
}
return PrivacyLevel.defaultLevel;
}