diff options
Diffstat (limited to 'core/java/android/view/SurfaceControl.java')
| -rw-r--r-- | core/java/android/view/SurfaceControl.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 7ef7e2bf6f11..ded2f470ac7b 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -509,13 +509,8 @@ public class SurfaceControl { if (displayToken == null) { throw new IllegalArgumentException("displayToken must not be null"); } - if (surface == null) { - throw new IllegalArgumentException("surface must not be null"); - } - if (surface.mNativeObject == 0) - throw new NullPointerException("Surface native object is null. Are you using a released surface?"); - - nativeSetDisplaySurface(displayToken, surface.mNativeObject); + int nativeSurface = surface != null ? surface.mNativeObject : 0; + nativeSetDisplaySurface(displayToken, nativeSurface); } public static IBinder createDisplay(String name, boolean secure) { |
