From 5059bd6b377b9ae9e3058c35613bb5fcdc574eab Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Thu, 22 Apr 2021 12:30:41 -0700 Subject: [PATCH] PiP: API - explain isStashed in more detail. Bug: 185972980 Test: None. Documentation update. Change-Id: I7653a394a9ecdc0c89e65604a466f8448439f8fe --- .../java/android/app/PictureInPictureUiState.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/PictureInPictureUiState.java b/core/java/android/app/PictureInPictureUiState.java index 3d2cb3ffa58de..32ce89ae98cf9 100644 --- a/core/java/android/app/PictureInPictureUiState.java +++ b/core/java/android/app/PictureInPictureUiState.java @@ -42,7 +42,20 @@ public final class PictureInPictureUiState implements Parcelable { } /** - * Returns whether Picture-in-Picture is stashed or not. + * Returns whether Picture-in-Picture is stashed or not. A stashed PiP means it is only + * partially visible to the user, with some parts of it being off-screen. This is usually + * an UI state that is triggered by the user, such as flinging the PiP to the edge or letting go + * of PiP while dragging partially off-screen. + * + * Developers can use this in conjunction with + * {@link Activity#onPictureInPictureUiStateChanged(PictureInPictureUiState)} to get a signal + * when the PiP stash state has changed. For example, if the state changed from {@code false} to + * {@code true}, developers can choose to temporarily pause video playback if PiP is of video + * content. Vice versa, if changing from {@code true} to {@code false} and video content is + * paused, developers can resumevideo playback. + * + * @see + * Picture in Picture (PiP) improvements */ public boolean isStashed() { return mIsStashed;