Skip to content

Instantly share code, notes, and snippets.

@Albinoman887
Created December 23, 2016 23:48
Show Gist options
  • Save Albinoman887/97274d936d53b9784ae6df3ab495437b to your computer and use it in GitHub Desktop.
Save Albinoman887/97274d936d53b9784ae6df3ab495437b to your computer and use it in GitHub Desktop.
scrrren stuf
diff --git a/core/java/android/hardware/input/TouchCalibration.java b/core/java/android/hardware/input/TouchCalibration.java
index 15503ed..733435d 100644
--- a/core/java/android/hardware/input/TouchCalibration.java
+++ b/core/java/android/hardware/input/TouchCalibration.java
@@ -64,8 +64,8 @@ public class TouchCalibration implements Parcelable {
mXYMix = xyMix;
mXOffset = xOffset;
mYXMix = yxMix;
- mYScale = yScale;
- mYOffset = yOffset;
+ mYScale = 1;
+ mYOffset = -15;
}
public TouchCalibration(Parcel in) {
@@ -73,8 +73,8 @@ public class TouchCalibration implements Parcelable {
mXYMix = in.readFloat();
mXOffset = in.readFloat();
mYXMix = in.readFloat();
- mYScale = in.readFloat();
- mYOffset = in.readFloat();
+ mYScale = 1;
+ mYOffset = -15;
}
@Override
@@ -83,8 +83,8 @@ public class TouchCalibration implements Parcelable {
dest.writeFloat(mXYMix);
dest.writeFloat(mXOffset);
dest.writeFloat(mYXMix);
- dest.writeFloat(mYScale);
- dest.writeFloat(mYOffset);
+ dest.writeFloat(1);
+ dest.writeFloat(-15);
}
@Override
@@ -107,8 +107,8 @@ public class TouchCalibration implements Parcelable {
(cal.mXYMix == mXYMix) &&
(cal.mXOffset == mXOffset) &&
(cal.mYXMix == mYXMix) &&
- (cal.mYScale == mYScale) &&
- (cal.mYOffset == mYOffset);
+ (cal.mYScale == 1) &&
+ (cal.mYOffset == -15);
} else {
return false;
}
@@ -120,13 +120,13 @@ public class TouchCalibration implements Parcelable {
Float.floatToIntBits(mXYMix) ^
Float.floatToIntBits(mXOffset) ^
Float.floatToIntBits(mYXMix) ^
- Float.floatToIntBits(mYScale) ^
- Float.floatToIntBits(mYOffset);
+ Float.floatToIntBits(1) ^
+ Float.floatToIntBits(-15);
}
@Override
public String toString() {
return String.format("[%f, %f, %f, %f, %f, %f]",
- mXScale, mXYMix, mXOffset, mYXMix, mYScale, mYOffset);
+ mXScale, mXYMix, mXOffset, mYXMix, mYScale, -15);
}
}
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index 971989b..b2f2d8f 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -916,7 +916,7 @@ public final class DisplayManagerService extends SystemService {
Slog.d(TAG, "Display " + displayId + " burn-in offset set to ("
+ x + ", " + y + ")");
}
- display.setDisplayOffsetsLocked(x, y);
+ display.setDisplayOffsetsLocked(x, 160);
scheduleTraversalLocked(false);
}
}
@@ -1629,7 +1629,7 @@ public final class DisplayManagerService extends SystemService {
@Override
public void setDisplayOffsets(int displayId, int x, int y) {
- setDisplayOffsetsInternal(displayId, x, y);
+ setDisplayOffsetsInternal(displayId, x, 160);
}
}
}
diff --git a/services/core/java/com/android/server/display/LogicalDisplay.java b/services/core/java/com/android/server/display/LogicalDisplay.java
index 287a25a..ccea4f6 100644
--- a/services/core/java/com/android/server/display/LogicalDisplay.java
+++ b/services/core/java/com/android/server/display/LogicalDisplay.java
@@ -230,7 +230,7 @@ final class LogicalDisplay {
mBaseDisplayInfo.appWidth = deviceInfo.width;
mBaseDisplayInfo.appHeight = deviceInfo.height;
mBaseDisplayInfo.logicalWidth = deviceInfo.width;
- mBaseDisplayInfo.logicalHeight = deviceInfo.height;
+ mBaseDisplayInfo.logicalHeight = 2560;
mBaseDisplayInfo.rotation = Surface.ROTATION_0;
mBaseDisplayInfo.modeId = deviceInfo.modeId;
mBaseDisplayInfo.defaultModeId = deviceInfo.defaultModeId;
@@ -296,7 +296,7 @@ final class LogicalDisplay {
// Set the viewport.
// This is the area of the logical display that we intend to show on the
// display device. For now, it is always the full size of the logical display.
- mTempLayerStackRect.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight);
+ mTempLayerStackRect.set(0, 0, displayInfo.logicalWidth, 2560);
// Set the orientation.
// The orientation specifies how the physical coordinate system of the display
@@ -329,15 +329,15 @@ final class LogicalDisplay {
int displayRectWidth, displayRectHeight;
if ((displayInfo.flags & Display.FLAG_SCALING_DISABLED) != 0) {
displayRectWidth = displayInfo.logicalWidth;
- displayRectHeight = displayInfo.logicalHeight;
- } else if (physWidth * displayInfo.logicalHeight
+ displayRectHeight = 2560;
+ } else if (physWidth * 2560
< physHeight * displayInfo.logicalWidth) {
// Letter box.
displayRectWidth = physWidth;
- displayRectHeight = displayInfo.logicalHeight * physWidth / displayInfo.logicalWidth;
+ displayRectHeight = 2560 * physWidth / displayInfo.logicalWidth;
} else {
// Pillar box.
- displayRectWidth = displayInfo.logicalWidth * physHeight / displayInfo.logicalHeight;
+ displayRectWidth = displayInfo.logicalWidth * physHeight / 2560;
displayRectHeight = physHeight;
}
int displayRectTop = (physHeight - displayRectHeight) / 2;
@@ -347,8 +347,8 @@ final class LogicalDisplay {
mTempDisplayRect.left += mDisplayOffsetX;
mTempDisplayRect.right += mDisplayOffsetX;
- mTempDisplayRect.top += mDisplayOffsetY;
- mTempDisplayRect.bottom += mDisplayOffsetY;
+ mTempDisplayRect.top += 160;
+ mTempDisplayRect.bottom += 160;
device.setProjectionInTransactionLocked(orientation, mTempLayerStackRect, mTempDisplayRect);
}
@@ -420,7 +420,7 @@ final class LogicalDisplay {
*/
public void setDisplayOffsetsLocked(int x, int y) {
mDisplayOffsetX = x;
- mDisplayOffsetY = y;
+ mDisplayOffsetY = 160;
}
public void dumpLocked(PrintWriter pw) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment