FileDocCategorySizeDatePackage
GlobalSetting.javaAPI DocAndroid 5.1 API1970Thu Mar 12 22:22:42 GMT 2015com.android.systemui.qs

GlobalSetting

public abstract class GlobalSetting extends android.database.ContentObserver implements com.android.systemui.statusbar.policy.Listenable
Helper for managing a global setting.

Fields Summary
private final android.content.Context
mContext
private final String
mSettingName
Constructors Summary
public GlobalSetting(android.content.Context context, android.os.Handler handler, String settingName)

        super(handler);
        mContext = context;
        mSettingName = settingName;
    
Methods Summary
public intgetValue()

        return Global.getInt(mContext.getContentResolver(), mSettingName, 0);
    
protected abstract voidhandleValueChanged(int value)

public voidonChange(boolean selfChange)

        handleValueChanged(getValue());
    
public voidsetListening(boolean listening)

        if (listening) {
            mContext.getContentResolver().registerContentObserver(
                    Global.getUriFor(mSettingName), false, this);
        } else {
            mContext.getContentResolver().unregisterContentObserver(this);
        }
    
public voidsetValue(int value)

        Global.putInt(mContext.getContentResolver(), mSettingName, value);