Loading cmds/bootanimation/BootAnimation.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,16 @@ status_t BootAnimation::readyToRun() { if (status) return -1; char value[PROPERTY_VALUE_MAX]; property_get("persist.panel.orientation", value, "0"); int orient = atoi(value)/90; if (orient == eOrientation90 || orient == eOrientation270) { int temp = dinfo.h; dinfo.h = dinfo.w; dinfo.w = temp; } Rect destRect(dinfo.w, dinfo.h); mSession->setDisplayProjection(dtoken, orient, destRect, destRect); // create the native surface sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"), dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565); Loading cmds/bootanimation/BootAnimation.h +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ private: virtual void onFirstRef(); virtual void binderDied(const wp<IBinder>& who); enum { eOrientationDefault = 0, eOrientation90 = 1, eOrientation180 = 2, eOrientation270 = 3, }; struct Texture { GLint w; GLint h; Loading core/java/com/android/internal/view/RotationPolicy.java +10 −4 Original line number Diff line number Diff line Loading @@ -32,9 +32,8 @@ import android.view.Display; import android.view.IWindowManager; import android.view.Surface; import android.view.WindowManagerGlobal; import com.android.internal.R; import android.os.SystemProperties; /** * Provides helper functions for configuring the display rotation policy. */ Loading Loading @@ -140,7 +139,14 @@ public final class RotationPolicy { try { IWindowManager wm = WindowManagerGlobal.getWindowManagerService(); if (enabled) { //Consider input rotation parameter even if display panel is mounted //with 90 or 180 or 270 degrees rotated. if (rotation < 0) { wm.freezeRotation(rotation); } else { wm.freezeRotation(SystemProperties.getInt( "persist.panel.orientation", 0)/90); } } else { wm.thawRotation(); } Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +7 −3 Original line number Diff line number Diff line Loading @@ -579,6 +579,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mOverscanRight = 0; int mOverscanBottom = 0; // Panel Orientation default portrait private int mPanelOrientation = Surface.ROTATION_0; // What we do when the user long presses on home private int mLongPressOnHomeBehavior; Loading Loading @@ -1592,7 +1595,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { return; } mDisplay = display; mPanelOrientation = SystemProperties.getInt("persist.panel.orientation", 0) / 90; final Resources res = mContext.getResources(); int shortSize, longSize; if (width > height) { Loading Loading @@ -5905,7 +5909,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mAllowAllRotations = mContext.getResources().getBoolean( com.android.internal.R.bool.config_allowAllRotations) ? 1 : 0; } if (sensorRotation != Surface.ROTATION_180 if (sensorRotation != mUpsideDownRotation || mAllowAllRotations == 1 || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_USER) { Loading Loading @@ -5983,7 +5987,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (preferredRotation >= 0) { return preferredRotation; } return Surface.ROTATION_0; return mPanelOrientation; } } } Loading services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -467,7 +467,7 @@ public class WindowManagerService extends IWindowManager.Stub /** All DisplayContents in the world, kept here */ SparseArray<DisplayContent> mDisplayContents = new SparseArray<>(2); int mRotation = 0; int mRotation = SystemProperties.getInt("persist.panel.orientation", 0) / 90; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; boolean mAltOrientation = false; Loading Loading
cmds/bootanimation/BootAnimation.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,16 @@ status_t BootAnimation::readyToRun() { if (status) return -1; char value[PROPERTY_VALUE_MAX]; property_get("persist.panel.orientation", value, "0"); int orient = atoi(value)/90; if (orient == eOrientation90 || orient == eOrientation270) { int temp = dinfo.h; dinfo.h = dinfo.w; dinfo.w = temp; } Rect destRect(dinfo.w, dinfo.h); mSession->setDisplayProjection(dtoken, orient, destRect, destRect); // create the native surface sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"), dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565); Loading
cmds/bootanimation/BootAnimation.h +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ private: virtual void onFirstRef(); virtual void binderDied(const wp<IBinder>& who); enum { eOrientationDefault = 0, eOrientation90 = 1, eOrientation180 = 2, eOrientation270 = 3, }; struct Texture { GLint w; GLint h; Loading
core/java/com/android/internal/view/RotationPolicy.java +10 −4 Original line number Diff line number Diff line Loading @@ -32,9 +32,8 @@ import android.view.Display; import android.view.IWindowManager; import android.view.Surface; import android.view.WindowManagerGlobal; import com.android.internal.R; import android.os.SystemProperties; /** * Provides helper functions for configuring the display rotation policy. */ Loading Loading @@ -140,7 +139,14 @@ public final class RotationPolicy { try { IWindowManager wm = WindowManagerGlobal.getWindowManagerService(); if (enabled) { //Consider input rotation parameter even if display panel is mounted //with 90 or 180 or 270 degrees rotated. if (rotation < 0) { wm.freezeRotation(rotation); } else { wm.freezeRotation(SystemProperties.getInt( "persist.panel.orientation", 0)/90); } } else { wm.thawRotation(); } Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +7 −3 Original line number Diff line number Diff line Loading @@ -579,6 +579,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mOverscanRight = 0; int mOverscanBottom = 0; // Panel Orientation default portrait private int mPanelOrientation = Surface.ROTATION_0; // What we do when the user long presses on home private int mLongPressOnHomeBehavior; Loading Loading @@ -1592,7 +1595,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { return; } mDisplay = display; mPanelOrientation = SystemProperties.getInt("persist.panel.orientation", 0) / 90; final Resources res = mContext.getResources(); int shortSize, longSize; if (width > height) { Loading Loading @@ -5905,7 +5909,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mAllowAllRotations = mContext.getResources().getBoolean( com.android.internal.R.bool.config_allowAllRotations) ? 1 : 0; } if (sensorRotation != Surface.ROTATION_180 if (sensorRotation != mUpsideDownRotation || mAllowAllRotations == 1 || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_USER) { Loading Loading @@ -5983,7 +5987,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (preferredRotation >= 0) { return preferredRotation; } return Surface.ROTATION_0; return mPanelOrientation; } } } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -467,7 +467,7 @@ public class WindowManagerService extends IWindowManager.Stub /** All DisplayContents in the world, kept here */ SparseArray<DisplayContent> mDisplayContents = new SparseArray<>(2); int mRotation = 0; int mRotation = SystemProperties.getInt("persist.panel.orientation", 0) / 90; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; boolean mAltOrientation = false; Loading