diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 315096c841..afa18a5123 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -1163,7 +1163,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, public void applyDotState(ItemInfo itemInfo, boolean animate) { - if (mIcon instanceof FastBitmapDrawable) { + if (mIcon != null) { boolean wasDotted = mDotInfo != null; mDotInfo = mActivity.getDotInfoForItem(itemInfo); boolean isDotted = mDotInfo != null; diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 86c49d0e47..97c0d9a8dd 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1771,7 +1771,7 @@ public class Workspace extends PagedView } final DragView dv; - if (contentView instanceof View) { + if (contentView != null) { dv = mDragController.startDrag( contentView, draggableView, diff --git a/src/com/android/launcher3/search/StringMatcherUtility.java b/src/com/android/launcher3/search/StringMatcherUtility.java index 7446314296..20b4d0b08a 100644 --- a/src/com/android/launcher3/search/StringMatcherUtility.java +++ b/src/com/android/launcher3/search/StringMatcherUtility.java @@ -127,17 +127,17 @@ public class StringMatcherUtility { if (query == null || target == null) { return false; } - switch (mCollator.compare(query, target)) { - case 0: - return true; - case -1: - // The target string can contain a modifier which would make it larger than - // the query string (even though the length is same). If the query becomes - // larger after appending a unicode character, it was originally a prefix of - // the target string and hence should match. - return mCollator.compare(query + MAX_UNICODE, target) > -1; - default: - return false; + int compare = mCollator.compare(query, target); + if (compare == 0) { + return true; + } else if (compare < 0) { + // The target string can contain a modifier which would make it larger than + // the query string (even though the length is same). If the query becomes + // larger after appending a unicode character, it was originally a prefix of + // the target string and hence should match. + return mCollator.compare(query + MAX_UNICODE, target) >= 0; + } else { + return false; } }