Merge "Fix recents split-screen icon" into oc-dr1-dev

This commit is contained in:
Jason Monk
2017-07-28 17:02:19 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 6 deletions

View File

@@ -74,8 +74,11 @@ public class DockedStackExistsListener {
private static void onDockedStackExistsChanged(boolean exists) {
synchronized (sCallbacks) {
sCallbacks.removeIf(wf -> wf.get() == null);
sCallbacks.forEach(wf -> wf.get().accept(exists));
sCallbacks.removeIf(wf -> {
Consumer<Boolean> l = wf.get();
if (l != null) l.accept(exists);
return l == null;
});
}
}

View File

@@ -59,6 +59,7 @@ import com.android.systemui.statusbar.policy.KeyButtonDrawable;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.function.Consumer;
public class NavigationBarView extends FrameLayout implements PluginListener<NavGesture> {
final static boolean DEBUG = false;
@@ -564,10 +565,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
getImeSwitchButton().setOnClickListener(mImeSwitcherClickListener);
DockedStackExistsListener.register(exists -> mHandler.post(() -> {
mDockedStackExists = exists;
updateRecentsIcon();
}));
DockedStackExistsListener.register(mDockedListener);
}
void updateRotatedViews() {
@@ -841,4 +839,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
void onVerticalChanged(boolean isVertical);
}
private final Consumer<Boolean> mDockedListener = exists -> mHandler.post(() -> {
mDockedStackExists = exists;
updateRecentsIcon();
});
}