Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-base: Commit

frameworks/base


Commit MetaInfo

Revisiónd4c0f294aa9fdc7355cfe5f4d4489e053ceb6838 (tree)
Tiempo2017-10-13 18:34:48
AutorLadehunter <ladehunter@gmai...>
CommiterChih-Wei Huang

Log Message

Fix bug of ForceOrientation

Signed-off-by: Ladehunter <ladehunter@gmail.com>

Cambiar Resumen

Diferencia incremental

--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -235,10 +235,11 @@ class DisplayContent {
235235 || orientation == Surface.ROTATION_270);
236236 final int physWidth = rotated ? mBaseDisplayHeight : mBaseDisplayWidth;
237237 final int physHeight = rotated ? mBaseDisplayWidth : mBaseDisplayHeight;
238+ boolean forcedOrientation = mService.mPolicy.isDefaultOrientationForced();
238239 int width = mDisplayInfo.logicalWidth;
239- int left = (physWidth - width) / 2;
240+ int left = forcedOrientation ? 0 : (physWidth - width) / 2;
240241 int height = mDisplayInfo.logicalHeight;
241- int top = (physHeight - height) / 2;
242+ int top = forcedOrientation ? 0 : (physHeight - height) / 2;
242243 out.set(left, top, left + width, top + height);
243244 }
244245
Show on old repository browser