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

Commit 3b9e9323 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5189750 from 727813f8 to qt-release

Change-Id: I955cd1c1c8e3e73b742bddc50ccdb9697045e083
parents 7ea029cc 727813f8
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();