Migrate to using DefaultDisplay

- Remove extra binder calls to get the default display

Bug: 140633033
Change-Id: I532645deac101a6065d90484b87a67b67aa717f5
This commit is contained in:
Winson Chung committed 2019-09-09 10:21:28 -07:00
1 parent 72fddba837
commit 13c1c2cd65
10 files changed
+64 -88

No files matched your search

+4 -3
View File
@@ -24,12 +24,12 @@ import android.graphics.PointF;
import android.graphics.Rect;
import android.util.DisplayMetrics;
import android.view.Surface;
import android.view.WindowManager;
import com.android.launcher3.CellLayout.ContainerType;
import com.android.launcher3.graphics.IconShape;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.icons.IconNormalizer;
import com.android.launcher3.util.DefaultDisplay;
public class DeviceProfile {
@@ -544,9 +544,10 @@ public class DeviceProfile {
/**
* Updates orientation information and returns true if it has changed from the previous value.
*/
public boolean updateIsSeascape(WindowManager wm) {
public boolean updateIsSeascape(Context context) {
if (isVerticalBarLayout()) {
boolean isSeascape = wm.getDefaultDisplay().getRotation() == Surface.ROTATION_270;
boolean isSeascape = DefaultDisplay.INSTANCE.get(context).getInfo().rotation
== Surface.ROTATION_270;
if (mIsSeascape != isSeascape) {
mIsSeascape = isSeascape;
return true;