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

Commit ca9c0d42 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Added config_defaultPictureInPictureBounds"

parents 6142f90b d88f651d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2407,4 +2407,7 @@
         that have not requested doing so (via the WindowManager.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
         flag). -->
    <bool name="config_forceWindowDrawsStatusBarBackground">true</bool>

    <!-- Default bounds [left top right bottom] on screen for picture-in-picture windows. -->
    <string translatable="false" name="config_defaultPictureInPictureBounds">"0 0 100 100"</string>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -303,6 +303,7 @@
  <java-symbol type="bool" name="config_supportMicNearUltrasound" />
  <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" />
  <java-symbol type="bool" name="config_freeformWindowManagement" />
  <java-symbol type="string" name="config_defaultPictureInPictureBounds" />
  <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_threshold" />
  <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_factor" />
  <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_penalty_threshold" />
+8 −1
Original line number Diff line number Diff line
@@ -1281,6 +1281,7 @@ public final class ActivityManagerService extends ActivityManagerNative
    boolean mForceResizableActivities;
    boolean mSupportsFreeformWindowManagement;
    boolean mSupportsPictureInPicture;
    Rect mDefaultPinnedStackBounds;
    IActivityController mController = null;
    String mProfileApp = null;
    ProcessRecord mProfileProc = null;
@@ -7224,8 +7225,12 @@ public final class ActivityManagerService extends ActivityManagerNative
                            + "Picture-In-Picture not supported for r=" + r);
                }
                // Use the default launch bounds for pinned stack if it doesn't exist yet.
                final Rect bounds = (mStackSupervisor.getStack(PINNED_STACK_ID) == null)
                        ? mDefaultPinnedStackBounds : null;
                mStackSupervisor.moveActivityToStackLocked(
                        r, PINNED_STACK_ID, "enterPictureInPictureMode", null);
                        r, PINNED_STACK_ID, "enterPictureInPictureMode", bounds);
            }
        } finally {
            Binder.restoreCallingIdentity(origId);
@@ -12102,6 +12107,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                    com.android.internal.R.dimen.thumbnail_width);
            mThumbnailHeight = res.getDimensionPixelSize(
                    com.android.internal.R.dimen.thumbnail_height);
            mDefaultPinnedStackBounds = Rect.unflattenFromString(res.getString(
                    com.android.internal.R.string.config_defaultPictureInPictureBounds));
        }
    }
+2 −2
Original line number Diff line number Diff line
@@ -3635,8 +3635,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
            moveTaskToStackLocked(
                    task.taskId, stackId, ON_TOP, FORCE_FOCUS, reason, true /* animate */);
        } else {
            final ActivityStack pinnedStack = getStack(PINNED_STACK_ID, CREATE_IF_NEEDED, ON_TOP);
            pinnedStack.moveActivityToStack(r);
            final ActivityStack stack = getStack(stackId, CREATE_IF_NEEDED, ON_TOP);
            stack.moveActivityToStack(r);
        }

        if (bounds != null) {