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
--- 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();