Handle null Surface in createVirtualDisplay am: eb3370d490
am: b7d3f5b63b
Change-Id: I2c94542234bed20440dc5b927e1f27de47cf44d5
This commit is contained in:
@@ -1402,7 +1402,7 @@ public final class DisplayManagerService extends SystemService {
|
||||
throw new IllegalArgumentException("width, height, and densityDpi must be "
|
||||
+ "greater than 0");
|
||||
}
|
||||
if (surface.isSingleBuffered()) {
|
||||
if (surface != null && surface.isSingleBuffered()) {
|
||||
throw new IllegalArgumentException("Surface can't be single-buffered");
|
||||
}
|
||||
|
||||
@@ -1463,6 +1463,9 @@ public final class DisplayManagerService extends SystemService {
|
||||
|
||||
@Override // Binder call
|
||||
public void setVirtualDisplaySurface(IVirtualDisplayCallback callback, Surface surface) {
|
||||
if (surface != null && surface.isSingleBuffered()) {
|
||||
throw new IllegalArgumentException("Surface can't be single-buffered");
|
||||
}
|
||||
final long token = Binder.clearCallingIdentity();
|
||||
try {
|
||||
setVirtualDisplaySurfaceInternal(callback.asBinder(), surface);
|
||||
|
||||
Reference in New Issue
Block a user