diff options
Diffstat (limited to 'core/java/android/app/ActivityView.java')
| -rw-r--r-- | core/java/android/app/ActivityView.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityView.java b/core/java/android/app/ActivityView.java index 8ec5e3a43218..0ccaf62d45b2 100644 --- a/core/java/android/app/ActivityView.java +++ b/core/java/android/app/ActivityView.java @@ -19,6 +19,7 @@ package android.app; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC; +import static android.view.Display.INVALID_DISPLAY; import android.annotation.NonNull; import android.annotation.TestApi; @@ -377,6 +378,16 @@ public class ActivityView extends ViewGroup { } /** + * @return the display id of the virtual display. + */ + public int getVirtualDisplayId() { + if (mVirtualDisplay != null) { + return mVirtualDisplay.getDisplay().getDisplayId(); + } + return INVALID_DISPLAY; + } + + /** * Injects a pair of down/up key events with keycode {@link KeyEvent#KEYCODE_BACK} to the * virtual display. */ |
