Loading core/java/android/service/wallpaper/WallpaperService.java +9 −2 Original line number Diff line number Diff line Loading @@ -278,6 +278,7 @@ public abstract class WallpaperService extends Service { private Display mDisplay; private Context mDisplayContext; private int mDisplayState; private @Surface.Rotation int mDisplayInstallOrientation; private float mWallpaperDimAmount = 0.05f; private float mPreviousWallpaperDimAmount = mWallpaperDimAmount; private float mDefaultDimAmount = mWallpaperDimAmount; Loading Loading @@ -1122,6 +1123,11 @@ public abstract class WallpaperService extends Service { mWindow, mLayout, mWidth, mHeight, View.VISIBLE, 0, -1, mWinFrames, mMergedConfiguration, mSurfaceControl, mInsetsState, mTempControls, mSurfaceSize); final int transformHint = SurfaceControl.rotationToBufferTransform( (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); mSurfaceControl.setTransformHint(transformHint); if (mSurfaceControl.isValid()) { if (mBbqSurfaceControl == null) { mBbqSurfaceControl = new SurfaceControl.Builder() Loading @@ -1135,9 +1141,9 @@ public abstract class WallpaperService extends Service { .build(); updateSurfaceDimming(); } // Propagate transform hint from WM so we can use the right hint for the // Propagate transform hint from WM, so we can use the right hint for the // first frame. mBbqSurfaceControl.setTransformHint(mSurfaceControl.getTransformHint()); mBbqSurfaceControl.setTransformHint(transformHint); Surface blastSurface = getOrCreateBLASTSurface(mSurfaceSize.x, mSurfaceSize.y, mFormat); // If blastSurface == null that means it hasn't changed since the last Loading Loading @@ -1377,6 +1383,7 @@ public abstract class WallpaperService extends Service { mWallpaperDimAmount = mDefaultDimAmount; mPreviousWallpaperDimAmount = mWallpaperDimAmount; mDisplayState = mDisplay.getState(); mDisplayInstallOrientation = mDisplay.getInstallOrientation(); if (DEBUG) Log.v(TAG, "onCreate(): " + this); onCreate(mSurfaceHolder); Loading core/java/android/view/Display.java +12 −0 Original line number Diff line number Diff line Loading @@ -927,6 +927,18 @@ public final class Display { } } /** * Returns the install orientation of the display. * @hide */ @Surface.Rotation public int getInstallOrientation() { synchronized (mLock) { updateDisplayInfoLocked(); return mDisplayInfo.installOrientation; } } /** * @deprecated use {@link #getRotation} * @return orientation of this display. Loading core/java/android/view/ViewRootImpl.java +7 −1 Original line number Diff line number Diff line Loading @@ -398,6 +398,8 @@ public final class ViewRootImpl implements ViewParent, final DisplayManager mDisplayManager; final String mBasePackageName; private @Surface.Rotation int mDisplayInstallOrientation; final int[] mTmpLocation = new int[2]; final TypedValue mTmpValue = new TypedValue(); Loading Loading @@ -1028,6 +1030,7 @@ public final class ViewRootImpl implements ViewParent, mView = view; mAttachInfo.mDisplayState = mDisplay.getState(); mDisplayInstallOrientation = mDisplay.getInstallOrientation(); mViewLayoutDirectionInitial = mView.getRawLayoutDirection(); mFallbackEventHandler.setView(view); mWindowAttributes.copyFrom(attrs); Loading Loading @@ -7937,6 +7940,10 @@ public final class ViewRootImpl implements ViewParent, mTmpFrames, mPendingMergedConfiguration, mSurfaceControl, mTempInsets, mTempControls, mSurfaceSize); final int transformHint = SurfaceControl.rotationToBufferTransform( (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); mSurfaceControl.setTransformHint(transformHint); if (mAttachInfo.mContentCaptureManager != null) { MainContentCaptureSession mainSession = mAttachInfo.mContentCaptureManager .getMainContentCaptureSession(); Loading @@ -7955,7 +7962,6 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl); mAttachInfo.mThreadedRenderer.setBlastBufferQueue(mBlastBufferQueue); } int transformHint = mSurfaceControl.getTransformHint(); if (mPreviousTransformHint != transformHint) { mPreviousTransformHint = transformHint; dispatchTransformHintChanged(transformHint); Loading data/etc/services.core.protolog.json +0 −6 Original line number Diff line number Diff line Loading @@ -811,12 +811,6 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "-1248290210": { "message": "Passing transform hint %d for window %s", "level": "VERBOSE", "group": "WM_DEBUG_ORIENTATION", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "-1228653755": { "message": "Launch on display check: displayId=%d callingPid=%d callingUid=%d", "level": "DEBUG", Loading services/core/java/com/android/server/wm/WindowManagerService.java +0 −8 Original line number Diff line number Diff line Loading @@ -2445,14 +2445,6 @@ public class WindowManagerService extends IWindowManager.Stub configChanged = displayContent.updateOrientation(); Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); final DisplayInfo displayInfo = win.getDisplayInfo(); final int transformHint = (displayInfo.rotation + displayInfo.installOrientation) % 4; outSurfaceControl.setTransformHint( SurfaceControl.rotationToBufferTransform(transformHint)); ProtoLog.v(WM_DEBUG_ORIENTATION, "Passing transform hint %d for window %s", transformHint, win); if (toBeDisplayed && win.mIsWallpaper) { displayContent.mWallpaperController.updateWallpaperOffset(win, false /* sync */); } Loading Loading
core/java/android/service/wallpaper/WallpaperService.java +9 −2 Original line number Diff line number Diff line Loading @@ -278,6 +278,7 @@ public abstract class WallpaperService extends Service { private Display mDisplay; private Context mDisplayContext; private int mDisplayState; private @Surface.Rotation int mDisplayInstallOrientation; private float mWallpaperDimAmount = 0.05f; private float mPreviousWallpaperDimAmount = mWallpaperDimAmount; private float mDefaultDimAmount = mWallpaperDimAmount; Loading Loading @@ -1122,6 +1123,11 @@ public abstract class WallpaperService extends Service { mWindow, mLayout, mWidth, mHeight, View.VISIBLE, 0, -1, mWinFrames, mMergedConfiguration, mSurfaceControl, mInsetsState, mTempControls, mSurfaceSize); final int transformHint = SurfaceControl.rotationToBufferTransform( (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); mSurfaceControl.setTransformHint(transformHint); if (mSurfaceControl.isValid()) { if (mBbqSurfaceControl == null) { mBbqSurfaceControl = new SurfaceControl.Builder() Loading @@ -1135,9 +1141,9 @@ public abstract class WallpaperService extends Service { .build(); updateSurfaceDimming(); } // Propagate transform hint from WM so we can use the right hint for the // Propagate transform hint from WM, so we can use the right hint for the // first frame. mBbqSurfaceControl.setTransformHint(mSurfaceControl.getTransformHint()); mBbqSurfaceControl.setTransformHint(transformHint); Surface blastSurface = getOrCreateBLASTSurface(mSurfaceSize.x, mSurfaceSize.y, mFormat); // If blastSurface == null that means it hasn't changed since the last Loading Loading @@ -1377,6 +1383,7 @@ public abstract class WallpaperService extends Service { mWallpaperDimAmount = mDefaultDimAmount; mPreviousWallpaperDimAmount = mWallpaperDimAmount; mDisplayState = mDisplay.getState(); mDisplayInstallOrientation = mDisplay.getInstallOrientation(); if (DEBUG) Log.v(TAG, "onCreate(): " + this); onCreate(mSurfaceHolder); Loading
core/java/android/view/Display.java +12 −0 Original line number Diff line number Diff line Loading @@ -927,6 +927,18 @@ public final class Display { } } /** * Returns the install orientation of the display. * @hide */ @Surface.Rotation public int getInstallOrientation() { synchronized (mLock) { updateDisplayInfoLocked(); return mDisplayInfo.installOrientation; } } /** * @deprecated use {@link #getRotation} * @return orientation of this display. Loading
core/java/android/view/ViewRootImpl.java +7 −1 Original line number Diff line number Diff line Loading @@ -398,6 +398,8 @@ public final class ViewRootImpl implements ViewParent, final DisplayManager mDisplayManager; final String mBasePackageName; private @Surface.Rotation int mDisplayInstallOrientation; final int[] mTmpLocation = new int[2]; final TypedValue mTmpValue = new TypedValue(); Loading Loading @@ -1028,6 +1030,7 @@ public final class ViewRootImpl implements ViewParent, mView = view; mAttachInfo.mDisplayState = mDisplay.getState(); mDisplayInstallOrientation = mDisplay.getInstallOrientation(); mViewLayoutDirectionInitial = mView.getRawLayoutDirection(); mFallbackEventHandler.setView(view); mWindowAttributes.copyFrom(attrs); Loading Loading @@ -7937,6 +7940,10 @@ public final class ViewRootImpl implements ViewParent, mTmpFrames, mPendingMergedConfiguration, mSurfaceControl, mTempInsets, mTempControls, mSurfaceSize); final int transformHint = SurfaceControl.rotationToBufferTransform( (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); mSurfaceControl.setTransformHint(transformHint); if (mAttachInfo.mContentCaptureManager != null) { MainContentCaptureSession mainSession = mAttachInfo.mContentCaptureManager .getMainContentCaptureSession(); Loading @@ -7955,7 +7962,6 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl); mAttachInfo.mThreadedRenderer.setBlastBufferQueue(mBlastBufferQueue); } int transformHint = mSurfaceControl.getTransformHint(); if (mPreviousTransformHint != transformHint) { mPreviousTransformHint = transformHint; dispatchTransformHintChanged(transformHint); Loading
data/etc/services.core.protolog.json +0 −6 Original line number Diff line number Diff line Loading @@ -811,12 +811,6 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "-1248290210": { "message": "Passing transform hint %d for window %s", "level": "VERBOSE", "group": "WM_DEBUG_ORIENTATION", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "-1228653755": { "message": "Launch on display check: displayId=%d callingPid=%d callingUid=%d", "level": "DEBUG", Loading
services/core/java/com/android/server/wm/WindowManagerService.java +0 −8 Original line number Diff line number Diff line Loading @@ -2445,14 +2445,6 @@ public class WindowManagerService extends IWindowManager.Stub configChanged = displayContent.updateOrientation(); Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); final DisplayInfo displayInfo = win.getDisplayInfo(); final int transformHint = (displayInfo.rotation + displayInfo.installOrientation) % 4; outSurfaceControl.setTransformHint( SurfaceControl.rotationToBufferTransform(transformHint)); ProtoLog.v(WM_DEBUG_ORIENTATION, "Passing transform hint %d for window %s", transformHint, win); if (toBeDisplayed && win.mIsWallpaper) { displayContent.mWallpaperController.updateWallpaperOffset(win, false /* sync */); } Loading