Skip to content

Commit

Permalink
Move local variables in ScreenCapture
Browse files Browse the repository at this point in the history
Do not initialize variables when they are not used.

PR #5370 <#5370>
  • Loading branch information
rom1v committed Oct 28, 2024
1 parent 68e54d9 commit 12d5ca4
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ public void onDisplayFoldChanged(int displayId, boolean folded) {

@Override
public void start(Surface surface) {
Rect contentRect = screenInfo.getContentRect();

// does not include the locked video orientation
Rect unlockedVideoRect = screenInfo.getUnlockedVideoSize().toRect();
int videoRotation = screenInfo.getVideoRotation();

if (display != null) {
SurfaceControl.destroyDisplay(display);
display = null;
Expand All @@ -139,6 +133,13 @@ public void start(Surface surface) {
} catch (Exception displayManagerException) {
try {
display = createDisplay();

Rect contentRect = screenInfo.getContentRect();

// does not include the locked video orientation
Rect unlockedVideoRect = screenInfo.getUnlockedVideoSize().toRect();
int videoRotation = screenInfo.getVideoRotation();

setDisplaySurface(display, surface, videoRotation, contentRect, unlockedVideoRect, layerStack);
Ln.d("Display: using SurfaceControl API");
} catch (Exception surfaceControlException) {
Expand Down

0 comments on commit 12d5ca4

Please sign in to comment.