Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 727813f8 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Track when plugins are disabled due to crashes.

Bug: 120901833
Test: atest SystemUITests
Change-Id: I243d79290a5162371dd46abd0115f73deda62b3e
parent b7b11854
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -34,7 +34,16 @@ public class PluginEnablerImpl extends PreferenceDataStore implements PluginEnab
    }

    @Override
    public void setEnabled(ComponentName component, boolean enabled) {
    public void setEnabled(ComponentName component) {
        setState(component, true);
    }

    @Override
    public void setDisabled(ComponentName component, int reason) {
        setState(component, reason == ENABLED);
    }

    private void setState(ComponentName component, boolean enabled) {
        putBoolean(pluginEnabledKey(component), enabled);
    }

@@ -43,6 +52,11 @@ public class PluginEnablerImpl extends PreferenceDataStore implements PluginEnab
        return getBoolean(pluginEnabledKey(component), true);
    }

    @Override
    public int getDisableReason(ComponentName componentName) {
        return isEnabled(componentName) ? ENABLED : DISABLED_MANUALLY;
    }

    @Override
    public void putBoolean(String key, boolean value) {
        mSharedPrefs.edit().putBoolean(key, value).apply();