Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1845049c authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Replace Long.compare() with implementation." into ub-launcher3-burnaby-polish

parents 0e32c14a 12fb9fc3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2387,7 +2387,7 @@ public class LauncherModel extends BroadcastReceiver
            Collections.sort(allWorkspaceItems, new Comparator<ItemInfo>() {
                @Override
                public int compare(ItemInfo lhs, ItemInfo rhs) {
                    return Long.compare(lhs.container, rhs.container);
                    return Utilities.longCompare(lhs.container, rhs.container);
                }
            });
            for (ItemInfo info : allWorkspaceItems) {
@@ -2469,7 +2469,7 @@ public class LauncherModel extends BroadcastReceiver
                            lhs.cellY * cellCountX + lhs.cellX);
                    long rr = (rhs.container * containerOffset + rhs.screenId * screenOffset +
                            rhs.cellY * cellCountX + rhs.cellX);
                    return Long.compare(lr, rr);
                    return Utilities.longCompare(lr, rr);
                }
            });
        }
+7 −0
Original line number Diff line number Diff line
@@ -747,4 +747,11 @@ public final class Utilities {
            return msg;
        }
    }

    /**
     * Replacement for Long.compare() which was added in API level 19.
     */
    public static int longCompare(long lhs, long rhs) {
        return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ public class ManagedProfileHeuristic {

            @Override
            public int compare(ShortcutInfo lhs, ShortcutInfo rhs) {
                return Long.compare(lhs.firstInstallTime, rhs.firstInstallTime);
                return Utilities.longCompare(lhs.firstInstallTime, rhs.firstInstallTime);
            }
        });