Synchronize IDAStub with discardable handle registration.

This CL modifies ImageDecodeAcceleratorStub so that completed decodes
are processed only after we're sure that the buffer of a discardable
handle corresponding to a decode request is registered in the transfer
buffer manager. This requires introducing a sync token that is inserted
in the command buffer after requesting the creation of the discardable
handle in the client.

The release count of this new sync token is plumbed from the client to
the service and a test is added to verify the new behavior.

Test: added unit test for the new behavior.
Bug: 868400
Change-Id: If9dcddc6ebdaea4e28433bf582d9e5fbaa251bd2
Reviewed-by: Robert Sesek <>
Reviewed-by: Antoine Labour <>
Reviewed-by: Sunny Sachanandani <>
Commit-Queue: Andres Calderon Jaramillo <>
Cr-Commit-Position: refs/heads/master@{#631871}
8 files changed