/**
 *
 */
package com.adam.aslfms.util.enums;

import android.content.Context;
import android.util.Log;

import com.adam.aslfms.R;

import java.util.HashMap;
import java.util.Map;

public enum AdvancedOptions {
    // the values below for SAME will be ignored
    SAME_AS_BATTERY(
            "ao_same_as_battery", false, false, true, true, AdvancedOptionsWhen.AFTER_1, true, NetworkOptions.ANY, true,
            R.string.advanced_options_type_same_as_battery_name),
    STANDARD(
            "ao_standard", false, false, true, true, AdvancedOptionsWhen.AFTER_1, true, NetworkOptions.ANY, true,
            R.string.advanced_options_type_standard_name),
    // not available for plugged in
    BATTERY_SAVING(
            "ao_battery", false, false, true, false, AdvancedOptionsWhen.AFTER_10, true, NetworkOptions.ANY, false,
            R.string.advanced_options_type_battery_name),
    // the values below for CUSTOM will be ignored
    CUSTOM(
            "ao_custom", false, false, true, true, AdvancedOptionsWhen.AFTER_1, true, NetworkOptions.ANY, true,
            R.string.advanced_options_type_custom_name);

    private final String settingsVal;
    private final boolean enableActiveApp;
    private final boolean enableNotify;
    private final boolean enableScrobbling;
    private final boolean enableNp;
    private final AdvancedOptionsWhen when;
    private final boolean alsoOnComplete;
    private final NetworkOptions networkOptions;
    private final boolean roaming;
    private final int nameRID;

    AdvancedOptions(String settingsVal, boolean enableActiveApp, boolean enableNotify, boolean enableScrobbling, boolean enableNp, AdvancedOptionsWhen when,
                    boolean alsoOnComplete, NetworkOptions networkOptions, boolean roaming, int nameRID) {
        this.settingsVal = settingsVal;
        this.enableActiveApp = enableActiveApp;
        this.enableNotify = enableNotify;
        this.enableScrobbling = enableScrobbling;
        this.enableNp = enableNp;
        this.when = when;
        this.alsoOnComplete = alsoOnComplete;
        this.networkOptions = networkOptions;
        this.roaming = roaming;
        this.nameRID = nameRID;
    }

    // these methods are intentionally package-private, they are only used
    // by AppSettings

    public String getSettingsVal() {
        return settingsVal;
    }

    public boolean isActiveAppEnabled() {
        return enableActiveApp;
    }

    public boolean isNotifyEnabled() {
        return enableNotify;
    }

    public boolean isScrobblingEnabled() {
        return enableScrobbling;
    }

    public boolean isNpEnabled() {
        return enableNp;
    }

    public AdvancedOptionsWhen getWhen() {
        return when;
    }

    public boolean getAlsoOnComplete() {
        return alsoOnComplete;
    }

    public NetworkOptions getNetworkOptions() {
        return networkOptions;
    }

    public boolean getRoaming() {
        return roaming;
    }

    public String getName(Context ctx) {
        return ctx.getString(nameRID);
    }

    private static final String TAG = "SLSAdvancedOptions";
    private static Map<String, AdvancedOptions> mSAOMap;

    static {
        AdvancedOptions[] aos = AdvancedOptions.values();
        mSAOMap = new HashMap<String, AdvancedOptions>(aos.length);
        for (AdvancedOptions ao : aos)
            mSAOMap.put(ao.getSettingsVal(), ao);
    }

    public static AdvancedOptions fromSettingsVal(String s) {
        AdvancedOptions ao = mSAOMap.get(s);
        if (ao == null) {
            Log.e(TAG, "got null advanced option from settings, defaulting to standard");
            ao = AdvancedOptions.STANDARD;
        }
        return ao;
    }
}
@@ -321,35 +321,27 @@
 s_battery%22, 
-false, fals
+tru
 e, true, tru
@@ -513,38 +513,32 @@
 andard%22, false, 
-false,
  true, true, Adv
@@ -740,27 +740,19 @@
 ttery%22, 
-false, fals
+tru
 e, true,
@@ -976,19 +976,11 @@
 m%22, 
-false, fals
+tru
 e, t
@@ -1199,49 +1199,8 @@
 p;%0D%0A
-    private final boolean enableNotify;%0D%0A
     
@@ -1553,30 +1553,8 @@
 App,
- boolean enableNotify,
  boo
@@ -1823,51 +1823,8 @@
 p;%0D%0A
-        this.enableNotify = enableNotify;%0D%0A
     
@@ -2367,87 +2367,8 @@
 %0D%0A%0D%0A
-    public boolean isNotifyEnabled() %7B%0D%0A        return enableNotify;%0D%0A    %7D%0D%0A%0D%0A
     

Update AdvancedOptions.java