Merge "Fix NPE and make getTask return Optional" into ub-launcher3-master
diff --git a/src/com/android/launcher3/util/FlagOp.java b/src/com/android/launcher3/util/FlagOp.java
index a012c86..bd40eb9 100644
--- a/src/com/android/launcher3/util/FlagOp.java
+++ b/src/com/android/launcher3/util/FlagOp.java
@@ -7,7 +7,7 @@
int apply(int flags);
static FlagOp addFlag(int flag) {
- return i -> i + flag;
+ return i -> i | flag;
}
static FlagOp removeFlag(int flag) {
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index 524c69f..2c21f73 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -377,6 +377,7 @@
* Creates a floating icon view for {@param originalView}.
* @param originalView The view to copy
* @param hideOriginal If true, it will hide {@param originalView} while this view is visible.
+ * Else, we will not draw anything in this view.
* @param positionOut Rect that will hold the size and position of v.
* @param isOpening True if this view replaces the icon for app open animation.
*/
@@ -392,14 +393,11 @@
// Get the drawable on the background thread
// Must be called after matchPositionOf so that we know what size to load.
- if (originalView.getTag() instanceof ItemInfo) {
+ if (originalView.getTag() instanceof ItemInfo && hideOriginal) {
view.mLoadIconSignal = new CancellationSignal();
Runnable onIconLoaded = () -> {
// Delay swapping views until the icon is loaded to prevent a flash.
view.setVisibility(VISIBLE);
- if (hideOriginal) {
- originalView.setVisibility(INVISIBLE);
- }
};
CancellationSignal loadIconSignal = view.mLoadIconSignal;
new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(() -> {