summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorJaewan Kim <jaewan@google.com>2016-04-20 21:17:58 +0900
committerJaewan Kim <jaewan@google.com>2016-04-26 13:06:21 +0900
commitf0fd218382b96f052d22a2e8ee00510cc23a6d1e (patch)
tree6f269628812e7b1930ee891d8b43ffe31712b11e /core/java/android
parentaf8be42b9f6aa17c8d17d999b53227f0a1d6da5b (diff)
PIP: Send KEYCODE_WINDOW to app first if PIP isn't exist
Bug: 27954955 Change-Id: I517e378d5c1672ac0eb87bdf4375b7d733276e58
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/View.java7
-rw-r--r--core/java/android/view/Window.java13
2 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index eb895ff7f49c..2fc1187b4977 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3071,6 +3071,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* @hide
*
+ * Whether the TV's picture-in-picture is visible or not.
+ */
+ public static final int TV_PICTURE_IN_PICTURE_VISIBLE = 0x00010000;
+
+ /**
+ * @hide
+ *
* Makes navigation bar transparent (but not the status bar).
*/
public static final int NAVIGATION_BAR_TRANSPARENT = 0x00008000;
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index e3abb5d70031..e598113bb3b1 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -24,6 +24,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StyleRes;
import android.annotation.SystemApi;
+import android.app.ActivityManagerNative;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -1256,6 +1257,18 @@ public abstract class Window {
}
/**
+ * Puts the activity in picture-in-picture mode.
+ * @see android.R.attr#supportsPictureInPicture
+ * @hide
+ */
+ protected void enterPictureInPictureMode() {
+ try {
+ ActivityManagerNative.getDefault().enterPictureInPictureMode(mAppToken);
+ } catch (IllegalArgumentException|RemoteException e) {
+ }
+ }
+
+ /**
* Convenience for
* {@link #setContentView(View, android.view.ViewGroup.LayoutParams)}
* to set the screen content from a layout resource. The resource will be