composer: move LayerCommand to be part of DisplayCommand

This CL also includes a few miscellaneous changes:
 - Remove ..composer3.command namespace
   (so all commands are in composer3)
 - Minor documentation update
 - Minor name changes

Bug: 201008710
Test: VTS
Change-Id: I3fc24392d6c019c39e4d7df735abacc2c793c4f9
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index 720a767..2aa4bb2 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -56,7 +56,6 @@
             "android.hardware.common",
             "android.hardware.common.fmq",
             "android.hardware.graphics.common",
-            "android.hardware.graphics.composer3.command",
             "android.hardware.keymaster",
             "android.hardware.radio",
             "android.hardware.uwb.fira_android",
diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp
index 9034138..5f5b54e 100644
--- a/graphics/composer/aidl/Android.bp
+++ b/graphics/composer/aidl/Android.bp
@@ -33,7 +33,6 @@
     },
     srcs: [
         "android/hardware/graphics/composer3/*.aidl",
-        "android/hardware/graphics/composer3/command/*.aidl",
     ],
     stability: "vintf",
     imports: [
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl
index cead848..a33ad23 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Buffer.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Buffer.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable Buffer {
   int slot;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
similarity index 94%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
index 40637a9..7e47ba8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
@@ -31,8 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
-parcelable ParcelableComposition {
+parcelable ChangedCompositionLayer {
+  long layer;
   android.hardware.graphics.composer3.Composition composition;
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
similarity index 91%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
index 906f20c..9a5ca97 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
@@ -31,9 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
-parcelable PresentFence {
+parcelable ChangedCompositionTypes {
   long display;
-  ParcelFileDescriptor fence;
+  android.hardware.graphics.composer3.ChangedCompositionLayer[] layers;
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
similarity index 93%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
index c3f4700..7632707 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTarget.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
@@ -31,10 +31,10 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ClientTarget {
-  android.hardware.graphics.composer3.command.Buffer buffer;
+  android.hardware.graphics.composer3.Buffer buffer;
   android.hardware.graphics.common.Dataspace dataspace;
   android.hardware.graphics.common.Rect[] damage;
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
similarity index 97%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
index b690a57..f0fb22e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ClientTargetPropertyWithNits {
   long display;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl
index 0b3071c..df07c9c 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ColorTransformPayload {
   float[] matrix;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl
similarity index 95%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl
index 1726ea5..103bfdc 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/Error.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandError.aidl
@@ -31,9 +31,9 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
-parcelable Error {
+parcelable CommandError {
   int commandIndex;
   int errorCode;
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
similarity index 74%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl
copy to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
index 5e6d212..ebbb31e 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/CommandResultPayload.aidl
@@ -31,8 +31,14 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
-parcelable ParcelableBlendMode {
-  android.hardware.graphics.common.BlendMode blendMode;
+union CommandResultPayload {
+  android.hardware.graphics.composer3.CommandError error;
+  android.hardware.graphics.composer3.ChangedCompositionTypes changedCompositionTypes;
+  android.hardware.graphics.composer3.DisplayRequest displayRequest;
+  android.hardware.graphics.composer3.PresentFence presentFence;
+  android.hardware.graphics.composer3.ReleaseFences releaseFences;
+  android.hardware.graphics.composer3.PresentOrValidate presentOrValidateResult;
+  android.hardware.graphics.composer3.ClientTargetPropertyWithNits clientTargetProperty;
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
similarity index 84%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
index 7446db0..2f5d00f 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -31,13 +31,14 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable DisplayCommand {
   long display;
-  @nullable android.hardware.graphics.composer3.command.ColorTransformPayload colorTransform;
-  @nullable android.hardware.graphics.composer3.command.ClientTarget clientTarget;
-  @nullable android.hardware.graphics.composer3.command.Buffer virtualDisplayOutputBuffer;
+  android.hardware.graphics.composer3.LayerCommand[] layers;
+  @nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform;
+  @nullable android.hardware.graphics.composer3.ClientTarget clientTarget;
+  @nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer;
   boolean validateDisplay;
   boolean acceptDisplayChanges;
   boolean presentDisplay;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
similarity index 93%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
index 7f413a9..13462ce 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/DisplayRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
@@ -31,12 +31,12 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable DisplayRequest {
   long display;
   int mask;
-  android.hardware.graphics.composer3.command.DisplayRequest.LayerRequest[] layerRequests;
+  android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests;
   const int FLIP_CLIENT_TARGET = 1;
   const int WRITE_CLIENT_TARGET_TO_OUTPUT = 2;
   @VintfStability
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl
index be889d8..c18529b 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/GenericMetadata.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable GenericMetadata {
   android.hardware.graphics.composer3.LayerGenericMetadataKey key;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index 65cf86c..4717218 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -38,7 +38,7 @@
   android.hardware.graphics.composer3.VirtualDisplay createVirtualDisplay(int width, int height, android.hardware.graphics.common.PixelFormat formatHint, int outputBufferSlotCount);
   void destroyLayer(long display, long layer);
   void destroyVirtualDisplay(long display);
-  android.hardware.graphics.composer3.command.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.command.CommandPayload[] commands);
+  android.hardware.graphics.composer3.CommandResultPayload[] executeCommands(in android.hardware.graphics.composer3.DisplayCommand[] commands);
   int getActiveConfig(long display);
   android.hardware.graphics.composer3.ColorMode[] getColorModes(long display);
   float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace);
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
similarity index 75%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
index b5adbc3..bad72fc 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/LayerCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -31,29 +31,28 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable LayerCommand {
-  long display;
   long layer;
   @nullable android.hardware.graphics.common.Point cursorPosition;
-  @nullable android.hardware.graphics.composer3.command.Buffer buffer;
+  @nullable android.hardware.graphics.composer3.Buffer buffer;
   @nullable android.hardware.graphics.common.Rect[] damage;
-  @nullable android.hardware.graphics.composer3.command.ParcelableBlendMode blendMode;
+  @nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode;
   @nullable android.hardware.graphics.composer3.Color color;
   @nullable android.hardware.graphics.composer3.FloatColor floatColor;
-  @nullable android.hardware.graphics.composer3.command.ParcelableComposition composition;
-  @nullable android.hardware.graphics.composer3.command.ParcelableDataspace dataspace;
+  @nullable android.hardware.graphics.composer3.ParcelableComposition composition;
+  @nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace;
   @nullable android.hardware.graphics.common.Rect displayFrame;
-  @nullable android.hardware.graphics.composer3.command.PlaneAlpha planeAlpha;
+  @nullable android.hardware.graphics.composer3.PlaneAlpha planeAlpha;
   @nullable android.hardware.common.NativeHandle sidebandStream;
   @nullable android.hardware.graphics.common.FRect sourceCrop;
-  @nullable android.hardware.graphics.composer3.command.ParcelableTransform transform;
+  @nullable android.hardware.graphics.composer3.ParcelableTransform transform;
   @nullable android.hardware.graphics.common.Rect[] visibleRegion;
-  @nullable android.hardware.graphics.composer3.command.ZOrder z;
+  @nullable android.hardware.graphics.composer3.ZOrder z;
   @nullable float[] colorTransform;
-  @nullable android.hardware.graphics.composer3.command.WhitePointNits whitePointNits;
-  @nullable android.hardware.graphics.composer3.command.GenericMetadata genericMetadata;
+  @nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits;
+  @nullable android.hardware.graphics.composer3.GenericMetadata genericMetadata;
   @nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata;
   @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
 }
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
index 5e6d212..f1fee5f 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ParcelableBlendMode {
   android.hardware.graphics.common.BlendMode blendMode;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl
index 40637a9..98fbb66 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableComposition.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ParcelableComposition {
   android.hardware.graphics.composer3.Composition composition;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl
index 8f06079..76ecf85 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableDataspace.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ParcelableDataspace {
   android.hardware.graphics.common.Dataspace dataspace;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl
index 6d6fe5b..b673656 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ParcelableTransform.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ParcelableTransform.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ParcelableTransform {
   android.hardware.graphics.common.Transform transform;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl
index 97f5329..c48c2a8 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PlaneAlpha.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PlaneAlpha.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable PlaneAlpha {
   float alpha;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl
index 906f20c..3bb09cd 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentFence.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentFence.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable PresentFence {
   long display;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
similarity index 93%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
index 66f1c03..3514e53 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/PresentOrValidate.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/PresentOrValidate.aidl
@@ -31,11 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable PresentOrValidate {
   long display;
-  android.hardware.graphics.composer3.command.PresentOrValidate.Result result;
+  android.hardware.graphics.composer3.PresentOrValidate.Result result;
   @VintfStability
   enum Result {
     Presented = 0,
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl
similarity index 93%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl
index b7d2586..d623661 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ReleaseFences.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ReleaseFences.aidl
@@ -31,11 +31,11 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ReleaseFences {
   long display;
-  android.hardware.graphics.composer3.command.ReleaseFences.Layer[] layers;
+  android.hardware.graphics.composer3.ReleaseFences.Layer[] layers;
   @VintfStability
   parcelable Layer {
     long layer;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
index 2b25167..c3925d2 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/WhitePointNits.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/WhitePointNits.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable WhitePointNits {
   float nits;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl
similarity index 96%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl
index 69b68c4..ea96ea3 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ZOrder.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ZOrder.aidl
@@ -31,7 +31,7 @@
 // with such a backward incompatible change, it has a high risk of breaking
 // later when a module using the interface is updated, e.g., Mainline modules.
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 @VintfStability
 parcelable ZOrder {
   int z;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl
deleted file mode 100644
index 1377c6c..0000000
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-//     the interface (from the latest frozen version), the build system will
-//     prompt you to update this file with `m <name>-update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.graphics.composer3.command;
-@VintfStability
-parcelable ChangedCompositionTypes {
-  long display;
-  android.hardware.graphics.composer3.command.ChangedCompositionTypes.Layer[] layers;
-  @VintfStability
-  parcelable Layer {
-    long layer;
-    android.hardware.graphics.composer3.Composition composition;
-  }
-}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl
deleted file mode 100644
index 9848306..0000000
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandPayload.aidl
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-//     the interface (from the latest frozen version), the build system will
-//     prompt you to update this file with `m <name>-update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.graphics.composer3.command;
-@VintfStability
-union CommandPayload {
-  android.hardware.graphics.composer3.command.DisplayCommand displayCommand;
-  android.hardware.graphics.composer3.command.LayerCommand layerCommand;
-}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl
deleted file mode 100644
index 1b3cae8..0000000
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/command/CommandResultPayload.aidl
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-//     the interface (from the latest frozen version), the build system will
-//     prompt you to update this file with `m <name>-update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.graphics.composer3.command;
-@VintfStability
-union CommandResultPayload {
-  android.hardware.graphics.composer3.command.Error error;
-  android.hardware.graphics.composer3.command.ChangedCompositionTypes changedCompositionType;
-  android.hardware.graphics.composer3.command.DisplayRequest displayRequest;
-  android.hardware.graphics.composer3.command.PresentFence presentFence;
-  android.hardware.graphics.composer3.command.ReleaseFences releaseFences;
-  android.hardware.graphics.composer3.command.PresentOrValidate presentOrValidateResult;
-  android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits clientTargetProperty;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl
similarity index 96%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl
index 3a08d3b..415a9b6 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Buffer.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Buffer.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.common.NativeHandle;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
similarity index 74%
copy from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
copy to graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
index 91979d8..fb25163 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionLayer.aidl
@@ -14,11 +14,20 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.composer3.Composition;
 
 @VintfStability
-parcelable ParcelableComposition {
+parcelable ChangedCompositionLayer {
+    /**
+     * The layer which this commands refers to.
+     * @see IComposer.createLayer
+     */
+    long layer;
+
+    /**
+     * The new composition type.
+     */
     Composition composition;
 }
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
similarity index 72%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
index 3800eff..ddd45b7 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ChangedCompositionTypes.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ChangedCompositionTypes.aidl
@@ -14,8 +14,9 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
+import android.hardware.graphics.composer3.ChangedCompositionLayer;
 import android.hardware.graphics.composer3.Composition;
 
 @VintfStability
@@ -26,22 +27,8 @@
      */
     long display;
 
-    @VintfStability
-    parcelable Layer {
-        /**
-         * The layer which this commands refers to.
-         * @see IComposer.createLayer
-         */
-        long layer;
-
-        /**
-         * The new composition type.
-         */
-        Composition composition;
-    }
-
     /**
      * Indicates which layers has composition changes
      */
-    Layer[] layers;
+    ChangedCompositionLayer[] layers;
 }
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
similarity index 89%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
index d8d45a1..56488d5 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTarget.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
@@ -14,11 +14,11 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.common.Dataspace;
 import android.hardware.graphics.common.Rect;
-import android.hardware.graphics.composer3.command.Buffer;
+import android.hardware.graphics.composer3.Buffer;
 
 @VintfStability
 parcelable ClientTarget {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
similarity index 95%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
index c80e4ce..5037651 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ClientTargetPropertyWithNits.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTargetPropertyWithNits.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.composer3.ClientTargetProperty;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl
similarity index 94%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl
index 9cc8fa7..8bb0711 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ColorTransformPayload.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.common.ColorTransform;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl
similarity index 91%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl
index 19843b9..ea48600 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/Error.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandError.aidl
@@ -14,10 +14,10 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
-parcelable Error {
+parcelable CommandError {
     /**
      * The index in the command payload array.
      */
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
similarity index 85%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
index b6086ca..f2de68e 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandResultPayload.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/CommandResultPayload.aidl
@@ -14,22 +14,22 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
-import android.hardware.graphics.composer3.command.ChangedCompositionTypes;
-import android.hardware.graphics.composer3.command.ClientTargetPropertyWithNits;
-import android.hardware.graphics.composer3.command.DisplayRequest;
-import android.hardware.graphics.composer3.command.Error;
-import android.hardware.graphics.composer3.command.PresentFence;
-import android.hardware.graphics.composer3.command.PresentOrValidate;
-import android.hardware.graphics.composer3.command.ReleaseFences;
+import android.hardware.graphics.composer3.ChangedCompositionTypes;
+import android.hardware.graphics.composer3.ClientTargetPropertyWithNits;
+import android.hardware.graphics.composer3.CommandError;
+import android.hardware.graphics.composer3.DisplayRequest;
+import android.hardware.graphics.composer3.PresentFence;
+import android.hardware.graphics.composer3.PresentOrValidate;
+import android.hardware.graphics.composer3.ReleaseFences;
 
 @VintfStability
 union CommandResultPayload {
     /**
      * Indicates an error generated by a command.
      */
-    Error error;
+    CommandError error;
 
     /**
      * Sets the layers for which the device requires a different composition
@@ -38,7 +38,7 @@
      * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate
      * the display again.
      */
-    ChangedCompositionTypes changedCompositionType;
+    ChangedCompositionTypes changedCompositionTypes;
 
     /**
      * Sets the display requests and the layer requests required for the last
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
index 7295ada..cdc4759 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -14,11 +14,12 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
-import android.hardware.graphics.composer3.command.Buffer;
-import android.hardware.graphics.composer3.command.ClientTarget;
-import android.hardware.graphics.composer3.command.ColorTransformPayload;
+import android.hardware.graphics.composer3.Buffer;
+import android.hardware.graphics.composer3.ClientTarget;
+import android.hardware.graphics.composer3.ColorTransformPayload;
+import android.hardware.graphics.composer3.LayerCommand;
 
 @VintfStability
 parcelable DisplayCommand {
@@ -29,6 +30,12 @@
     long display;
 
     /**
+     * Sets layer commands for this display.
+     * @see LayerCommand.
+     */
+    LayerCommand[] layers;
+
+    /**
      * Sets a color transform which will be applied after composition.
      *
      * If hint is not ColorTransform::ARBITRARY, then the device may use the
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl
similarity index 97%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl
index 10bd10c..ea7745d 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/DisplayRequest.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayRequest.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
 parcelable DisplayRequest {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl
similarity index 94%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl
index a4e1fe8..d0254dd 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/GenericMetadata.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.composer3.LayerGenericMetadataKey;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index f661f8b..570d5d9 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -18,9 +18,11 @@
 
 import android.hardware.graphics.composer3.ClientTargetProperty;
 import android.hardware.graphics.composer3.ColorMode;
+import android.hardware.graphics.composer3.CommandResultPayload;
 import android.hardware.graphics.composer3.ContentType;
 import android.hardware.graphics.composer3.DisplayAttribute;
 import android.hardware.graphics.composer3.DisplayCapability;
+import android.hardware.graphics.composer3.DisplayCommand;
 import android.hardware.graphics.composer3.DisplayConnectionType;
 import android.hardware.graphics.composer3.DisplayContentSample;
 import android.hardware.graphics.composer3.DisplayContentSamplingAttributes;
@@ -36,8 +38,6 @@
 import android.hardware.graphics.composer3.VirtualDisplay;
 import android.hardware.graphics.composer3.VsyncPeriodChangeConstraints;
 import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline;
-import android.hardware.graphics.composer3.command.CommandPayload;
-import android.hardware.graphics.composer3.command.CommandResultPayload;
 
 @VintfStability
 interface IComposerClient {
@@ -163,7 +163,7 @@
      *
      * @return are the command statuses.
      */
-    CommandResultPayload[] executeCommands(in CommandPayload[] commands);
+    CommandResultPayload[] executeCommands(in DisplayCommand[] commands);
 
     /**
      * Retrieves which display configuration is currently active.
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
index eac051b..130e3b1 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/LayerCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -14,35 +14,29 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.common.NativeHandle;
 import android.hardware.graphics.common.FRect;
 import android.hardware.graphics.common.Point;
 import android.hardware.graphics.common.Rect;
+import android.hardware.graphics.composer3.Buffer;
 import android.hardware.graphics.composer3.Color;
 import android.hardware.graphics.composer3.FloatColor;
+import android.hardware.graphics.composer3.GenericMetadata;
+import android.hardware.graphics.composer3.ParcelableBlendMode;
+import android.hardware.graphics.composer3.ParcelableComposition;
+import android.hardware.graphics.composer3.ParcelableDataspace;
+import android.hardware.graphics.composer3.ParcelableTransform;
 import android.hardware.graphics.composer3.PerFrameMetadata;
 import android.hardware.graphics.composer3.PerFrameMetadataBlob;
-import android.hardware.graphics.composer3.command.Buffer;
-import android.hardware.graphics.composer3.command.GenericMetadata;
-import android.hardware.graphics.composer3.command.ParcelableBlendMode;
-import android.hardware.graphics.composer3.command.ParcelableComposition;
-import android.hardware.graphics.composer3.command.ParcelableDataspace;
-import android.hardware.graphics.composer3.command.ParcelableTransform;
-import android.hardware.graphics.composer3.command.PlaneAlpha;
-import android.hardware.graphics.composer3.command.WhitePointNits;
-import android.hardware.graphics.composer3.command.ZOrder;
+import android.hardware.graphics.composer3.PlaneAlpha;
+import android.hardware.graphics.composer3.WhitePointNits;
+import android.hardware.graphics.composer3.ZOrder;
 
 @VintfStability
 parcelable LayerCommand {
     /**
-     * The display which this commands refers to.
-     * @see IComposer.createDisplay
-     */
-    long display;
-
-    /**
      * The layer which this commands refers to.
      * @see IComposer.createLayer
      */
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
index f912853..a6c016a 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableBlendMode.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableBlendMode.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.common.BlendMode;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl
index 91979d8..0946ce7 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableComposition.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableComposition.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.composer3.Composition;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl
index 6be750d..528cdf9 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableDataspace.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableDataspace.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.common.Dataspace;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl
index 910d014..75f9f7e 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ParcelableTransform.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ParcelableTransform.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 import android.hardware.graphics.common.Transform;
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl
index fa1889b..347dc19 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PlaneAlpha.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PlaneAlpha.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
 parcelable PlaneAlpha {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl
similarity index 94%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl
index 0c14406..244b4e5 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentFence.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentFence.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
 parcelable PresentFence {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
similarity index 94%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
index 7fc60c4..f3153bd 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/PresentOrValidate.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/PresentOrValidate.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
 parcelable PresentOrValidate {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl
similarity index 95%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl
index 762f5eb..459a042 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ReleaseFences.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ReleaseFences.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
 parcelable ReleaseFences {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
similarity index 94%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
index ec46cdf..2a1d1c6 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/WhitePointNits.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/WhitePointNits.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
 parcelable WhitePointNits {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl
similarity index 93%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl
index 68120b0..56cc200 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/ZOrder.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ZOrder.aidl
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package android.hardware.graphics.composer3.command;
+package android.hardware.graphics.composer3;
 
 @VintfStability
 parcelable ZOrder {
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl
deleted file mode 100644
index c1555e6..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/command/CommandPayload.aidl
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.graphics.composer3.command;
-
-import android.hardware.graphics.composer3.command.DisplayCommand;
-import android.hardware.graphics.composer3.command.LayerCommand;
-
-/**
- * Type of commands that can be used in IComposerClient.executeCommands.
- * Note that this is a union and each command can only have one type.
- */
-@VintfStability
-union CommandPayload {
-    DisplayCommand displayCommand;
-    LayerCommand layerCommand;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
index 5bda15a..a3c8176 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
@@ -74,7 +74,7 @@
 static_assert(aidl::android::hardware::graphics::composer3::Capability::SKIP_VALIDATE ==
               static_cast<aidl::android::hardware::graphics::composer3::Capability>(4));
 
-static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest::LayerRequest::
+static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::LayerRequest::
                       CLEAR_CLIENT_TARGET ==
               static_cast<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
                                        LayerRequest::CLEAR_CLIENT_TARGET));
@@ -121,11 +121,10 @@
                       ::android::hardware::graphics::composer::V2_1::IComposerClient::Composition::
                               SIDEBAND));
 
-static_assert(
-        aidl::android::hardware::graphics::composer3::command::DisplayRequest::FLIP_CLIENT_TARGET ==
-        static_cast<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
-                                 DisplayRequest::FLIP_CLIENT_TARGET));
-static_assert(aidl::android::hardware::graphics::composer3::command::DisplayRequest::
+static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::FLIP_CLIENT_TARGET ==
+              static_cast<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
+                                       DisplayRequest::FLIP_CLIENT_TARGET));
+static_assert(aidl::android::hardware::graphics::composer3::DisplayRequest::
                       WRITE_CLIENT_TARGET_TO_OUTPUT ==
               static_cast<int>(::android::hardware::graphics::composer::V2_1::IComposerClient::
                                        DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT));
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
index 717b60c..8726043 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -140,7 +140,7 @@
             return;
         }
 
-        std::vector<command::CommandResultPayload> results;
+        std::vector<CommandResultPayload> results;
         const auto status = mComposerClient->executeCommands(commands, &results);
         ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
 
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
index 7a20a53..17b0ebd 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -1168,7 +1168,7 @@
             return;
         }
 
-        std::vector<command::CommandResultPayload> results;
+        std::vector<CommandResultPayload> results;
         const auto status = mComposerClient->executeCommands(commands, &results);
         ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
 
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
index b586e7f..fcf2a34 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/command-buffer.h
@@ -37,8 +37,8 @@
 #include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
 #include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>
 
-#include <aidl/android/hardware/graphics/composer3/command/CommandPayload.h>
-#include <aidl/android/hardware/graphics/composer3/command/CommandResultPayload.h>
+#include <aidl/android/hardware/graphics/composer3/CommandResultPayload.h>
+#include <aidl/android/hardware/graphics/composer3/DisplayCommand.h>
 
 #include <aidl/android/hardware/graphics/common/ColorTransform.h>
 #include <aidl/android/hardware/graphics/common/FRect.h>
@@ -79,14 +79,14 @@
     }
 
     void setError(int32_t index, int32_t errorCode) {
-        command::Error error;
+        CommandError error;
         error.commandIndex = index;
         error.errorCode = errorCode;
         mCommandsResults.emplace_back(std::move(error));
     }
 
-    void setPresentOrValidateResult(int64_t display, command::PresentOrValidate::Result result) {
-        command::PresentOrValidate presentOrValidate;
+    void setPresentOrValidateResult(int64_t display, PresentOrValidate::Result result) {
+        PresentOrValidate presentOrValidate;
         presentOrValidate.display = display;
         presentOrValidate.result = result;
         mCommandsResults.emplace_back(std::move(presentOrValidate));
@@ -94,12 +94,11 @@
 
     void setChangedCompositionTypes(int64_t display, const std::vector<int64_t>& layers,
                                     const std::vector<Composition>& types) {
-        command::ChangedCompositionTypes changedCompositionTypes;
+        ChangedCompositionTypes changedCompositionTypes;
         changedCompositionTypes.display = display;
         changedCompositionTypes.layers.reserve(layers.size());
         for (int i = 0; i < layers.size(); i++) {
-            auto layer = command::ChangedCompositionTypes::Layer{.layer = layers[i],
-                                                                 .composition = types[i]};
+            auto layer = ChangedCompositionLayer{.layer = layers[i], .composition = types[i]};
             changedCompositionTypes.layers.emplace_back(std::move(layer));
         }
         mCommandsResults.emplace_back(std::move(changedCompositionTypes));
@@ -108,13 +107,13 @@
     void setDisplayRequests(int64_t display, int32_t displayRequestMask,
                             const std::vector<int64_t>& layers,
                             const std::vector<int32_t>& layerRequestMasks) {
-        command::DisplayRequest displayRequest;
+        DisplayRequest displayRequest;
         displayRequest.display = display;
         displayRequest.mask = displayRequestMask;
         displayRequest.layerRequests.reserve(layers.size());
         for (int i = 0; i < layers.size(); i++) {
-            auto layerRequest = command::DisplayRequest::LayerRequest{.layer = layers[i],
-                                                                      .mask = layerRequestMasks[i]};
+            auto layerRequest =
+                    DisplayRequest::LayerRequest{.layer = layers[i], .mask = layerRequestMasks[i]};
             displayRequest.layerRequests.emplace_back(std::move(layerRequest));
         }
         mCommandsResults.emplace_back(std::move(displayRequest));
@@ -122,7 +121,7 @@
 
     void setPresentFence(int64_t display, ::ndk::ScopedFileDescriptor presentFence) {
         if (presentFence.get() >= 0) {
-            command::PresentFence presentFenceCommand;
+            PresentFence presentFenceCommand;
             presentFenceCommand.fence = std::move(presentFence);
             presentFenceCommand.display = display;
             mCommandsResults.emplace_back(std::move(presentFenceCommand));
@@ -133,11 +132,11 @@
 
     void setReleaseFences(int64_t display, const std::vector<int64_t>& layers,
                           std::vector<::ndk::ScopedFileDescriptor> releaseFences) {
-        command::ReleaseFences releaseFencesCommand;
+        ReleaseFences releaseFencesCommand;
         releaseFencesCommand.display = display;
         for (int i = 0; i < layers.size(); i++) {
             if (releaseFences[i].get() >= 0) {
-                command::ReleaseFences::Layer layer;
+                ReleaseFences::Layer layer;
                 layer.layer = layers[i];
                 layer.fence = std::move(releaseFences[i]);
                 releaseFencesCommand.layers.emplace_back(std::move(layer));
@@ -150,7 +149,7 @@
 
     void setClientTargetProperty(int64_t display, const ClientTargetProperty& clientTargetProperty,
                                  float whitePointNits) {
-        command::ClientTargetPropertyWithNits clientTargetPropertyWithNits;
+        ClientTargetPropertyWithNits clientTargetPropertyWithNits;
         clientTargetPropertyWithNits.display = display;
         clientTargetPropertyWithNits.clientTargetProperty = clientTargetProperty;
         clientTargetPropertyWithNits.whitePointNits = whitePointNits;
@@ -158,7 +157,7 @@
     }
 
     void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) {
-        command::ColorTransformPayload colorTransformPayload;
+        ColorTransformPayload colorTransformPayload;
         colorTransformPayload.matrix.assign(matrix, matrix + 16);
         colorTransformPayload.hint = hint;
         getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload));
@@ -166,7 +165,7 @@
 
     void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target,
                          int acquireFence, Dataspace dataspace, const std::vector<Rect>& damage) {
-        command::ClientTarget clientTargetCommand;
+        ClientTarget clientTargetCommand;
         clientTargetCommand.buffer = getBuffer(slot, target, acquireFence);
         clientTargetCommand.dataspace = dataspace;
         clientTargetCommand.damage.assign(damage.begin(), damage.end());
@@ -208,7 +207,7 @@
     }
 
     void setLayerBlendMode(int64_t display, int64_t layer, BlendMode mode) {
-        command::ParcelableBlendMode parcelableBlendMode;
+        ParcelableBlendMode parcelableBlendMode;
         parcelableBlendMode.blendMode = mode;
         getLayerCommand(display, layer).blendMode.emplace(std::move(parcelableBlendMode));
     }
@@ -218,13 +217,13 @@
     }
 
     void setLayerCompositionType(int64_t display, int64_t layer, Composition type) {
-        command::ParcelableComposition compositionPayload;
+        ParcelableComposition compositionPayload;
         compositionPayload.composition = type;
         getLayerCommand(display, layer).composition.emplace(std::move(compositionPayload));
     }
 
     void setLayerDataspace(int64_t display, int64_t layer, Dataspace dataspace) {
-        command::ParcelableDataspace dataspacePayload;
+        ParcelableDataspace dataspacePayload;
         dataspacePayload.dataspace = dataspace;
         getLayerCommand(display, layer).dataspace.emplace(std::move(dataspacePayload));
     }
@@ -234,7 +233,7 @@
     }
 
     void setLayerPlaneAlpha(int64_t display, int64_t layer, float alpha) {
-        command::PlaneAlpha planeAlpha;
+        PlaneAlpha planeAlpha;
         planeAlpha.alpha = alpha;
         getLayerCommand(display, layer).planeAlpha.emplace(std::move(planeAlpha));
     }
@@ -250,7 +249,7 @@
     }
 
     void setLayerTransform(int64_t display, int64_t layer, Transform transform) {
-        command::ParcelableTransform transformPayload;
+        ParcelableTransform transformPayload;
         transformPayload.transform = transform;
         getLayerCommand(display, layer).transform.emplace(std::move(transformPayload));
     }
@@ -260,7 +259,7 @@
     }
 
     void setLayerZOrder(int64_t display, int64_t layer, uint32_t z) {
-        command::ZOrder zorder;
+        ZOrder zorder;
         zorder.z = z;
         getLayerCommand(display, layer).z.emplace(std::move(zorder));
     }
@@ -287,7 +286,7 @@
 
     void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key,
                                  const bool mandatory, const std::vector<uint8_t>& value) {
-        command::GenericMetadata metadata;
+        GenericMetadata metadata;
         metadata.key.name = key;
         metadata.key.mandatory = mandatory;
         metadata.value.assign(value.begin(), value.end());
@@ -296,60 +295,64 @@
 
     void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) {
         getLayerCommand(display, layer)
-                .whitePointNits.emplace(command::WhitePointNits{.nits = whitePointNits});
+                .whitePointNits.emplace(WhitePointNits{.nits = whitePointNits});
     }
 
-    const std::vector<command::CommandPayload>& getPendingCommands() {
-        if (mLayerCommand.has_value()) {
-            mCommands.emplace_back(std::move(*mLayerCommand));
-            mLayerCommand.reset();
-        }
-        if (mDisplayCommand.has_value()) {
-            mCommands.emplace_back(std::move(*mDisplayCommand));
-            mDisplayCommand.reset();
-        }
+    const std::vector<DisplayCommand>& getPendingCommands() {
+        flushLayerCommand();
+        flushDisplayCommand();
         return mCommands;
     }
 
-    std::vector<command::CommandResultPayload> getPendingCommandResults() {
+    std::vector<CommandResultPayload> getPendingCommandResults() {
         return std::move(mCommandsResults);
     }
 
   protected:
-    command::Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) {
-        command::Buffer bufferCommand;
+    Buffer getBuffer(int slot, const native_handle_t* bufferHandle, int fence) {
+        Buffer bufferCommand;
         bufferCommand.slot = slot;
         if (bufferHandle) bufferCommand.handle.emplace(::android::dupToAidl(bufferHandle));
         if (fence > 0) bufferCommand.fence = ::ndk::ScopedFileDescriptor(fence);
         return bufferCommand;
     }
 
-    std::optional<command::DisplayCommand> mDisplayCommand;
-    std::optional<command::LayerCommand> mLayerCommand;
-    std::vector<command::CommandPayload> mCommands;
-    std::vector<command::CommandResultPayload> mCommandsResults;
+    std::optional<DisplayCommand> mDisplayCommand;
+    std::optional<LayerCommand> mLayerCommand;
+    std::vector<DisplayCommand> mCommands;
+    std::vector<CommandResultPayload> mCommandsResults;
 
   private:
-    // std::vector<native_handle_t*> mTemporaryHandles;
+    void flushLayerCommand() {
+        if (mLayerCommand.has_value()) {
+            mDisplayCommand->layers.emplace_back(std::move(*mLayerCommand));
+            mLayerCommand.reset();
+        }
+    }
 
-    command::DisplayCommand& getDisplayCommand(int64_t display) {
+    void flushDisplayCommand() {
+        if (mDisplayCommand.has_value()) {
+            mCommands.emplace_back(std::move(*mDisplayCommand));
+            mDisplayCommand.reset();
+        }
+    }
+
+    DisplayCommand& getDisplayCommand(int64_t display) {
         if (!mDisplayCommand.has_value() || mDisplayCommand->display != display) {
-            if (mDisplayCommand.has_value()) mCommands.emplace_back(std::move(*mDisplayCommand));
+            flushLayerCommand();
+            flushDisplayCommand();
             mDisplayCommand.emplace();
             mDisplayCommand->display = display;
-            return *mDisplayCommand;
         }
         return *mDisplayCommand;
     }
 
-    command::LayerCommand& getLayerCommand(int64_t display, int64_t layer) {
-        if (!mLayerCommand.has_value() || mLayerCommand->display != display ||
-            mLayerCommand->layer != layer) {
-            if (mLayerCommand.has_value()) mCommands.emplace_back(std::move(*mLayerCommand));
+    LayerCommand& getLayerCommand(int64_t display, int64_t layer) {
+        getDisplayCommand(display);
+        if (!mLayerCommand.has_value() || mLayerCommand->layer != layer) {
+            flushLayerCommand();
             mLayerCommand.emplace();
-            mLayerCommand->display = display;
             mLayerCommand->layer = layer;
-            return *mLayerCommand;
         }
         return *mLayerCommand;
     }
@@ -361,45 +364,41 @@
 
     // Parse and execute commands from the command queue.  The commands are
     // actually return values from the server and will be saved in ReturnData.
-    void parse(const std::vector<command::CommandResultPayload>& results) {
+    void parse(const std::vector<CommandResultPayload>& results) {
         resetData();
 
         for (const auto& result : results) {
             switch (result.getTag()) {
-                case command::CommandResultPayload::Tag::error:
-                    parseSetError(result.get<command::CommandResultPayload::Tag::error>());
+                case CommandResultPayload::Tag::error:
+                    parseSetError(result.get<CommandResultPayload::Tag::error>());
                     break;
-                case command::CommandResultPayload::Tag::changedCompositionType:
+                case CommandResultPayload::Tag::changedCompositionTypes:
                     parseSetChangedCompositionTypes(
-                            result.get<
-                                    command::CommandResultPayload::Tag::changedCompositionType>());
+                            result.get<CommandResultPayload::Tag::changedCompositionTypes>());
                     break;
-                case command::CommandResultPayload::Tag::displayRequest:
+                case CommandResultPayload::Tag::displayRequest:
                     parseSetDisplayRequests(
-                            result.get<command::CommandResultPayload::Tag::displayRequest>());
+                            result.get<CommandResultPayload::Tag::displayRequest>());
                     break;
-                case command::CommandResultPayload::Tag::presentFence:
-                    parseSetPresentFence(
-                            result.get<command::CommandResultPayload::Tag::presentFence>());
+                case CommandResultPayload::Tag::presentFence:
+                    parseSetPresentFence(result.get<CommandResultPayload::Tag::presentFence>());
                     break;
-                case command::CommandResultPayload::Tag::releaseFences:
-                    parseSetReleaseFences(
-                            result.get<command::CommandResultPayload::Tag::releaseFences>());
+                case CommandResultPayload::Tag::releaseFences:
+                    parseSetReleaseFences(result.get<CommandResultPayload::Tag::releaseFences>());
                     break;
-                case command::CommandResultPayload::Tag::presentOrValidateResult:
+                case CommandResultPayload::Tag::presentOrValidateResult:
                     parseSetPresentOrValidateDisplayResult(
-                            result.get<
-                                    command::CommandResultPayload::Tag::presentOrValidateResult>());
+                            result.get<CommandResultPayload::Tag::presentOrValidateResult>());
                     break;
-                case command::CommandResultPayload::Tag::clientTargetProperty:
+                case CommandResultPayload::Tag::clientTargetProperty:
                     parseSetClientTargetProperty(
-                            result.get<command::CommandResultPayload::Tag::clientTargetProperty>());
+                            result.get<CommandResultPayload::Tag::clientTargetProperty>());
                     break;
             }
         }
     }
 
-    std::vector<command::Error> takeErrors() { return std::move(mErrors); }
+    std::vector<CommandError> takeErrors() { return std::move(mErrors); }
 
     bool hasChanges(int64_t display, uint32_t* outNumChangedCompositionTypes,
                     uint32_t* outNumLayerRequestMasks) const {
@@ -530,10 +529,9 @@
         mReturnData.clear();
     }
 
-    void parseSetError(const command::Error& error) { mErrors.emplace_back(error); }
+    void parseSetError(const CommandError& error) { mErrors.emplace_back(error); }
 
-    void parseSetChangedCompositionTypes(
-            const command::ChangedCompositionTypes& changedCompositionTypes) {
+    void parseSetChangedCompositionTypes(const ChangedCompositionTypes& changedCompositionTypes) {
         auto& data = mReturnData[changedCompositionTypes.display];
 
         data.changedLayers.reserve(changedCompositionTypes.layers.size());
@@ -544,7 +542,7 @@
         }
     }
 
-    void parseSetDisplayRequests(const command::DisplayRequest& displayRequest) {
+    void parseSetDisplayRequests(const DisplayRequest& displayRequest) {
         auto& data = mReturnData[displayRequest.display];
 
         data.displayRequests = displayRequest.mask;
@@ -556,7 +554,7 @@
         }
     }
 
-    void parseSetPresentFence(const command::PresentFence& presentFence) {
+    void parseSetPresentFence(const PresentFence& presentFence) {
         auto& data = mReturnData[presentFence.display];
         if (data.presentFence >= 0) {
             close(data.presentFence);
@@ -564,7 +562,7 @@
         data.presentFence = dup(presentFence.fence.get());
     }
 
-    void parseSetReleaseFences(const command::ReleaseFences& releaseFences) {
+    void parseSetReleaseFences(const ReleaseFences& releaseFences) {
         auto& data = mReturnData[releaseFences.display];
         data.releasedLayers.reserve(releaseFences.layers.size());
         data.releaseFences.reserve(releaseFences.layers.size());
@@ -574,15 +572,13 @@
         }
     }
 
-    void parseSetPresentOrValidateDisplayResult(
-            const command::PresentOrValidate& presentOrValidate) {
+    void parseSetPresentOrValidateDisplayResult(const PresentOrValidate& presentOrValidate) {
         auto& data = mReturnData[presentOrValidate.display];
         data.presentOrValidateState =
-                presentOrValidate.result == command::PresentOrValidate::Result::Presented ? 1 : 0;
+                presentOrValidate.result == PresentOrValidate::Result::Presented ? 1 : 0;
     }
 
-    void parseSetClientTargetProperty(
-            const command::ClientTargetPropertyWithNits& clientTargetProperty) {
+    void parseSetClientTargetProperty(const ClientTargetPropertyWithNits& clientTargetProperty) {
         auto& data = mReturnData[clientTargetProperty.display];
         data.clientTargetProperty.pixelFormat =
                 clientTargetProperty.clientTargetProperty.pixelFormat;
@@ -611,7 +607,7 @@
         float clientTargetWhitePointNits = -1.f;
     };
 
-    std::vector<command::Error> mErrors;
+    std::vector<CommandError> mErrors;
     std::unordered_map<int64_t, ReturnData> mReturnData;
 };