Bug 1480083 - After exiting PIP the restarted activity should have device's orientation; r=sdaswani a=pascalc
authorPetru Lingurar <petru.lingurar@softvision.ro>
Tue, 04 Sep 2018 16:14:30 +0000
changeset 489778 093d1a92ce0856127a2b49039a9a4e07f5e147ed
parent 489777 a3c9db6957bde0a0b6ffc39c817d0e00215430ab
child 489779 151237fbc3d264f61db1b1f289bc635050e72b91
push id9773
push userdvarga@mozilla.com
push dateMon, 10 Sep 2018 11:38:24 +0000
treeherdermozilla-beta@a11b319df87e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssdaswani, pascalc
bugs1480083
milestone63.0
Bug 1480083 - After exiting PIP the restarted activity should have device's orientation; r=sdaswani a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D4939
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -1079,16 +1079,20 @@ public class BrowserApp extends GeckoApp
                 final boolean userReturnedToFullApp = !isApplicationInBackground();
 
                 // After returning from Picture-in-picture mode the video will still be playing
                 // in fullscreen. But now we have the status bar showing.
                 // Call setFullscreen(..) to hide it and offer the same fullscreen video experience
                 // that the user had before entering in Picture-in-picture mode.
                 if (userReturnedToFullApp) {
                     ActivityUtils.setFullScreen(this, true);
+                } else {
+                    // User closed the PIP mode.
+                    // Make sure that after restarting, the activity will match device's orientation.
+                    setRequestedOrientationForCurrentActivity(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
                 }
             }
         }
     }
 
     @Override
     public void onRestart() {
         super.onRestart();