summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorSean Stout <sstout@google.com>2021-01-25 19:36:23 -0800
committerSean Stout <sstout@google.com>2021-01-27 20:42:42 +0000
commit35ca6c8129209d2f9e57e8630141ddd3943ede02 (patch)
tree2cf46eaa30234fc4825c01eb8c538cdec738ee1c /core/java/android
parent1ee021411844abc734ac51dbf88a16a20f0108a2 (diff)
Add DisplayGroupListener interface
This interface can be used to listen for addition, removal, or modification of DisplayGroups. Bug: 138328918 Test: make Change-Id: I3a2f39838ab00808816366d2484190b401aabed0
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/hardware/display/DisplayManagerInternal.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/core/java/android/hardware/display/DisplayManagerInternal.java b/core/java/android/hardware/display/DisplayManagerInternal.java
index 5a03adee4eab..95f1d124b9a1 100644
--- a/core/java/android/hardware/display/DisplayManagerInternal.java
+++ b/core/java/android/hardware/display/DisplayManagerInternal.java
@@ -465,4 +465,46 @@ public abstract class DisplayManagerInternal {
public interface DisplayTransactionListener {
void onDisplayTransaction(Transaction t);
}
+
+ /**
+ * Called when there are changes to {@link com.android.server.display.DisplayGroup
+ * DisplayGroups}.
+ */
+ public interface DisplayGroupListener {
+ /**
+ * A new display group with the provided {@code groupId} was added.
+ *
+ * <ol>
+ * <li>The {@code groupId} is applied to all appropriate {@link Display displays}.
+ * <li>This method is called.
+ * <li>{@link android.hardware.display.DisplayManager.DisplayListener DisplayListeners}
+ * are informed of any corresponding changes.
+ * </ol>
+ */
+ void onDisplayGroupAdded(int groupId);
+
+ /**
+ * The display group with the provided {@code groupId} was removed.
+ *
+ * <ol>
+ * <li>All affected {@link Display displays} have their group IDs updated appropriately.
+ * <li>{@link android.hardware.display.DisplayManager.DisplayListener DisplayListeners}
+ * are informed of any corresponding changes.
+ * <li>This method is called.
+ * </ol>
+ */
+ void onDisplayGroupRemoved(int groupId);
+
+ /**
+ * The display group with the provided {@code groupId} has changed.
+ *
+ * <ol>
+ * <li>All affected {@link Display displays} have their group IDs updated appropriately.
+ * <li>{@link android.hardware.display.DisplayManager.DisplayListener DisplayListeners}
+ * are informed of any corresponding changes.
+ * <li>This method is called.
+ * </ol>
+ */
+ void onDisplayGroupChanged(int groupId);
+ }
}