Update LayerVector's order after modifying relative layer.

If the z value for a layer is updated due to a relative layer change,
the order of layers in the SortedVector was not updated and could cause
lookup failures in the binary search. This updates the vector by
removing and then re-adding the layer to ensure it's resorted.

Also added the eRelativeLayerChanged condition for SurfaceFlinger_hwc1.

Test: Added multiple layers that updated relative layer. The LayerVector's
      order was updated correctly and the layers remain in the correct
      order.

Change-Id: If5403a0b626f34db41bf7a98fe42830ed272d16e
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3fba609..ded6607 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2952,7 +2952,10 @@
             }
         }
         if (what & layer_state_t::eRelativeLayerChanged) {
+            ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer);
             if (layer->setRelativeLayer(s.relativeLayerHandle, s.z)) {
+                mCurrentState.layersSortedByZ.removeAt(idx);
+                mCurrentState.layersSortedByZ.add(layer);
                 flags |= eTransactionNeeded|eTraversalNeeded;
             }
         }