Deprecate producer/consumer usage: Step 2

Clean up bufferhub_rpc, display_rpc and service side producer/consumer
usage reference.

Next (final) step is to remove all remaining client side reference to
producer/consumer usage and update dvr_xxx API.

This also fixes a minor typo in dvr_named_buffer-test

Bug: 37881101
Test: Build, flash, ran particles.apk and buffer_hub_queue-test
Change-Id: Ibae4376c1fd1ed964843d8b2ad2fb27204fe5e28
diff --git a/services/vr/bufferhubd/buffer_hub.cpp b/services/vr/bufferhubd/buffer_hub.cpp
index 4b1a522..8093b6b 100644
--- a/services/vr/bufferhubd/buffer_hub.cpp
+++ b/services/vr/bufferhubd/buffer_hub.cpp
@@ -53,7 +53,7 @@
   stream << " ";
   stream << std::setw(6) << "Format";
   stream << " ";
-  stream << std::setw(21) << "Usage";
+  stream << std::setw(11) << "Usage";
   stream << " ";
   stream << "Name";
   stream << std::endl;
@@ -80,9 +80,7 @@
       stream << std::setw(6) << info.format;
       stream << " ";
       stream << "0x" << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.producer_usage;
-      stream << "0x";
-      stream << std::setw(8) << info.consumer_usage;
+      stream << std::setw(8) << info.usage;
       stream << std::dec << std::setfill(' ');
       stream << " ";
       stream << info.name;
@@ -140,10 +138,6 @@
   stream << " UsageClearMask";
   stream << " UsageDenySetMask";
   stream << " UsageDenyClearMask";
-  stream << " UsageSetMask";
-  stream << " UsageClearMask";
-  stream << " UsageDenySetMask";
-  stream << " UsageDenyClearMask";
   stream << " ";
   stream << std::endl;
 
@@ -157,28 +151,16 @@
       stream << std::right << std::setw(12) << info.consumer_count;
       stream << std::setw(5) << std::setfill(' ') << "0x";
       stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.producer_set_mask;
+      stream << std::setw(8) << info.usage_policy.usage_set_mask;
       stream << std::setw(7) << std::setfill(' ') << "0x";
       stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.producer_clear_mask;
+      stream << std::setw(8) << info.usage_policy.usage_clear_mask;
       stream << std::setw(9) << std::setfill(' ') << "0x";
       stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.producer_deny_set_mask;
+      stream << std::setw(8) << info.usage_policy.usage_deny_set_mask;
       stream << std::setw(11) << std::setfill(' ') << "0x";
       stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.producer_deny_clear_mask;
-      stream << std::setw(5) << std::setfill(' ') << "0x";
-      stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.consumer_set_mask;
-      stream << std::setw(7) << std::setfill(' ') << "0x";
-      stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.consumer_clear_mask;
-      stream << std::setw(9) << std::setfill(' ') << "0x";
-      stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.consumer_deny_set_mask;
-      stream << std::setw(11) << std::setfill(' ') << "0x";
-      stream << std::hex << std::setfill('0');
-      stream << std::setw(8) << info.usage_policy.consumer_deny_clear_mask;
+      stream << std::setw(8) << info.usage_policy.usage_deny_clear_mask;
       stream << std::hex << std::setfill('0');
       stream << std::endl;
     }
@@ -259,18 +241,16 @@
 
 Status<void> BufferHubService::OnCreateBuffer(Message& message, uint32_t width,
                                               uint32_t height, uint32_t format,
-                                              uint64_t producer_usage,
-                                              uint64_t consumer_usage,
+                                              uint64_t usage,
                                               size_t meta_size_bytes,
                                               size_t slice_count) {
   // Use the producer channel id as the global buffer id.
   const int buffer_id = message.GetChannelId();
   ALOGD_IF(TRACE,
            "BufferHubService::OnCreateBuffer: buffer_id=%d width=%u height=%u "
-           "format=%u producer_usage=%" PRIx64 " consumer_usage=%" PRIx64
-           " meta_size_bytes=%zu slice_count=%zu",
-           buffer_id, width, height, format, producer_usage, consumer_usage,
-           meta_size_bytes, slice_count);
+           "format=%u usage=%" PRIx64 " meta_size_bytes=%zu slice_count=%zu",
+           buffer_id, width, height, format, usage, meta_size_bytes,
+           slice_count);
 
   // See if this channel is already attached to a buffer.
   if (const auto channel = message.GetChannel<BufferHubChannel>()) {
@@ -280,8 +260,7 @@
   }
 
   auto status = ProducerChannel::Create(this, buffer_id, width, height, format,
-                                        producer_usage, consumer_usage,
-                                        meta_size_bytes, slice_count);
+                                        usage, meta_size_bytes, slice_count);
   if (status) {
     message.SetChannel(status.take());
     return {};
@@ -294,16 +273,15 @@
 
 Status<void> BufferHubService::OnCreatePersistentBuffer(
     Message& message, const std::string& name, int user_id, int group_id,
-    uint32_t width, uint32_t height, uint32_t format, uint64_t producer_usage,
-    uint64_t consumer_usage, size_t meta_size_bytes, size_t slice_count) {
+    uint32_t width, uint32_t height, uint32_t format, uint64_t usage,
+    size_t meta_size_bytes, size_t slice_count) {
   const int channel_id = message.GetChannelId();
   ALOGD_IF(TRACE,
            "BufferHubService::OnCreatePersistentBuffer: channel_id=%d name=%s "
            "user_id=%d group_id=%d width=%u height=%u format=%u "
-           "producer_usage=%" PRIx64 " consumer_usage=%" PRIx64
-           " meta_size_bytes=%zu slice_count=%zu",
+           "usage=%" PRIx64 " meta_size_bytes=%zu slice_count=%zu",
            channel_id, name.c_str(), user_id, group_id, width, height, format,
-           producer_usage, consumer_usage, meta_size_bytes, slice_count);
+           usage, meta_size_bytes, slice_count);
 
   // See if this channel is already attached to a buffer.
   if (const auto channel = message.GetChannel<BufferHubChannel>()) {
@@ -324,9 +302,8 @@
           "not have permission to access named buffer: name=%s euid=%d egid=%d",
           name.c_str(), euid, euid);
       return ErrorStatus(EPERM);
-    } else if (!buffer->CheckParameters(width, height, format, producer_usage,
-                                        consumer_usage, meta_size_bytes,
-                                        slice_count)) {
+    } else if (!buffer->CheckParameters(width, height, format, usage,
+                                        meta_size_bytes, slice_count)) {
       ALOGE(
           "BufferHubService::OnCreatePersistentBuffer: Requested an existing "
           "buffer with different parameters: name=%s",
@@ -344,9 +321,9 @@
       return {};
     }
   } else {
-    auto status = ProducerChannel::Create(
-        this, channel_id, width, height, format, producer_usage, consumer_usage,
-        meta_size_bytes, slice_count);
+    auto status =
+        ProducerChannel::Create(this, channel_id, width, height, format, usage,
+                                meta_size_bytes, slice_count);
     if (!status) {
       ALOGE("BufferHubService::OnCreateBuffer: Failed to create producer!!");
       return status.error_status();