summaryrefslogtreecommitdiff
path: root/core/java/android/view/SurfaceView.java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2020-04-17 14:14:33 -0700
committerRobert Carr <racarr@google.com>2020-04-17 14:14:33 -0700
commitb3ca38fb99dba641afd45295e6ab4ea2642197d3 (patch)
tree97a72caf09177c4f3d213c81b8d6f39b269be87f /core/java/android/view/SurfaceView.java
parentadf530fc264267260aae06231e4be59c74f30a36 (diff)
SurfaceView: Remove dead code
While debugging SurfaceView transaction usage I noticed this code was unconditionally dead. Notice the else statement only contains the single if statement within, so it could be written as else-if. But then notice the condition of this rewritten else-if is contained within the original if and so it can never be entered. Bug: 153120755 Test: Existing tests pass Change-Id: I032b17911a9c71a1e3d09e3933e6f6a3d86dffb6
Diffstat (limited to 'core/java/android/view/SurfaceView.java')
-rw-r--r--core/java/android/view/SurfaceView.java37
1 files changed, 0 insertions, 37 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index 9880ea096cf2..db6fe0f57d06 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -1173,43 +1173,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
TAG, "Layout: x=" + mScreenRect.left + " y=" + mScreenRect.top
+ " w=" + mScreenRect.width() + " h=" + mScreenRect.height()
+ ", frame=" + mSurfaceFrame);
- } else {
- // Calculate the window position in case RT loses the window
- // and we need to fallback to a UI-thread driven position update
- if (positionChanged || layoutSizeChanged) { // Only the position has changed
- mWindowSpaceLeft = mLocation[0];
- mWindowSpaceTop = mLocation[1];
- // For our size changed check, we keep mScreenRect.width() and mScreenRect.height()
- // in view local space.
- mLocation[0] = getWidth();
- mLocation[1] = getHeight();
-
- mScreenRect.set(mWindowSpaceLeft, mWindowSpaceTop,
- mWindowSpaceLeft + mLocation[0], mWindowSpaceTop + mLocation[1]);
-
- if (translator != null) {
- translator.translateRectInAppWindowToScreen(mScreenRect);
- }
-
- if (mSurfaceControl == null) {
- return;
- }
-
- if (!isHardwareAccelerated() || !mRtHandlingPositionUpdates) {
- try {
- if (DEBUG_POSITION) {
- Log.d(TAG, String.format("%d updateSurfacePosition UI, "
- + "position = [%d, %d, %d, %d]",
- System.identityHashCode(this),
- mScreenRect.left, mScreenRect.top,
- mScreenRect.right, mScreenRect.bottom));
- }
- setParentSpaceRectangle(mScreenRect, -1);
- } catch (Exception ex) {
- Log.e(TAG, "Exception configuring surface", ex);
- }
- }
- }
}
}