Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2daccc61 authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

Merge "Set isInPictureInPictureMode earlier" into rvc-dev am: 3da602b6

Change-Id: I89a8d641a1b5176904c0a47390620a5a81a6442f
parents b0c1e67c 3da602b6
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -2838,7 +2838,13 @@ public class Activity extends ContextThemeWrapper
                throw new IllegalStateException("Activity must be resumed to enter"
                throw new IllegalStateException("Activity must be resumed to enter"
                        + " picture-in-picture");
                        + " picture-in-picture");
            }
            }
            return ActivityTaskManager.getService().enterPictureInPictureMode(mToken, params);
            // Set mIsInPictureInPictureMode earlier and don't wait for
            // onPictureInPictureModeChanged callback here. This is to ensure that
            // isInPictureInPictureMode returns true in the following onPause callback.
            // See https://developer.android.com/guide/topics/ui/picture-in-picture for guidance.
            mIsInPictureInPictureMode = ActivityTaskManager.getService().enterPictureInPictureMode(
                    mToken, params);
            return mIsInPictureInPictureMode;
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            return false;
            return false;
        }
        }