summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorMariia Sandrikova <mariiasand@google.com>2021-09-17 22:18:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-09-17 22:18:30 +0000
commitc3c2b146d666758b2cdc0d83e63920ad482e7b5b (patch)
treeed581ed862d0c3a6df2b881a133afb99ecc28c5f /core/java/android
parentaaca770cd7577082ab690762a0c624a58383f610 (diff)
parentaca03a172ccbdd7f3f0f2a9a036d4fb0238b5503 (diff)
Merge "[2/n] Display stack provides DisplayInfos" into sc-v2-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/hardware/devicestate/DeviceStateManagerInternal.java28
-rw-r--r--core/java/android/hardware/display/DisplayManagerInternal.java9
-rw-r--r--core/java/android/view/WindowManagerImpl.java4
3 files changed, 39 insertions, 2 deletions
diff --git a/core/java/android/hardware/devicestate/DeviceStateManagerInternal.java b/core/java/android/hardware/devicestate/DeviceStateManagerInternal.java
new file mode 100644
index 000000000000..4c91c160f891
--- /dev/null
+++ b/core/java/android/hardware/devicestate/DeviceStateManagerInternal.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.devicestate;
+
+/**
+ * Device state manager local system service interface.
+ *
+ * @hide Only for use within the system server.
+ */
+public abstract class DeviceStateManagerInternal {
+
+ /** Returns the list of currently supported device state identifiers. */
+ public abstract int[] getSupportedStateIdentifiers();
+}
diff --git a/core/java/android/hardware/display/DisplayManagerInternal.java b/core/java/android/hardware/display/DisplayManagerInternal.java
index 4f205530ef0d..5bb51c19342d 100644
--- a/core/java/android/hardware/display/DisplayManagerInternal.java
+++ b/core/java/android/hardware/display/DisplayManagerInternal.java
@@ -35,6 +35,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
import java.util.Objects;
+import java.util.Set;
/**
* Display manager local system service interface.
@@ -129,6 +130,14 @@ public abstract class DisplayManagerInternal {
public abstract DisplayInfo getDisplayInfo(int displayId);
/**
+ * Returns a set of DisplayInfo, for the states that may be assumed by either the given display,
+ * or any other display within that display's group.
+ *
+ * @param displayId The logical display id to fetch DisplayInfo for.
+ */
+ public abstract Set<DisplayInfo> getPossibleDisplayInfo(int displayId);
+
+ /**
* Returns the position of the display's projection.
*
* @param displayId The logical display id.
diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java
index 0fc6b08ae02b..7631269d9c1c 100644
--- a/core/java/android/view/WindowManagerImpl.java
+++ b/core/java/android/view/WindowManagerImpl.java
@@ -374,8 +374,8 @@ public final class WindowManagerImpl implements WindowManager {
currentDisplayInfo = possibleDisplayInfos.get(i);
// Calculate max bounds for this rotation and state.
- Rect maxBounds = new Rect(0, 0, currentDisplayInfo.getNaturalWidth(),
- currentDisplayInfo.getNaturalHeight());
+ Rect maxBounds = new Rect(0, 0, currentDisplayInfo.logicalWidth,
+ currentDisplayInfo.logicalHeight);
// Calculate insets for the rotated max bounds.
// TODO(181127261) calculate insets for each display rotation and state.