am 9cc84950: Merge "Don\'t check if this == NULL."

* commit '9cc849500df0bba42d3ed19b90c38ff1dffd2262':
  Don't check if this == NULL.
diff --git a/libs/binder/IInterface.cpp b/libs/binder/IInterface.cpp
index 29acf5d..99a9ffe 100644
--- a/libs/binder/IInterface.cpp
+++ b/libs/binder/IInterface.cpp
@@ -29,12 +29,12 @@
 
 sp<IBinder> IInterface::asBinder()
 {
-    return this ? onAsBinder() : NULL;
+    return onAsBinder();
 }
 
 sp<const IBinder> IInterface::asBinder() const
 {
-    return this ? const_cast<IInterface*>(this)->onAsBinder() : NULL;
+    return const_cast<IInterface*>(this)->onAsBinder();
 }
 
 // ---------------------------------------------------------------------------
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index e95d8b6..9d3f116 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -75,7 +75,7 @@
 
 status_t DisplayState::write(Parcel& output) const {
     output.writeStrongBinder(token);
-    output.writeStrongBinder(surface->asBinder());
+    output.writeStrongBinder(surface != NULL ? surface->asBinder() : NULL);
     output.writeInt32(what);
     output.writeInt32(layerStack);
     output.writeInt32(orientation);
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 419b246..c6a4c7a 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1274,7 +1274,11 @@
                     // this display is in both lists. see if something changed.
                     const DisplayDeviceState& state(curr[j]);
                     const wp<IBinder>& display(curr.keyAt(j));
-                    if (state.surface->asBinder() != draw[i].surface->asBinder()) {
+                    const sp<IBinder> state_binder =
+                        state.surface != NULL ? state.surface->asBinder() : NULL;
+                    const sp<IBinder> draw_binder =
+                        draw[i].surface != NULL ? draw[i].surface->asBinder() : NULL;
+                    if (state_binder != draw_binder) {
                         // changing the surface is like destroying and
                         // recreating the DisplayDevice, so we just remove it
                         // from the drawing state, so that it get re-added