Files
lawnchair/src/com/android/launcher3/util/FlagOp.java
Sunny Goyal 3bbbabc54a Fixing model being updated on UI thread
> When package gets unavailable or suspended, the disabled flag was getting
updated on the UI thread. This could lead to inconsistent model if launcher
activity didn't exist.
> Fixing: When unsuspending one work profile apps, all work profile apps get
unsuspended

Bug: 27673573,27673373,27403236
Change-Id: I7fde3f79c36204e73ca66ccf8431fa0f0cce3d08
2016-03-18 15:13:28 -07:00

31 lines
641 B
Java

package com.android.launcher3.util;
public abstract class FlagOp {
public static FlagOp NO_OP = new FlagOp() {};
private FlagOp() {}
public int apply(int flags) {
return flags;
}
public static FlagOp addFlag(final int flag) {
return new FlagOp() {
@Override
public int apply(int flags) {
return flags | flag;
}
};
}
public static FlagOp removeFlag(final int flag) {
return new FlagOp() {
@Override
public int apply(int flags) {
return flags & ~flag;
}
};
}
}