diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 257e46c..dbefa45 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -40,6 +40,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 
 import androidx.annotation.VisibleForTesting;
 
@@ -135,7 +136,7 @@
         float minWidthDps = Utilities.dpiFromPx(Math.min(smallestSize.x, smallestSize.y), dm);
         float minHeightDps = Utilities.dpiFromPx(Math.min(largestSize.x, largestSize.y), dm);
         // Sort the profiles based on the closeness to the device size
-        allOptions.sort((a, b) ->
+        Collections.sort(allOptions, (a, b) ->
                 Float.compare(dist(minWidthDps, minHeightDps, a.minWidthDps, a.minHeightDps),
                         dist(minWidthDps, minHeightDps, b.minWidthDps, b.minHeightDps)));
         DisplayOption interpolatedDisplayOption =
@@ -314,18 +315,6 @@
         return (float) Math.hypot(x1 - x0, y1 - y0);
     }
 
-    /**
-     * Returns the closest device profiles ordered by closeness to the specified width and height
-     */
-    @VisibleForTesting
-    static ArrayList<DisplayOption> sortByClosenessToSize(
-            float width, float height, ArrayList<DisplayOption> points) {
-        points.sort((a, b) ->
-                Float.compare(dist(width, height, a.minWidthDps, a.minHeightDps),
-                        dist(width, height, b.minWidthDps, b.minHeightDps)));
-        return points;
-    }
-
     @VisibleForTesting
     static DisplayOption invDistWeightedInterpolate(float width, float height,
                 ArrayList<DisplayOption> points) {
