Merge changes I20bdab1b,Id82f9081 into oc-dev

* changes:
  Fix backwards flag causing crash.
  Fixing issue with PiP aspect ratio being clobbered.
This commit is contained in:
Winson Chung
2017-06-16 21:32:39 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 2 deletions

View File

@@ -1244,7 +1244,7 @@ public class ActivityOptions {
// Once we parcel the thumbnail for transfering over to the system, create a copy of
// the bitmap to a hardware bitmap and pass through the GraphicBuffer
if (mThumbnail != null) {
final Bitmap hwBitmap = mThumbnail.copy(Config.HARDWARE, true /* immutable */);
final Bitmap hwBitmap = mThumbnail.copy(Config.HARDWARE, false /* isMutable */);
if (hwBitmap != null) {
b.putParcelable(KEY_ANIM_THUMBNAIL, hwBitmap.createGraphicBufferHandle());
} else {

View File

@@ -155,6 +155,10 @@ class PinnedStackController {
mSnapAlgorithm = new PipSnapAlgorithm(service.mContext);
mDisplayInfo.copyFrom(mDisplayContent.getDisplayInfo());
reloadResources();
// Initialize the aspect ratio to the default aspect ratio. Don't do this in reload
// resources as it would clobber mAspectRatio when entering PiP from fullscreen which
// triggers a configuration change and the resources to be reloaded.
mAspectRatio = mDefaultAspectRatio;
}
void onConfigurationChanged() {
@@ -171,7 +175,6 @@ class PinnedStackController {
mCurrentMinSize = mDefaultMinSize;
mDefaultAspectRatio = res.getFloat(
com.android.internal.R.dimen.config_pictureInPictureDefaultAspectRatio);
mAspectRatio = mDefaultAspectRatio;
final String screenEdgeInsetsDpString = res.getString(
com.android.internal.R.string.config_defaultPictureInPictureScreenEdgeInsets);
final Size screenEdgeInsetsDp = !screenEdgeInsetsDpString.isEmpty()