Fabric: don't report disabled plugins.

Effectively reverts 91cbe1dd63.
This commit is contained in:
Johannes Mockenhaupt 2018-10-17 15:54:33 +02:00
parent 6ae98e5177
commit eaf849e625
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -112,11 +112,11 @@ public class FabricPrivacy {
pluginStats.putCustomAttribute("HEAD", BuildConfig.HEAD); pluginStats.putCustomAttribute("HEAD", BuildConfig.HEAD);
pluginStats.putCustomAttribute("language", SP.getString(R.string.key_language,"default")); pluginStats.putCustomAttribute("language", SP.getString(R.string.key_language,"default"));
for (PluginBase plugin : MainApp.getPluginsList()) { for (PluginBase plugin : MainApp.getPluginsList()) {
if (!plugin.pluginDescription.alwaysEnabled) { if (plugin.isEnabled(plugin.getType()) && !plugin.pluginDescription.alwaysEnabled) {
if (plugin.isEnabled(plugin.getType())) // Fabric allows no more than 20 attributes attached to an event. By reporting disabled plugins as
// well, we would exceed that threshold, so only report what is enabled
// TODO >2.0: consider reworking this to upload an event per enabled plugin instead.
pluginStats.putCustomAttribute(plugin.getClass().getSimpleName(), "enabled"); pluginStats.putCustomAttribute(plugin.getClass().getSimpleName(), "enabled");
else
pluginStats.putCustomAttribute(plugin.getClass().getSimpleName(), "disabled");
} }
} }