summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-06-11 07:53:06 -0700
committerCraig Mautner <cmautner@google.com>2013-06-22 15:30:13 -0700
commit48d0d1886731ff19ed3fb47a5997be5df0d1bba8 (patch)
tree5e0b5e9bc6899bf5c772a4ebab5b8df4015411cd /core/java/android/hardware
parentb1c5945a5598263fe63f3d665f575ba736eb26d2 (diff)
downloadframeworks_base-48d0d1886731ff19ed3fb47a5997be5df0d1bba8.zip
frameworks_base-48d0d1886731ff19ed3fb47a5997be5df0d1bba8.tar.gz
frameworks_base-48d0d1886731ff19ed3fb47a5997be5df0d1bba8.tar.bz2
Add activity token to display system.
First step in adding activity specific information to displays. Replace CompatibilityInfoHolder with DisplayAdjustmentsHolder that holds an activity token in addition to the CompatibilityInfo. Change-Id: Ie113cd8dd9c62e0b5311204e039a4829096bea68
Diffstat (limited to 'core/java/android/hardware')
-rw-r--r--core/java/android/hardware/display/DisplayManager.java2
-rw-r--r--core/java/android/hardware/display/DisplayManagerGlobal.java23
2 files changed, 18 insertions, 7 deletions
diff --git a/core/java/android/hardware/display/DisplayManager.java b/core/java/android/hardware/display/DisplayManager.java
index dcf50cd..9e2e4ba 100644
--- a/core/java/android/hardware/display/DisplayManager.java
+++ b/core/java/android/hardware/display/DisplayManager.java
@@ -159,7 +159,7 @@ public final class DisplayManager {
Display display = mDisplays.get(displayId);
if (display == null) {
display = mGlobal.getCompatibleDisplay(displayId,
- mContext.getCompatibilityInfo(displayId));
+ mContext.getDisplayAdjustments(displayId));
if (display != null) {
mDisplays.put(displayId, display);
}
diff --git a/core/java/android/hardware/display/DisplayManagerGlobal.java b/core/java/android/hardware/display/DisplayManagerGlobal.java
index 3ab882d..320185d 100644
--- a/core/java/android/hardware/display/DisplayManagerGlobal.java
+++ b/core/java/android/hardware/display/DisplayManagerGlobal.java
@@ -28,7 +28,7 @@ import android.os.ServiceManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
-import android.view.CompatibilityInfoHolder;
+import android.view.DisplayAdjustments;
import android.view.Display;
import android.view.DisplayInfo;
import android.view.Surface;
@@ -164,18 +164,18 @@ public final class DisplayManagerGlobal {
* Gets information about a logical display.
*
* The display metrics may be adjusted to provide compatibility
- * for legacy applications.
+ * for legacy applications or limited screen areas.
*
* @param displayId The logical display id.
- * @param cih The compatibility info, or null if none is required.
+ * @param daj The compatibility info and activityToken.
* @return The display object, or null if there is no display with the given id.
*/
- public Display getCompatibleDisplay(int displayId, CompatibilityInfoHolder cih) {
+ public Display getCompatibleDisplay(int displayId, DisplayAdjustments daj) {
DisplayInfo displayInfo = getDisplayInfo(displayId);
if (displayInfo == null) {
return null;
}
- return new Display(this, displayId, displayInfo, cih);
+ return new Display(this, displayId, displayInfo, daj);
}
/**
@@ -185,7 +185,18 @@ public final class DisplayManagerGlobal {
* @return The display object, or null if there is no display with the given id.
*/
public Display getRealDisplay(int displayId) {
- return getCompatibleDisplay(displayId, null);
+ return getCompatibleDisplay(displayId, DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS);
+ }
+
+ /**
+ * Gets information about a logical display without applying any compatibility metrics.
+ *
+ * @param displayId The logical display id.
+ * @param IBinder the activity token for this display.
+ * @return The display object, or null if there is no display with the given id.
+ */
+ public Display getRealDisplay(int displayId, IBinder token) {
+ return getCompatibleDisplay(displayId, new DisplayAdjustments(token));
}
public void registerDisplayListener(DisplayListener listener, Handler handler) {