Correctly detect when switching back from full screen
In full screen mode, the play message can be trigger, that means we can't
assume that the play message only comes from inline mode.
bug:4498120
Change-Id: Ibf85bb74778df207a6ce786dc63b0845356a281c
diff --git a/core/java/android/webkit/HTML5VideoFullScreen.java b/core/java/android/webkit/HTML5VideoFullScreen.java
index 1004b5f..57cda97 100644
--- a/core/java/android/webkit/HTML5VideoFullScreen.java
+++ b/core/java/android/webkit/HTML5VideoFullScreen.java
@@ -199,6 +199,9 @@
mVideoSurfaceView.getHolder().setFixedSize(mVideoWidth, mVideoHeight);
}
+ public boolean fullScreenExited() {
+ return (mLayout == null);
+ }
private final WebChromeClient.CustomViewCallback mCallback =
new WebChromeClient.CustomViewCallback() {
diff --git a/core/java/android/webkit/HTML5VideoView.java b/core/java/android/webkit/HTML5VideoView.java
index 8b92bb0..5983a44 100644
--- a/core/java/android/webkit/HTML5VideoView.java
+++ b/core/java/android/webkit/HTML5VideoView.java
@@ -320,4 +320,9 @@
return false;
}
+ public boolean fullScreenExited() {
+ // Only meaningful for HTML5VideoFullScreen
+ return false;
+ }
+
}
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index aa254d9d..d0237b5 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -173,9 +173,7 @@
boolean backFromFullScreenMode = false;
if (mHTML5VideoView != null) {
currentVideoLayerId = mHTML5VideoView.getVideoLayerId();
- if (mHTML5VideoView instanceof HTML5VideoFullScreen) {
- backFromFullScreenMode = true;
- }
+ backFromFullScreenMode = mHTML5VideoView.fullScreenExited();
}
if (backFromFullScreenMode