From 35ca6c8129209d2f9e57e8630141ddd3943ede02 Mon Sep 17 00:00:00 2001 From: Sean Stout Date: Mon, 25 Jan 2021 19:36:23 -0800 Subject: [PATCH] Add DisplayGroupListener interface This interface can be used to listen for addition, removal, or modification of DisplayGroups. Bug: 138328918 Test: make Change-Id: I3a2f39838ab00808816366d2484190b401aabed0 --- .../display/DisplayManagerInternal.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/core/java/android/hardware/display/DisplayManagerInternal.java b/core/java/android/hardware/display/DisplayManagerInternal.java index 5a03adee4eabd..95f1d124b9a1c 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. + * + *
    + *
  1. The {@code groupId} is applied to all appropriate {@link Display displays}. + *
  2. This method is called. + *
  3. {@link android.hardware.display.DisplayManager.DisplayListener DisplayListeners} + * are informed of any corresponding changes. + *
+ */ + void onDisplayGroupAdded(int groupId); + + /** + * The display group with the provided {@code groupId} was removed. + * + *
    + *
  1. All affected {@link Display displays} have their group IDs updated appropriately. + *
  2. {@link android.hardware.display.DisplayManager.DisplayListener DisplayListeners} + * are informed of any corresponding changes. + *
  3. This method is called. + *
+ */ + void onDisplayGroupRemoved(int groupId); + + /** + * The display group with the provided {@code groupId} has changed. + * + *
    + *
  1. All affected {@link Display displays} have their group IDs updated appropriately. + *
  2. {@link android.hardware.display.DisplayManager.DisplayListener DisplayListeners} + * are informed of any corresponding changes. + *
  3. This method is called. + *
+ */ + void onDisplayGroupChanged(int groupId); + } }