Loading core/java/android/app/Fragment.java +4 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ final class FragmentState implements Parcelable { } mInstance.setIndex(mIndex); mInstance.mFromLayout = mFromLayout; mInstance.mRestored = true; mInstance.mFragmentId = mFragmentId; mInstance.mContainerId = mContainerId; mInstance.mTag = mTag; Loading Loading @@ -363,6 +364,9 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener // Set to true when the view has actually been inflated in its layout. boolean mInLayout; // True if this fragment has been restored from previously saved state. boolean mRestored; // Number of active back stack entries this fragment is in. int mBackStackNesting; Loading core/java/android/app/FragmentManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -690,7 +690,7 @@ final class FragmentManagerImpl extends FragmentManager { ViewGroup container = null; if (f.mContainerId != 0) { container = (ViewGroup)mActivity.findViewById(f.mContainerId); if (container == null) { if (container == null && !f.mRestored) { throw new IllegalArgumentException("No view found for id 0x" + Integer.toHexString(f.mContainerId) + " for fragment " + f); Loading services/java/com/android/server/ScreenRotationAnimation.java +68 −46 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ class ScreenRotationAnimation { final Context mContext; final Display mDisplay; Surface mSurface; Surface mBlackSurface; int mWidth, mHeight; int mSnapshotRotation; Loading Loading @@ -84,19 +85,30 @@ class ScreenRotationAnimation { mOriginalHeight = mDisplayMetrics.heightPixels; Surface.openTransaction(); if (mSurface != null) { mSurface.destroy(); mSurface = null; } try { mSurface = new Surface(session, 0, "FreezeSurface", -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to allocate freeze surface", e); } mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); if (false) { try { int size = mOriginalWidth > mOriginalHeight ? mOriginalWidth : mOriginalHeight; mBlackSurface = new Surface(session, 0, "BlackSurface", -1, size, size, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM); mBlackSurface.setAlpha(1.0f); mBlackSurface.setLayer(0); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to allocate black surface", e); } } setRotation(display.getRotation()); if (mSurface != null) { Rect dirty = new Rect(0, 0, mWidth, mHeight); Canvas c = null; try { Loading @@ -120,6 +132,8 @@ class ScreenRotationAnimation { } mSurface.unlockCanvasAndPost(c); } Surface.closeTransaction(); if (screenshot != null) { Loading @@ -134,6 +148,7 @@ class ScreenRotationAnimation { } void setSnapshotTransform(Matrix matrix, float alpha) { if (mSurface != null) { matrix.getValues(mTmpFloats); mSurface.setPosition((int)mTmpFloats[Matrix.MTRANS_X], (int)mTmpFloats[Matrix.MTRANS_Y]); Loading @@ -151,6 +166,7 @@ class ScreenRotationAnimation { + ")-(" + dstPnts[2] + "," + dstPnts[3] + ")"); } } } public static void createRotationMatrix(int rotation, int width, int height, Matrix outMatrix) { Loading Loading @@ -254,6 +270,10 @@ class ScreenRotationAnimation { mSurface.destroy(); mSurface = null; } if (mBlackSurface != null) { mBlackSurface.destroy(); mBlackSurface = null; } if (mExitAnimation != null) { mExitAnimation.cancel(); mExitAnimation = null; Loading Loading @@ -293,6 +313,10 @@ class ScreenRotationAnimation { mSurface.destroy(); mSurface = null; } if (mBlackSurface != null) { mBlackSurface.destroy(); mBlackSurface = null; } } } Loading @@ -307,10 +331,8 @@ class ScreenRotationAnimation { } } if (mSurface != null) { mSnapshotFinalMatrix.setConcat(mExitTransformation.getMatrix(), mSnapshotInitialMatrix); setSnapshotTransform(mSnapshotFinalMatrix, mExitTransformation.getAlpha()); } return moreEnter || moreExit; } Loading Loading
core/java/android/app/Fragment.java +4 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,7 @@ final class FragmentState implements Parcelable { } mInstance.setIndex(mIndex); mInstance.mFromLayout = mFromLayout; mInstance.mRestored = true; mInstance.mFragmentId = mFragmentId; mInstance.mContainerId = mContainerId; mInstance.mTag = mTag; Loading Loading @@ -363,6 +364,9 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener // Set to true when the view has actually been inflated in its layout. boolean mInLayout; // True if this fragment has been restored from previously saved state. boolean mRestored; // Number of active back stack entries this fragment is in. int mBackStackNesting; Loading
core/java/android/app/FragmentManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -690,7 +690,7 @@ final class FragmentManagerImpl extends FragmentManager { ViewGroup container = null; if (f.mContainerId != 0) { container = (ViewGroup)mActivity.findViewById(f.mContainerId); if (container == null) { if (container == null && !f.mRestored) { throw new IllegalArgumentException("No view found for id 0x" + Integer.toHexString(f.mContainerId) + " for fragment " + f); Loading
services/java/com/android/server/ScreenRotationAnimation.java +68 −46 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ class ScreenRotationAnimation { final Context mContext; final Display mDisplay; Surface mSurface; Surface mBlackSurface; int mWidth, mHeight; int mSnapshotRotation; Loading Loading @@ -84,19 +85,30 @@ class ScreenRotationAnimation { mOriginalHeight = mDisplayMetrics.heightPixels; Surface.openTransaction(); if (mSurface != null) { mSurface.destroy(); mSurface = null; } try { mSurface = new Surface(session, 0, "FreezeSurface", -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to allocate freeze surface", e); } mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); if (false) { try { int size = mOriginalWidth > mOriginalHeight ? mOriginalWidth : mOriginalHeight; mBlackSurface = new Surface(session, 0, "BlackSurface", -1, size, size, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM); mBlackSurface.setAlpha(1.0f); mBlackSurface.setLayer(0); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to allocate black surface", e); } } setRotation(display.getRotation()); if (mSurface != null) { Rect dirty = new Rect(0, 0, mWidth, mHeight); Canvas c = null; try { Loading @@ -120,6 +132,8 @@ class ScreenRotationAnimation { } mSurface.unlockCanvasAndPost(c); } Surface.closeTransaction(); if (screenshot != null) { Loading @@ -134,6 +148,7 @@ class ScreenRotationAnimation { } void setSnapshotTransform(Matrix matrix, float alpha) { if (mSurface != null) { matrix.getValues(mTmpFloats); mSurface.setPosition((int)mTmpFloats[Matrix.MTRANS_X], (int)mTmpFloats[Matrix.MTRANS_Y]); Loading @@ -151,6 +166,7 @@ class ScreenRotationAnimation { + ")-(" + dstPnts[2] + "," + dstPnts[3] + ")"); } } } public static void createRotationMatrix(int rotation, int width, int height, Matrix outMatrix) { Loading Loading @@ -254,6 +270,10 @@ class ScreenRotationAnimation { mSurface.destroy(); mSurface = null; } if (mBlackSurface != null) { mBlackSurface.destroy(); mBlackSurface = null; } if (mExitAnimation != null) { mExitAnimation.cancel(); mExitAnimation = null; Loading Loading @@ -293,6 +313,10 @@ class ScreenRotationAnimation { mSurface.destroy(); mSurface = null; } if (mBlackSurface != null) { mBlackSurface.destroy(); mBlackSurface = null; } } } Loading @@ -307,10 +331,8 @@ class ScreenRotationAnimation { } } if (mSurface != null) { mSnapshotFinalMatrix.setConcat(mExitTransformation.getMatrix(), mSnapshotInitialMatrix); setSnapshotTransform(mSnapshotFinalMatrix, mExitTransformation.getAlpha()); } return moreEnter || moreExit; } Loading