File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11
22package android .webkit ;
33
4+ import android .Manifest .permission ;
5+ import android .content .pm .PackageManager ;
46import android .graphics .SurfaceTexture ;
57import android .media .MediaPlayer ;
68import android .webkit .HTML5VideoView ;
@@ -52,7 +54,12 @@ public void decideDisplayMode() {
5254 public void prepareDataAndDisplayMode (HTML5VideoViewProxy proxy ) {
5355 super .prepareDataAndDisplayMode (proxy );
5456 setFrameAvailableListener (proxy );
55- mPlayer .setWakeMode (proxy .getContext (), PowerManager .FULL_WAKE_LOCK );
57+ // TODO: This is a workaround, after b/5375681 fixed, we should switch
58+ // to the better way.
59+ if (mProxy .getContext ().checkCallingOrSelfPermission (permission .WAKE_LOCK )
60+ == PackageManager .PERMISSION_GRANTED ) {
61+ mPlayer .setWakeMode (proxy .getContext (), PowerManager .FULL_WAKE_LOCK );
62+ }
5663 }
5764
5865 // Pause the play and update the play/pause button
You can’t perform that action at this time.
0 commit comments