Buffering in full screen mode will show progressView

bug:4187252
Change-Id: Ieb7ae26b5bfa9abc79556e2fc063b7e3ef17ab52
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java
index 0ee1566..14157c2 100644
--- a/core/java/android/webkit/HTML5VideoViewProxy.java
+++ b/core/java/android/webkit/HTML5VideoViewProxy.java
@@ -95,8 +95,10 @@
         // identify the exact layer on the UI thread to use the SurfaceTexture.
         private static int mBaseLayer = 0;
 
-        // This is true only when the player is buffering and paused
-        private static boolean mPlayerBuffering = false;
+        private static void setPlayerBuffering(boolean playerBuffering) {
+            mHTML5VideoView.setPlayerBuffering(playerBuffering);
+        }
+
         // Every time webView setBaseLayer, this will be called.
         // When we found the Video layer, then we set the Surface Texture to it.
         // Otherwise, we may want to delete the Surface Texture to save memory.
@@ -111,7 +113,7 @@
                 int currentVideoLayerId = mHTML5VideoView.getVideoLayerId();
                 if (layer != 0 && surfTexture != null && currentVideoLayerId != -1) {
                     int playerState = mHTML5VideoView.getCurrentState();
-                    if (mPlayerBuffering)
+                    if (mHTML5VideoView.getPlayerBuffering())
                         playerState = HTML5VideoView.STATE_NOTPREPARED;
                     boolean foundInTree = nativeSendSurfaceTexture(surfTexture,
                             layer, currentVideoLayerId, textureName,
@@ -166,7 +168,6 @@
                 WebChromeClient client, int videoLayerId) {
             int currentVideoLayerId = -1;
             boolean backFromFullScreenMode = false;
-            mPlayerBuffering = false;
             if (mHTML5VideoView != null) {
                 currentVideoLayerId = mHTML5VideoView.getVideoLayerId();
                 if (mHTML5VideoView instanceof HTML5VideoFullScreen) {
@@ -231,7 +232,6 @@
         }
 
         public static void onPrepared() {
-            mPlayerBuffering = false;
             // The VideoView will decide whether to really kick off to play.
             mHTML5VideoView.start();
             if (mBaseLayer != 0) {
@@ -350,11 +350,11 @@
                 break;
             }
             case BUFFERING_START: {
-                VideoPlayer.mPlayerBuffering = true;
+                VideoPlayer.setPlayerBuffering(true);
                 break;
             }
             case BUFFERING_END: {
-                VideoPlayer.mPlayerBuffering = false;
+                VideoPlayer.setPlayerBuffering(false);
                 break;
             }
         }