改frameworks\base\libs\WindowManager\Shell\src\com\android\wm\shell\pip\PipBoundsAlgorithm.java中private void reloadResources(Context context)中的
mDefaultStackGravity = res.getInteger(
com.android.internal.R.integer.config_defaultPictureInPictureGravity);
frameworks\base\libs\WindowManager\Shell\res\values\config.xml
<!-- The default gravity for the picture-in-picture window.
Currently, this maps to Gravity.BOTTOM | Gravity.RIGHT 0x55-->
<integer name="config_defaultPictureInPictureGravity">0x15</integer>
0x55改为0x15即可让默认显示 右边 垂直居中 Gravity.CENTER_VERTICAL | Gravity.RIGHT