Merge "Handle null Surface in createVirtualDisplay" into nyc-mr1-dev

This commit is contained in:
Pablo Ceballos
2016-09-01 00:06:30 +00:00
committed by Android (Google) Code Review

View File

@@ -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);