package cc.cubone.turbo.persistence;

import android.content.Context;

public class PrefAllApps extends Pref {

    public static final int LAYOUT_LIST = 0;
    public static final int LAYOUT_GRID = 1;

    public static final int FLAG_DISPLAY_SYSTEM = 0x00000001;
    public static final int FLAG_DISPLAY_USER = FLAG_DISPLAY_SYSTEM<<1;

    public static final int FLAG_DISPLAY_STOPPED = 0x00000100;
    public static final int FLAG_DISPLAY_RUNNING = FLAG_DISPLAY_STOPPED<<1;

    static final String KEY_LAYOUT = "layout";
    static final String KEY_DISPLAY_FLAGS = "display_flags";

    public PrefAllApps(Context context) {
        super(context, "all_apps");
    }

    public int getLayout() {
        return mSp.getInt(KEY_LAYOUT, LAYOUT_LIST);
    }

    public void setLayout(int layout) {
        mSp.edit().putInt(KEY_LAYOUT, layout).apply();
    }

    public int getDisplayFlags() {
        return mSp.getInt(KEY_DISPLAY_FLAGS, FLAG_DISPLAY_USER
                | FLAG_DISPLAY_STOPPED
                | FLAG_DISPLAY_RUNNING);
    }

    public void setDisplayFlags(int displayFlags) {
        mSp.edit().putInt(KEY_DISPLAY_FLAGS, displayFlags).apply();
    }
}

@@ -50,65 +50,552 @@
 oid.
-content.Context;%0A%0Apublic class PrefAllApps extends Pref %7B
+annotation.SuppressLint;%0Aimport android.content.Context;%0Aimport android.support.annotation.IntDef;%0A%0Aimport java.lang.annotation.Retention;%0Aimport java.lang.annotation.RetentionPolicy;%0A%0Apublic class PrefAllApps extends Pref %7B%0A%0A    @IntDef(%7BLAYOUT_LIST, LAYOUT_GRID%7D)%0A    @Retention(RetentionPolicy.SOURCE)%0A    public @interface Layout %7B%7D%0A%0A    @IntDef(flag = true, value = %7BFLAG_DISPLAY_SYSTEM, FLAG_DISPLAY_USER,%0A            FLAG_DISPLAY_STOPPED, FLAG_DISPLAY_RUNNING%7D)%0A    @Retention(RetentionPolicy.SOURCE)%0A    public @interface FlagDisplay %7B%7D
 %0A%0A  
@@ -814,24 +814,56 @@
 SYSTEM%3C%3C1;%0A%0A
+    @SuppressLint(%22ShiftFlags%22)%0A
     public s
@@ -1176,32 +1176,82 @@
 _apps%22);%0A    %7D%0A%0A
+    @SuppressWarnings(%22ResourceType%22)%0A    @Layout%0A
     public int g
@@ -1348,16 +1348,24 @@
 tLayout(
+@Layout 
 int layo
@@ -1424,32 +1424,87 @@
 apply();%0A    %7D%0A%0A
+    @SuppressWarnings(%22ResourceType%22)%0A    @FlagDisplay%0A
     public int g
@@ -1704,16 +1704,29 @@
 ayFlags(
+@FlagDisplay 
 int disp

add annotation for static int