When a Virtual Display is plugged in, we create a corresponding surface

whose mutation should be owned by mSyncRoot(Owned by
DisplayManagerService). However, there is an operation of getting the
defaultSize of this Display which is performed without honouring the
mSyncRoot.

Bug: 211153738
Test: Manual
Change-Id: I5bedf0f25dc4635d828b96312f7f799fb9ed321c
This commit is contained in:
Rupesh Bansal
2022-03-17 15:06:21 +00:00
parent 379a87059e
commit 9a85809c25
3 changed files with 3 additions and 3 deletions

View File

@@ -131,7 +131,7 @@ abstract class DisplayDevice {
* Only used for mirroring started from MediaProjection.
*/
@Nullable
public Point getDisplaySurfaceDefaultSize() {
public Point getDisplaySurfaceDefaultSizeLocked() {
return null;
}

View File

@@ -3880,8 +3880,8 @@ public final class DisplayManagerService extends SystemService {
if (device == null) {
return null;
}
return device.getDisplaySurfaceDefaultSizeLocked();
}
return device.getDisplaySurfaceDefaultSize();
}
@Override

View File

@@ -302,7 +302,7 @@ public class VirtualDisplayAdapter extends DisplayAdapter {
}
@Override
public Point getDisplaySurfaceDefaultSize() {
public Point getDisplaySurfaceDefaultSizeLocked() {
if (mSurface == null) {
return null;
}