summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java11
-rw-r--r--core/java/android/view/Display.java12
-rw-r--r--core/java/android/view/ViewRootImpl.java8
-rw-r--r--data/etc/services.core.protolog.json6
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java8
5 files changed, 28 insertions, 17 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 00840545632c..dd4355d3b7a1 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -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;
@@ -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()
@@ -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
@@ -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);
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index 70266c1717a1..d6e074fbe178 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -928,6 +928,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.
*/
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index e068f44f4376..97b5a3181dbf 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -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();
@@ -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);
@@ -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();
@@ -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);
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index af4beb93a1a5..07523299c353 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -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",
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index c97aa32f7b2a..054904df35ed 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -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 */);
}