Merge "Switch touch input device on hover events." into oc-dev
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index ed53af1..f8e0ad5 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -450,8 +450,8 @@
         return false;
     }
 
-    char buf[100];
-    ssize_t n = read(fd, buf, 99);
+    char buf[4097];
+    ssize_t n = read(fd, buf, 4096);
     close(fd);
     if (n == -1) {
         fprintf(stderr, "error reading %s: %s (%d)\n", k_traceClockPath,
@@ -475,38 +475,13 @@
     return strcmp(mode, start) == 0;
 }
 
-// Read the trace_clock sysfs file and return true if it contains the requested
-// value.  The trace_clock file format is:
-// local [global] counter uptime perf
-static bool traceClockContains(const char *mode)
-{
-    int fd = open((g_traceFolder + k_traceClockPath).c_str(), O_RDONLY);
-    if (fd == -1) {
-        fprintf(stderr, "error opening %s: %s (%d)\n", k_traceClockPath,
-            strerror(errno), errno);
-        return false;
-    }
-
-    char buf[100];
-    ssize_t n = read(fd, buf, 99);
-    close(fd);
-    if (n == -1) {
-        fprintf(stderr, "error reading %s: %s (%d)\n", k_traceClockPath,
-            strerror(errno), errno);
-        return false;
-    }
-    buf[n] = '\0';
-
-    return strstr(buf, mode) != NULL;
-}
-
-// Set the clock to the best available option while tracing. Use 'boot' if it's
-// available; otherwise, use 'mono'.
+// Enable or disable the kernel's use of the global clock.  Disabling the global
+// clock will result in the kernel using a per-CPU local clock.
 // Any write to the trace_clock sysfs file will reset the buffer, so only
 // update it if the requested value is not the current value.
-static bool setClock()
+static bool setGlobalClockEnable(bool enable)
 {
-    const char* clock = traceClockContains("boot") ? "boot" : "mono";
+    const char *clock = enable ? "global" : "local";
 
     if (isTraceClock(clock)) {
         return true;
@@ -808,7 +783,7 @@
     ok &= setCategoriesEnableFromFile(g_categoriesFile);
     ok &= setTraceOverwriteEnable(g_traceOverwrite);
     ok &= setTraceBufferSizeKB(g_traceBufferSizeKB);
-    ok &= setClock();
+    ok &= setGlobalClockEnable(true);
     ok &= setPrintTgidEnableIfPresent(true);
     ok &= setKernelTraceFuncs(g_kernelTraceFuncs);
 
@@ -884,6 +859,7 @@
     // Set the options back to their defaults.
     setTraceOverwriteEnable(true);
     setTraceBufferSizeKB(1);
+    setGlobalClockEnable(false);
     setPrintTgidEnableIfPresent(false);
     setKernelTraceFuncs(NULL);
 }
diff --git a/cmds/atrace/atrace.rc b/cmds/atrace/atrace.rc
index cfd2659..cef41be 100644
--- a/cmds/atrace/atrace.rc
+++ b/cmds/atrace/atrace.rc
@@ -124,10 +124,6 @@
     write /sys/kernel/debug/tracing/tracing_on 0
     write /sys/kernel/tracing/tracing_on 0
 
-    # Set the trace clock to boot if it exists, falling back to mono if not.
-    write /d/tracing/trace_clock mono
-    write /d/tracing/trace_clock boot
-
 # Allow only the shell group to read and truncate the kernel trace.
     chown root shell /sys/kernel/debug/tracing/trace
     chown root shell /sys/kernel/tracing/trace
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 5dad511..f84d86d 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -998,13 +998,8 @@
     for_each_tid(show_wchan, "BLOCKED PROCESS WAIT-CHANNELS");
     for_each_pid(show_showtime, "PROCESS TIMES (pid cmd user system iowait+percentage)");
 
-    if (true) {
-        // TODO: temporary disabled because /data/misc/bluetooth/logs/btsnoop_hci.log can be huge
-        MYLOGD("Skipping /data/misc/bluetooth/logs");
-    } else {
-        /* Dump Bluetooth HCI logs */
-        ds.AddDir("/data/misc/bluetooth/logs", true);
-    }
+    /* Dump Bluetooth HCI logs */
+    ds.AddDir("/data/misc/bluetooth/logs", true);
 
     if (!ds.do_early_screenshot_) {
         MYLOGI("taking late screenshot\n");
diff --git a/libs/vr/libbufferhub/buffer_hub_client.cpp b/libs/vr/libbufferhub/buffer_hub_client.cpp
index a1f952e..60dbe92 100644
--- a/libs/vr/libbufferhub/buffer_hub_client.cpp
+++ b/libs/vr/libbufferhub/buffer_hub_client.cpp
@@ -199,26 +199,18 @@
 }
 
 BufferProducer::BufferProducer(uint32_t width, uint32_t height, uint32_t format,
-                               uint32_t usage, size_t metadata_size,
+                               uint64_t usage, size_t metadata_size,
                                size_t slice_count)
-    : BufferProducer(width, height, format, usage, usage, metadata_size,
-                     slice_count) {}
-
-BufferProducer::BufferProducer(uint32_t width, uint32_t height, uint32_t format,
-                               uint64_t producer_usage, uint64_t consumer_usage,
-                               size_t metadata_size, size_t slice_count)
     : BASE(BufferHubRPC::kClientPath) {
   ATRACE_NAME("BufferProducer::BufferProducer");
   ALOGD_IF(TRACE,
            "BufferProducer::BufferProducer: fd=%d width=%u height=%u format=%u "
-           "producer_usage=%" PRIx64 " consumer_usage=%" PRIx64
-           " metadata_size=%zu slice_count=%zu",
-           event_fd(), width, height, format, producer_usage, consumer_usage,
-           metadata_size, slice_count);
+           "usage=%" PRIx64 " metadata_size=%zu slice_count=%zu",
+           event_fd(), width, height, format, usage, metadata_size,
+           slice_count);
 
   auto status = InvokeRemoteMethod<BufferHubRPC::CreateBuffer>(
-      width, height, format, producer_usage, consumer_usage, metadata_size,
-      slice_count);
+      width, height, format, usage, metadata_size, slice_count);
   if (!status) {
     ALOGE(
         "BufferProducer::BufferProducer: Failed to create producer buffer: %s",
@@ -238,28 +230,20 @@
 
 BufferProducer::BufferProducer(const std::string& name, int user_id,
                                int group_id, uint32_t width, uint32_t height,
-                               uint32_t format, uint32_t usage,
+                               uint32_t format, uint64_t usage,
                                size_t meta_size_bytes, size_t slice_count)
-    : BufferProducer(name, user_id, group_id, width, height, format, usage,
-                     usage, meta_size_bytes, slice_count) {}
-
-BufferProducer::BufferProducer(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)
     : BASE(BufferHubRPC::kClientPath) {
   ATRACE_NAME("BufferProducer::BufferProducer");
   ALOGD_IF(TRACE,
            "BufferProducer::BufferProducer: fd=%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",
+           "group_id=%d width=%u height=%u format=%u usage=%" PRIx64
+           " meta_size_bytes=%zu slice_count=%zu",
            event_fd(), 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);
 
   auto status = InvokeRemoteMethod<BufferHubRPC::CreatePersistentBuffer>(
-      name, user_id, group_id, width, height, format, producer_usage,
-      consumer_usage, meta_size_bytes, slice_count);
+      name, user_id, group_id, width, height, format, usage, meta_size_bytes,
+      slice_count);
   if (!status) {
     ALOGE(
         "BufferProducer::BufferProducer: Failed to create/get persistent "
@@ -279,24 +263,19 @@
   }
 }
 
-BufferProducer::BufferProducer(uint32_t usage, size_t size)
-    : BufferProducer(usage, usage, size) {}
-
-BufferProducer::BufferProducer(uint64_t producer_usage, uint64_t consumer_usage,
-                               size_t size)
+BufferProducer::BufferProducer(uint64_t usage, size_t size)
     : BASE(BufferHubRPC::kClientPath) {
   ATRACE_NAME("BufferProducer::BufferProducer");
-  ALOGD_IF(TRACE,
-           "BufferProducer::BufferProducer: producer_usage=%" PRIx64
-           " consumer_usage=%" PRIx64 " size=%zu",
-           producer_usage, consumer_usage, size);
+  ALOGD_IF(TRACE, "BufferProducer::BufferProducer: usage=%" PRIx64 " size=%zu",
+           usage, size);
   const int width = static_cast<int>(size);
   const int height = 1;
   const int format = HAL_PIXEL_FORMAT_BLOB;
   const size_t meta_size_bytes = 0;
   const size_t slice_count = 1;
+
   auto status = InvokeRemoteMethod<BufferHubRPC::CreateBuffer>(
-      width, height, format, producer_usage, consumer_usage, meta_size_bytes,
+      width, height, format, usage, meta_size_bytes,
       slice_count);
   if (!status) {
     ALOGE("BufferProducer::BufferProducer: Failed to create blob: %s",
@@ -315,27 +294,22 @@
 }
 
 BufferProducer::BufferProducer(const std::string& name, int user_id,
-                               int group_id, uint32_t usage, size_t size)
-    : BufferProducer(name, user_id, group_id, usage, usage, size) {}
-
-BufferProducer::BufferProducer(const std::string& name, int user_id,
-                               int group_id, uint64_t producer_usage,
-                               uint64_t consumer_usage, size_t size)
+                               int group_id, uint64_t usage, size_t size)
     : BASE(BufferHubRPC::kClientPath) {
   ATRACE_NAME("BufferProducer::BufferProducer");
   ALOGD_IF(TRACE,
            "BufferProducer::BufferProducer: name=%s user_id=%d group=%d "
-           "producer_usage=%" PRIx64 " consumer_usage=%" PRIx64 " size=%zu",
-           name.c_str(), user_id, group_id, producer_usage, consumer_usage,
-           size);
+           "usage=%" PRIx64 " size=%zu",
+           name.c_str(), user_id, group_id, usage, size);
   const int width = static_cast<int>(size);
   const int height = 1;
   const int format = HAL_PIXEL_FORMAT_BLOB;
   const size_t meta_size_bytes = 0;
   const size_t slice_count = 1;
+
   auto status = InvokeRemoteMethod<BufferHubRPC::CreatePersistentBuffer>(
-      name, user_id, group_id, width, height, format, producer_usage,
-      consumer_usage, meta_size_bytes, slice_count);
+      name, user_id, group_id, width, height, format, usage, meta_size_bytes,
+      slice_count);
   if (!status) {
     ALOGE(
         "BufferProducer::BufferProducer: Failed to create persistent "
diff --git a/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h b/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
index dbd4110..16ddad7 100644
--- a/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
+++ b/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
@@ -111,13 +111,9 @@
   uint32_t height() const { return slices_[0].height(); }
   uint32_t stride() const { return slices_[0].stride(); }
   uint32_t format() const { return slices_[0].format(); }
-  uint32_t usage() const { return slices_[0].usage(); }
+  uint64_t usage() const { return slices_[0].usage(); }
   uint32_t layer_count() const { return slices_[0].layer_count(); }
 
-  // TODO(b/37881101) Clean up producer/consumer usage.
-  uint64_t producer_usage() const { return slices_[0].usage(); }
-  uint64_t consumer_usage() const { return slices_[0].usage(); }
-
  protected:
   explicit BufferHubBuffer(LocalChannelHandle channel);
   explicit BufferHubBuffer(const std::string& endpoint_path);
@@ -224,11 +220,8 @@
 
   // Constructs a buffer with the given geometry and parameters.
   BufferProducer(uint32_t width, uint32_t height, uint32_t format,
-                 uint32_t usage, size_t metadata_size = 0,
+                 uint64_t usage, size_t metadata_size = 0,
                  size_t slice_count = 1);
-  BufferProducer(uint32_t width, uint32_t height, uint32_t format,
-                 uint64_t producer_usage, uint64_t consumer_usage,
-                 size_t metadata_size, size_t slice_count);
 
   // Constructs a persistent buffer with the given geometry and parameters and
   // binds it to |name| in one shot. If a persistent buffer with the same name
@@ -244,22 +237,15 @@
   // effective user or group id of the calling process.
   BufferProducer(const std::string& name, int user_id, int group_id,
                  uint32_t width, uint32_t height, uint32_t format,
-                 uint32_t usage, size_t metadata_size = 0,
+                 uint64_t usage, size_t metadata_size = 0,
                  size_t slice_count = 1);
-  BufferProducer(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 metadata_size, size_t slice_count);
 
   // Constructs a blob (flat) buffer with the given usage flags.
-  BufferProducer(uint32_t usage, size_t size);
-  BufferProducer(uint64_t producer_usage, uint64_t consumer_usage, size_t size);
+  BufferProducer(uint64_t usage, size_t size);
 
   // Constructs a persistent blob (flat) buffer and binds it to |name|.
   BufferProducer(const std::string& name, int user_id, int group_id,
-                 uint32_t usage, size_t size);
-  BufferProducer(const std::string& name, int user_id, int group_id,
-                 uint64_t producer_usage, uint64_t consumer_usage, size_t size);
+                 uint64_t usage, size_t size);
 
   // Constructs a channel to persistent buffer by name only. The buffer must
   // have been previously created or made persistent.
diff --git a/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h b/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h
index 02e9f27..c6f0e1e 100644
--- a/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h
+++ b/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h
@@ -24,8 +24,7 @@
         width_(buffer.width()),
         height_(buffer.height()),
         format_(buffer.format()),
-        producer_usage_(buffer.usage()),
-        consumer_usage_(buffer.usage()) {
+        usage_(buffer.usage()) {
     // Populate the fd and int vectors: native_handle->data[] is an array of fds
     // followed by an array of opaque ints.
     const int fd_count = buffer.handle()->numFds;
@@ -48,11 +47,9 @@
     for (const auto& fd : fds_)
       fd_ints.push_back(fd.Get());
 
-    // TODO(b/37881101) Get rid of producer/consumer usage.
-    const int ret =
-        buffer->Import(fd_ints.data(), fd_ints.size(), opaque_ints_.data(),
-                       opaque_ints_.size(), width_, height_, stride_, format_,
-                       (producer_usage_ | consumer_usage_));
+    const int ret = buffer->Import(fd_ints.data(), fd_ints.size(),
+                                   opaque_ints_.data(), opaque_ints_.size(),
+                                   width_, height_, stride_, format_, usage_);
     if (ret < 0)
       return ret;
 
@@ -76,20 +73,18 @@
   uint32_t width_;
   uint32_t height_;
   uint32_t format_;
-  uint64_t producer_usage_;
-  uint64_t consumer_usage_;
+  uint64_t usage_;
   std::vector<int> opaque_ints_;
   std::vector<FileHandleType> fds_;
 
   void Clear() {
     id_ = -1;
-    stride_ = width_ = height_ = format_ = producer_usage_ = consumer_usage_ =
-        0;
+    stride_ = width_ = height_ = format_ = usage_ = 0;
   }
 
   PDX_SERIALIZABLE_MEMBERS(NativeBufferHandle<FileHandleType>, id_, stride_,
-                           width_, height_, format_, producer_usage_,
-                           consumer_usage_, opaque_ints_, fds_);
+                           width_, height_, format_, usage_, opaque_ints_,
+                           fds_);
 
   NativeBufferHandle(const NativeBufferHandle&) = delete;
   void operator=(const NativeBufferHandle&) = delete;
@@ -140,20 +135,14 @@
 };
 
 struct UsagePolicy {
-  uint64_t producer_set_mask;
-  uint64_t producer_clear_mask;
-  uint64_t producer_deny_set_mask;
-  uint64_t producer_deny_clear_mask;
-  uint64_t consumer_set_mask;
-  uint64_t consumer_clear_mask;
-  uint64_t consumer_deny_set_mask;
-  uint64_t consumer_deny_clear_mask;
+  uint64_t usage_set_mask;
+  uint64_t usage_clear_mask;
+  uint64_t usage_deny_set_mask;
+  uint64_t usage_deny_clear_mask;
 
  private:
-  PDX_SERIALIZABLE_MEMBERS(UsagePolicy, producer_set_mask, producer_clear_mask,
-                           producer_deny_set_mask, producer_deny_clear_mask,
-                           consumer_set_mask, consumer_clear_mask,
-                           consumer_deny_set_mask, consumer_deny_clear_mask);
+  PDX_SERIALIZABLE_MEMBERS(UsagePolicy, usage_set_mask, usage_clear_mask,
+                           usage_deny_set_mask, usage_deny_clear_mask);
 };
 
 // BufferHub Service RPC interface. Defines the endpoints, op codes, and method
@@ -203,13 +192,13 @@
   // Methods.
   PDX_REMOTE_METHOD(CreateBuffer, kOpCreateBuffer,
                     void(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));
+                         uint64_t usage, size_t meta_size_bytes,
+                         size_t slice_count));
   PDX_REMOTE_METHOD(CreatePersistentBuffer, kOpCreatePersistentBuffer,
                     void(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));
+                         uint64_t usage, size_t meta_size_bytes,
+                         size_t slice_count));
   PDX_REMOTE_METHOD(GetPersistentBuffer, kOpGetPersistentBuffer,
                     void(const std::string& name));
   PDX_REMOTE_METHOD(GetBuffer, kOpGetBuffer,
@@ -241,8 +230,8 @@
                     kOpProducerQueueAllocateBuffers,
                     std::vector<std::pair<LocalChannelHandle, size_t>>(
                         uint32_t width, uint32_t height, uint32_t format,
-                        uint64_t producer_usage, uint64_t consumer_usage,
-                        size_t slice_count, size_t buffer_count));
+                        uint64_t usage, size_t slice_count,
+                        size_t buffer_count));
   PDX_REMOTE_METHOD(ProducerQueueDetachBuffer, kOpProducerQueueDetachBuffer,
                     void(size_t slot));
   PDX_REMOTE_METHOD(ConsumerQueueImportBuffers, kOpConsumerQueueImportBuffers,
diff --git a/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp b/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp
index b431d2f..5b85069 100644
--- a/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp
+++ b/libs/vr/libbufferhubqueue/buffer_hub_queue_client.cpp
@@ -317,7 +317,7 @@
 }
 
 ProducerQueue::ProducerQueue(size_t meta_size)
-    : ProducerQueue(meta_size, 0, 0, 0, 0, 0, 0, 0, 0) {}
+    : ProducerQueue(meta_size, 0, 0, 0, 0) {}
 
 ProducerQueue::ProducerQueue(LocalChannelHandle handle)
     : BASE(std::move(handle)) {
@@ -329,22 +329,14 @@
   }
 }
 
-ProducerQueue::ProducerQueue(size_t meta_size, uint64_t producer_usage_set_mask,
-                             uint64_t producer_usage_clear_mask,
-                             uint64_t producer_usage_deny_set_mask,
-                             uint64_t producer_usage_deny_clear_mask,
-                             uint64_t consumer_usage_set_mask,
-                             uint64_t consumer_usage_clear_mask,
-                             uint64_t consumer_usage_deny_set_mask,
-                             uint64_t consumer_usage_deny_clear_mask)
+ProducerQueue::ProducerQueue(size_t meta_size, uint64_t usage_set_mask,
+                             uint64_t usage_clear_mask,
+                             uint64_t usage_deny_set_mask,
+                             uint64_t usage_deny_clear_mask)
     : BASE(BufferHubRPC::kClientPath) {
   auto status = InvokeRemoteMethod<BufferHubRPC::CreateProducerQueue>(
-      meta_size,
-      UsagePolicy{producer_usage_set_mask, producer_usage_clear_mask,
-                  producer_usage_deny_set_mask, producer_usage_deny_clear_mask,
-                  consumer_usage_set_mask, consumer_usage_clear_mask,
-                  consumer_usage_deny_set_mask,
-                  consumer_usage_deny_clear_mask});
+      meta_size, UsagePolicy{usage_set_mask, usage_clear_mask,
+                             usage_deny_set_mask, usage_deny_clear_mask});
   if (!status) {
     ALOGE("ProducerQueue::ProducerQueue: Failed to create producer queue: %s",
           status.GetErrorMessage().c_str());
@@ -356,16 +348,8 @@
 }
 
 int ProducerQueue::AllocateBuffer(uint32_t width, uint32_t height,
-                                  uint32_t format, uint32_t usage,
+                                  uint32_t format, uint64_t usage,
                                   size_t slice_count, size_t* out_slot) {
-  return AllocateBuffer(width, height, format, usage, usage, slice_count,
-                        out_slot);
-}
-
-int ProducerQueue::AllocateBuffer(uint32_t width, uint32_t height,
-                                  uint32_t format, uint64_t producer_usage,
-                                  uint64_t consumer_usage, size_t slice_count,
-                                  size_t* out_slot) {
   if (out_slot == nullptr) {
     ALOGE("ProducerQueue::AllocateBuffer: Parameter out_slot cannot be null.");
     return -EINVAL;
@@ -378,11 +362,9 @@
   }
 
   const size_t kBufferCount = 1U;
-
   Status<std::vector<std::pair<LocalChannelHandle, size_t>>> status =
       InvokeRemoteMethod<BufferHubRPC::ProducerQueueAllocateBuffers>(
-          width, height, format, producer_usage, consumer_usage, slice_count,
-          kBufferCount);
+          width, height, format, usage, slice_count, kBufferCount);
   if (!status) {
     ALOGE(
         "ProducerQueue::AllocateBuffer failed to create producer buffer "
diff --git a/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h b/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
index 6467c3c..1eafe76 100644
--- a/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
+++ b/libs/vr/libbufferhubqueue/include/private/dvr/buffer_hub_queue_client.h
@@ -279,22 +279,7 @@
                                                uint32_t usage_deny_set_mask,
                                                uint32_t usage_deny_clear_mask) {
     return BASE::Create(sizeof(Meta), usage_set_mask, usage_clear_mask,
-                        usage_deny_set_mask, usage_deny_clear_mask,
-                        usage_set_mask, usage_clear_mask, usage_deny_set_mask,
-                        usage_deny_clear_mask);
-  }
-  template <typename Meta>
-  static std::unique_ptr<ProducerQueue> Create(
-      uint64_t producer_usage_set_mask, uint64_t producer_usage_clear_mask,
-      uint64_t producer_usage_deny_set_mask,
-      uint64_t producer_usage_deny_clear_mask, uint64_t consumer_usage_set_mask,
-      uint64_t consumer_usage_clear_mask, uint64_t consumer_usage_deny_set_mask,
-      uint64_t consumer_usage_deny_clear_mask) {
-    return BASE::Create(sizeof(Meta), producer_usage_set_mask,
-                        producer_usage_clear_mask, producer_usage_deny_set_mask,
-                        producer_usage_deny_clear_mask, consumer_usage_set_mask,
-                        consumer_usage_clear_mask, consumer_usage_deny_set_mask,
-                        consumer_usage_deny_clear_mask);
+                        usage_deny_set_mask, usage_deny_clear_mask);
   }
 
   // Import a |ProducerQueue| from a channel handle.
@@ -317,10 +302,7 @@
   // Returns Zero on success and negative error code when buffer allocation
   // fails.
   int AllocateBuffer(uint32_t width, uint32_t height, uint32_t format,
-                     uint32_t usage, size_t slice_count, size_t* out_slot);
-  int AllocateBuffer(uint32_t width, uint32_t height, uint32_t format,
-                     uint64_t producer_usage, uint64_t consumer_usage,
-                     size_t slice_count, size_t* out_slot);
+                     uint64_t usage, size_t slice_count, size_t* out_slot);
 
   // Add a producer buffer to populate the queue. Once added, a producer buffer
   // is available to use (i.e. in |Gain|'ed mode).
@@ -345,14 +327,9 @@
   // arguments as the constructors.
   explicit ProducerQueue(size_t meta_size);
   ProducerQueue(LocalChannelHandle handle);
-  ProducerQueue(size_t meta_size, uint64_t producer_usage_set_mask,
-                uint64_t producer_usage_clear_mask,
-                uint64_t producer_usage_deny_set_mask,
-                uint64_t producer_usage_deny_clear_mask,
-                uint64_t consumer_usage_set_mask,
-                uint64_t consumer_usage_clear_mask,
-                uint64_t consumer_usage_deny_set_mask,
-                uint64_t consumer_usage_deny_clear_mask);
+  ProducerQueue(size_t meta_size, uint64_t usage_set_mask,
+                uint64_t usage_clear_mask, uint64_t usage_deny_set_mask,
+                uint64_t usage_deny_clear_mask);
 
   int OnBufferReady(std::shared_ptr<BufferHubBuffer> buf,
                     LocalHandle* release_fence) override;
diff --git a/libs/vr/libdisplay/display_manager_client_impl.cpp b/libs/vr/libdisplay/display_manager_client_impl.cpp
index 44b3c4b..941da23 100644
--- a/libs/vr/libdisplay/display_manager_client_impl.cpp
+++ b/libs/vr/libdisplay/display_manager_client_impl.cpp
@@ -32,10 +32,9 @@
 }
 
 std::unique_ptr<IonBuffer> DisplayManagerClient::SetupNamedBuffer(
-    const std::string& name, size_t size, uint64_t producer_usage,
-    uint64_t consumer_usage) {
+    const std::string& name, size_t size, uint64_t usage) {
   auto status = InvokeRemoteMethod<DisplayManagerRPC::SetupNamedBuffer>(
-      name, size, producer_usage, consumer_usage);
+      name, size, usage);
   if (!status) {
     ALOGE(
         "DisplayManagerClient::SetupNamedBuffer: Failed to create the named "
diff --git a/libs/vr/libdisplay/include/private/dvr/display_manager_client_impl.h b/libs/vr/libdisplay/include/private/dvr/display_manager_client_impl.h
index b0a7d13..e09a440 100644
--- a/libs/vr/libdisplay/include/private/dvr/display_manager_client_impl.h
+++ b/libs/vr/libdisplay/include/private/dvr/display_manager_client_impl.h
@@ -19,8 +19,7 @@
 
   std::unique_ptr<IonBuffer> SetupNamedBuffer(const std::string& name,
                                               size_t size,
-                                              uint64_t producer_usage,
-                                              uint64_t consumer_usage);
+                                              uint64_t usage);
 
   using Client::event_fd;
   using Client::GetChannel;
diff --git a/libs/vr/libdisplay/include/private/dvr/display_rpc.h b/libs/vr/libdisplay/include/private/dvr/display_rpc.h
index 778032f..1fcfe03 100644
--- a/libs/vr/libdisplay/include/private/dvr/display_rpc.h
+++ b/libs/vr/libdisplay/include/private/dvr/display_rpc.h
@@ -272,9 +272,7 @@
       int(const std::map<int, DisplaySurfaceAttributes>& updates));
   PDX_REMOTE_METHOD(SetupNamedBuffer, kOpSetupNamedBuffer,
                     LocalNativeBufferHandle(const std::string& name,
-                                            size_t size,
-                                            uint64_t producer_usage,
-                                            uint64_t consumer_usage));
+                                            size_t size, uint64_t usage));
 };
 
 struct ScreenshotData {
diff --git a/libs/vr/libdvr/display_manager_client.cpp b/libs/vr/libdvr/display_manager_client.cpp
index e469e3e..8c010fc 100644
--- a/libs/vr/libdvr/display_manager_client.cpp
+++ b/libs/vr/libdvr/display_manager_client.cpp
@@ -1,7 +1,6 @@
 #include "include/dvr/display_manager_client.h"
 
 #include <dvr/dvr_buffer.h>
-#include <grallocusage/GrallocUsageConversion.h>
 #include <private/android/AHardwareBufferHelpers.h>
 #include <private/dvr/buffer_hub_client.h>
 #include <private/dvr/display_manager_client_impl.h>
@@ -46,24 +45,11 @@
 
 DvrBuffer* dvrDisplayManagerSetupNamedBuffer(DvrDisplayManagerClient* client,
                                              const char* name, size_t size,
-                                             uint64_t hardware_buffer_usage,
-                                             uint64_t unused) {
-  uint64_t producer_usage = 0;
-  uint64_t consumer_usage = 0;
-
-  // Note: AHardwareBuffer no longer uses usage0/usage1
+                                             uint64_t usage) {
   uint64_t gralloc_usage =
-      android::AHardwareBuffer_convertToGrallocUsageBits(hardware_buffer_usage);
+      android::AHardwareBuffer_convertToGrallocUsageBits(usage);
 
-  // Note: split producer/consumer usage is deprecated, grallocV2 uses single
-  // 64-bits usage
-  // And, currently, 64-bits gralloc usage flags can safely be truncated to
-  // 32-bits
-  android_convertGralloc0To1Usage((uint32_t)gralloc_usage, &producer_usage,
-                                  &consumer_usage);
-
-  auto ion_buffer = client->client->SetupNamedBuffer(name, size, producer_usage,
-                                                     consumer_usage);
+  auto ion_buffer = client->client->SetupNamedBuffer(name, size, gralloc_usage);
   if (ion_buffer) {
     return CreateDvrBufferFromIonBuffer(std::move(ion_buffer));
   }
diff --git a/libs/vr/libdvr/dvr_surface.cpp b/libs/vr/libdvr/dvr_surface.cpp
index a04ed50..6daabca 100644
--- a/libs/vr/libdvr/dvr_surface.cpp
+++ b/libs/vr/libdvr/dvr_surface.cpp
@@ -1,5 +1,6 @@
 #include "include/dvr/dvr_surface.h"
 
+#include <private/android/AHardwareBufferHelpers.h>
 #include <private/dvr/display_client.h>
 
 using namespace android;
@@ -10,8 +11,8 @@
 
 extern "C" {
 
-int dvrSurfaceCreate(int width, int height, int format, uint64_t usage0,
-                     uint64_t usage1, int flags, DvrSurface** out_surface) {
+int dvrSurfaceCreate(int width, int height, int format, uint64_t usage,
+                     int flags, DvrSurface** out_surface) {
   if (out_surface == nullptr) {
     ALOGE("dvrSurfaceCreate: invalid inputs: out_surface=%p.", out_surface);
     return -EINVAL;
@@ -24,10 +25,12 @@
     return error;
   }
 
-  // TODO(hendrikw): When we move to gralloc1, pass both usage0 and usage1 down.
+  // The following convertion is sort of unnecessary as AHARDWAREBUFFER_USAGE
+  // and BufferUsage should be synced up now.
+  uint64_t gralloc_usage = AHardwareBuffer_convertToGrallocUsageBits(usage);
   std::unique_ptr<dvr::DisplaySurfaceClient> surface =
       client->CreateDisplaySurface(
-          width, height, static_cast<int>(usage0 | usage1), format, flags);
+          width, height, static_cast<int>(gralloc_usage), format, flags);
 
   DvrSurface* dvr_surface = new DvrSurface;
   dvr_surface->display_surface_ = std::move(surface);
diff --git a/libs/vr/libdvr/include/dvr/display_manager_client.h b/libs/vr/libdvr/include/dvr/display_manager_client.h
index 8cd948c..a2c69b2 100644
--- a/libs/vr/libdvr/include/dvr/display_manager_client.h
+++ b/libs/vr/libdvr/include/dvr/display_manager_client.h
@@ -22,7 +22,7 @@
 
 DvrBuffer* dvrDisplayManagerSetupNamedBuffer(DvrDisplayManagerClient* client,
                                              const char* name, size_t size,
-                                             uint64_t usage0, uint64_t usage1);
+                                             uint64_t usage);
 
 // Return an event fd for checking if there was an event on the server
 // Note that the only event which will be flagged is POLLIN. You must use
diff --git a/libs/vr/libdvr/include/dvr/dvr_api.h b/libs/vr/libdvr/include/dvr/dvr_api.h
index 3cd401d..8849942 100644
--- a/libs/vr/libdvr/include/dvr/dvr_api.h
+++ b/libs/vr/libdvr/include/dvr/dvr_api.h
@@ -48,7 +48,7 @@
     DvrDisplayManagerClientSurfaceList* surface_list);
 typedef DvrBuffer* (*DvrDisplayManagerSetupNamedBufferPtr)(
     DvrDisplayManagerClient* client, const char* name, size_t size,
-    uint64_t usage0, uint64_t usage1);
+    uint64_t usage);
 typedef size_t (*DvrDisplayManagerClientSurfaceListGetSizePtr)(
     DvrDisplayManagerClientSurfaceList* surface_list);
 typedef int (*DvrDisplayManagerClientSurfaceListGetSurfaceIdPtr)(
@@ -119,7 +119,7 @@
 // dvr_surface.h
 typedef int (*DvrGetNamedBufferPtr)(const char* name, DvrBuffer** out_buffer);
 typedef int (*DvrSurfaceCreatePtr)(int width, int height, int format,
-                                   uint64_t usage0, uint64_t usage1, int flags,
+                                   uint64_t usage, int flags,
                                    DvrSurface** out_surface);
 typedef int (*DvrSurfaceGetWriteBufferQueuePtr)(
     DvrSurface* surface, DvrWriteBufferQueue** out_writer);
diff --git a/libs/vr/libdvr/include/dvr/dvr_surface.h b/libs/vr/libdvr/include/dvr/dvr_surface.h
index e5228d6..a9d02d6 100644
--- a/libs/vr/libdvr/include/dvr/dvr_surface.h
+++ b/libs/vr/libdvr/include/dvr/dvr_surface.h
@@ -14,8 +14,8 @@
 // Get a pointer to the global pose buffer.
 int dvrGetNamedBuffer(const char* name, DvrBuffer** out_buffer);
 
-int dvrSurfaceCreate(int width, int height, int format, uint64_t usage0,
-                     uint64_t usage1, int flags, DvrSurface** out_surface);
+int dvrSurfaceCreate(int width, int height, int format, uint64_t usage,
+                     int flags, DvrSurface** out_surface);
 
 // TODO(eieio, jwcai) Change this once we have multiple buffer queue support.
 int dvrSurfaceGetWriteBufferQueue(DvrSurface* surface,
diff --git a/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp b/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp
index caf20a5..32bdcee 100644
--- a/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp
+++ b/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp
@@ -32,11 +32,11 @@
 TEST_F(DvrNamedBufferTest, TestNamedBuffersSameName) {
   const char* buffer_name = "same_name";
   DvrBuffer* buffer1 =
-      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name, 10, 0, 0);
+      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name, 10, 0);
   ASSERT_NE(nullptr, buffer1);
 
   DvrBuffer* buffer2 =
-      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name, 10, 0, 0);
+      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name, 10, 0);
   ASSERT_NE(nullptr, buffer2);
 
   AHardwareBuffer* hardware_buffer1 = nullptr;
@@ -73,7 +73,7 @@
   ASSERT_EQ(0, e3);
 
   AHardwareBuffer* hardware_buffer3 = nullptr;
-  int e4 = dvrBufferGetAHardwareBuffer(buffer2, &hardware_buffer3);
+  int e4 = dvrBufferGetAHardwareBuffer(buffer3, &hardware_buffer3);
   ASSERT_EQ(0, e4);
   ASSERT_NE(nullptr, hardware_buffer3);
 
@@ -96,12 +96,12 @@
   const char* buffer_name1 = "test1";
   const char* buffer_name2 = "test2";
   DvrBuffer* setup_buffer1 =
-      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name1, 10, 0, 0);
+      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name1, 10, 0);
   ASSERT_NE(nullptr, setup_buffer1);
   dvrBufferDestroy(setup_buffer1);
 
   DvrBuffer* setup_buffer2 =
-      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name2, 10, 0, 0);
+      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name2, 10, 0);
   ASSERT_NE(nullptr, setup_buffer2);
   dvrBufferDestroy(setup_buffer2);
 
@@ -129,7 +129,7 @@
   const int64_t usage = AHARDWAREBUFFER_USAGE_VIDEO_ENCODE;
 
   DvrBuffer* setup_buffer =
-      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name, 10, usage, 0);
+      dvrDisplayManagerSetupNamedBuffer(client_, buffer_name, 10, usage);
   ASSERT_NE(nullptr, setup_buffer);
 
   AHardwareBuffer* hardware_buffer = nullptr;
diff --git a/libs/vr/libvrflinger/display_manager_service.cpp b/libs/vr/libvrflinger/display_manager_service.cpp
index 99f93bf..42ffaec 100644
--- a/libs/vr/libvrflinger/display_manager_service.cpp
+++ b/libs/vr/libvrflinger/display_manager_service.cpp
@@ -193,8 +193,7 @@
 pdx::Status<BorrowedNativeBufferHandle>
 DisplayManagerService::OnSetupNamedBuffer(pdx::Message& message,
                                           const std::string& name, size_t size,
-                                          uint64_t producer_usage,
-                                          uint64_t consumer_usage) {
+                                          uint64_t usage) {
   if (message.GetEffectiveUserId() != AID_ROOT &&
       !IsTrustedUid(message.GetEffectiveUserId())) {
     // Only trusted users can setup named buffers.
@@ -202,8 +201,7 @@
           message.GetEffectiveUserId());
     return {};
   }
-  return display_service_->SetupNamedBuffer(name, size, producer_usage,
-                                            consumer_usage);
+  return display_service_->SetupNamedBuffer(name, size, usage);
 }
 
 void DisplayManagerService::OnDisplaySurfaceChange() {
diff --git a/libs/vr/libvrflinger/display_manager_service.h b/libs/vr/libvrflinger/display_manager_service.h
index 7b037de..b2417e5 100644
--- a/libs/vr/libvrflinger/display_manager_service.h
+++ b/libs/vr/libvrflinger/display_manager_service.h
@@ -56,7 +56,7 @@
 
   pdx::Status<BorrowedNativeBufferHandle> OnSetupNamedBuffer(
       pdx::Message& message, const std::string& name, size_t size,
-      uint64_t producer_usage, uint64_t consumer_usage);
+      uint64_t usage);
 
   // Called by the display service to indicate changes to display surfaces that
   // the display manager should evaluate.
diff --git a/libs/vr/libvrflinger/display_service.cpp b/libs/vr/libvrflinger/display_service.cpp
index 097edce..2dc840e 100644
--- a/libs/vr/libvrflinger/display_service.cpp
+++ b/libs/vr/libvrflinger/display_service.cpp
@@ -327,13 +327,11 @@
 }
 
 pdx::Status<BorrowedNativeBufferHandle> DisplayService::SetupNamedBuffer(
-    const std::string& name, size_t size, int producer_usage,
-    int consumer_usage) {
+    const std::string& name, size_t size, int usage) {
   auto named_buffer = named_buffers_.find(name);
   if (named_buffer == named_buffers_.end()) {
-    auto ion_buffer = std::make_unique<IonBuffer>(
-        static_cast<int>(size), 1, HAL_PIXEL_FORMAT_BLOB,
-        (producer_usage | consumer_usage));
+    auto ion_buffer = std::make_unique<IonBuffer>(static_cast<int>(size), 1,
+                                                  HAL_PIXEL_FORMAT_BLOB, usage);
     named_buffer =
         named_buffers_.insert(std::make_pair(name, std::move(ion_buffer)))
             .first;
diff --git a/libs/vr/libvrflinger/display_service.h b/libs/vr/libvrflinger/display_service.h
index db89064..dd5cac9 100644
--- a/libs/vr/libvrflinger/display_service.h
+++ b/libs/vr/libvrflinger/display_service.h
@@ -40,8 +40,7 @@
   void UpdateActiveDisplaySurfaces();
 
   pdx::Status<BorrowedNativeBufferHandle> SetupNamedBuffer(
-      const std::string& name, size_t size, int producer_usage,
-      int consumer_usage);
+      const std::string& name, size_t size, int usage);
 
   template <class A>
   void ForEachDisplaySurface(A action) const {
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index bc4e6c5..3e30ebd 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -548,12 +548,15 @@
         mSFEventThread = new EventThread(sfVsyncSrc, *this, true);
         mEventQueue.setEventThread(mSFEventThread);
 
-        // set SFEventThread to SCHED_FIFO to minimize jitter
+        // set EventThread and SFEventThread to SCHED_FIFO to minimize jitter
         struct sched_param param = {0};
         param.sched_priority = 2;
         if (sched_setscheduler(mSFEventThread->getTid(), SCHED_FIFO, &param) != 0) {
             ALOGE("Couldn't set SCHED_FIFO for SFEventThread");
         }
+        if (sched_setscheduler(mEventThread->getTid(), SCHED_FIFO, &param) != 0) {
+            ALOGE("Couldn't set SCHED_FIFO for EventThread");
+        }
 
         // Get a RenderEngine for the given display / config (can't fail)
         mRenderEngine = RenderEngine::create(mEGLDisplay,
diff --git a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp
index 019c8e3..7070b97 100644
--- a/services/surfaceflinger/SurfaceFlinger_hwc1.cpp
+++ b/services/surfaceflinger/SurfaceFlinger_hwc1.cpp
@@ -520,13 +520,15 @@
     mSFEventThread = new EventThread(sfVsyncSrc, *this, true);
     mEventQueue.setEventThread(mSFEventThread);
 
-    // set SFEventThread to SCHED_FIFO to minimize jitter
+    // set EventThread and SFEventThread to SCHED_FIFO to minimize jitter
     struct sched_param param = {0};
     param.sched_priority = 2;
     if (sched_setscheduler(mSFEventThread->getTid(), SCHED_FIFO, &param) != 0) {
         ALOGE("Couldn't set SCHED_FIFO for SFEventThread");
     }
-
+    if (sched_setscheduler(mEventThread->getTid(), SCHED_FIFO, &param) != 0) {
+        ALOGE("Couldn't set SCHED_FIFO for EventThread");
+    }
 
     // Initialize the H/W composer object.  There may or may not be an
     // actual hardware composer underneath.
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();
diff --git a/services/vr/bufferhubd/buffer_hub.h b/services/vr/bufferhubd/buffer_hub.h
index 4cb1eb9..817b01e 100644
--- a/services/vr/bufferhubd/buffer_hub.h
+++ b/services/vr/bufferhubd/buffer_hub.h
@@ -51,18 +51,16 @@
     uint32_t width = 0;
     uint32_t height = 0;
     uint32_t format = 0;
-    uint64_t producer_usage = 0;
-    uint64_t consumer_usage = 0;
+    uint64_t usage = 0;
     size_t slice_count = 0;
     std::string name;
 
     // Data filed for producer queue.
     size_t capacity = 0;
-    UsagePolicy usage_policy{0, 0, 0, 0, 0, 0, 0, 0};
+    UsagePolicy usage_policy{0, 0, 0, 0};
 
     BufferInfo(int id, size_t consumer_count, uint32_t width, uint32_t height,
-               uint32_t format, uint64_t producer_usage,
-               uint64_t consumer_usage, size_t slice_count,
+               uint32_t format, uint64_t usage, size_t slice_count,
                const std::string& name)
         : id(id),
           type(kProducerType),
@@ -70,8 +68,7 @@
           width(width),
           height(height),
           format(format),
-          producer_usage(producer_usage),
-          consumer_usage(consumer_usage),
+          usage(usage),
           slice_count(slice_count),
           name(name) {}
 
@@ -159,16 +156,16 @@
   std::unordered_map<std::string, std::shared_ptr<ProducerChannel>>
       named_buffers_;
 
-  pdx::Status<void> OnCreateBuffer(pdx::Message& message, 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);
-  pdx::Status<void> OnCreatePersistentBuffer(pdx::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);
-  pdx::Status<void> OnGetPersistentBuffer(pdx::Message& message, const std::string& name);
+  pdx::Status<void> OnCreateBuffer(pdx::Message& message, uint32_t width,
+                                   uint32_t height, uint32_t format,
+                                   uint64_t usage, size_t meta_size_bytes,
+                                   size_t slice_count);
+  pdx::Status<void> OnCreatePersistentBuffer(
+      pdx::Message& message, const std::string& name, int user_id, int group_id,
+      uint32_t width, uint32_t height, uint32_t format, uint64_t usage,
+      size_t meta_size_bytes, size_t slice_count);
+  pdx::Status<void> OnGetPersistentBuffer(pdx::Message& message,
+                                          const std::string& name);
   pdx::Status<QueueInfo> OnCreateProducerQueue(pdx::Message& message,
                                                size_t meta_size_bytes,
                                                const UsagePolicy& usage_policy);
diff --git a/services/vr/bufferhubd/producer_channel.cpp b/services/vr/bufferhubd/producer_channel.cpp
index c4b1319..e452d04 100644
--- a/services/vr/bufferhubd/producer_channel.cpp
+++ b/services/vr/bufferhubd/producer_channel.cpp
@@ -26,8 +26,7 @@
 
 ProducerChannel::ProducerChannel(BufferHubService* service, int channel_id,
                                  uint32_t width, uint32_t height,
-                                 uint32_t format, uint64_t producer_usage,
-                                 uint64_t consumer_usage,
+                                 uint32_t format, uint64_t usage,
                                  size_t meta_size_bytes, size_t slice_count,
                                  int* error)
     : BufferHubChannel(service, channel_id, channel_id, kProducerType),
@@ -37,8 +36,7 @@
       meta_size_bytes_(meta_size_bytes),
       meta_(meta_size_bytes ? new uint8_t[meta_size_bytes] : nullptr) {
   for (auto& ion_buffer : slices_) {
-    const int ret = ion_buffer.Alloc(width, height, format,
-                                     (producer_usage | consumer_usage));
+    const int ret = ion_buffer.Alloc(width, height, format, usage);
     if (ret < 0) {
       ALOGE("ProducerChannel::ProducerChannel: Failed to allocate buffer: %s",
             strerror(-ret));
@@ -53,12 +51,12 @@
 
 Status<std::shared_ptr<ProducerChannel>> ProducerChannel::Create(
     BufferHubService* service, int channel_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 format, uint64_t usage, size_t meta_size_bytes,
+    size_t slice_count) {
   int error;
-  std::shared_ptr<ProducerChannel> producer(new ProducerChannel(
-      service, channel_id, width, height, format, producer_usage,
-      consumer_usage, meta_size_bytes, slice_count, &error));
+  std::shared_ptr<ProducerChannel> producer(
+      new ProducerChannel(service, channel_id, width, height, format, usage,
+                          meta_size_bytes, slice_count, &error));
   if (error < 0)
     return ErrorStatus(-error);
   else
@@ -76,8 +74,7 @@
 BufferHubChannel::BufferInfo ProducerChannel::GetBufferInfo() const {
   return BufferInfo(buffer_id(), consumer_channels_.size(), slices_[0].width(),
                     slices_[0].height(), slices_[0].format(),
-                    slices_[0].usage(), slices_[0].usage(),
-                    slices_.size(), name_);
+                    slices_[0].usage(), slices_.size(), name_);
 }
 
 void ProducerChannel::HandleImpulse(Message& message) {
@@ -369,14 +366,12 @@
 
 // Returns true if the given parameters match the underlying buffer parameters.
 bool ProducerChannel::CheckParameters(uint32_t width, uint32_t height,
-                                      uint32_t format, uint64_t producer_usage,
-                                      uint64_t consumer_usage,
+                                      uint32_t format, uint64_t usage,
                                       size_t meta_size_bytes,
                                       size_t slice_count) {
   return slices_.size() == slice_count && meta_size_bytes == meta_size_bytes_ &&
          slices_[0].width() == width && slices_[0].height() == height &&
-         slices_[0].format() == format &&
-         slices_[0].usage() == (producer_usage | consumer_usage);
+         slices_[0].format() == format && slices_[0].usage() == usage;
 }
 
 }  // namespace dvr
diff --git a/services/vr/bufferhubd/producer_channel.h b/services/vr/bufferhubd/producer_channel.h
index f04c8a5..6de619d 100644
--- a/services/vr/bufferhubd/producer_channel.h
+++ b/services/vr/bufferhubd/producer_channel.h
@@ -32,8 +32,8 @@
 
   static pdx::Status<std::shared_ptr<ProducerChannel>> Create(
       BufferHubService* service, int channel_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 height, uint32_t format, uint64_t usage, size_t meta_size_bytes,
+      size_t slice_count);
 
   ~ProducerChannel() override;
 
@@ -62,8 +62,8 @@
 
   bool CheckAccess(int euid, int egid);
   bool CheckParameters(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);
+                       uint64_t usage, size_t meta_size_bytes,
+                       size_t slice_count);
 
   pdx::Status<void> OnProducerMakePersistent(Message& message,
                                              const std::string& name,
@@ -95,9 +95,8 @@
   std::string name_;
 
   ProducerChannel(BufferHubService* service, int channel, 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, int* error);
+                  uint32_t height, uint32_t format, uint64_t usage,
+                  size_t meta_size_bytes, size_t slice_count, int* error);
 
   pdx::Status<void> OnProducerPost(
       Message& message, LocalFence acquire_fence,
diff --git a/services/vr/bufferhubd/producer_queue_channel.cpp b/services/vr/bufferhubd/producer_queue_channel.cpp
index dc2a47e..bd8eed8 100644
--- a/services/vr/bufferhubd/producer_queue_channel.cpp
+++ b/services/vr/bufferhubd/producer_queue_channel.cpp
@@ -34,19 +34,14 @@
     const UsagePolicy& usage_policy) {
   // Configuration between |usage_deny_set_mask| and |usage_deny_clear_mask|
   // should be mutually exclusive.
-  if ((usage_policy.producer_deny_set_mask &
-       usage_policy.producer_deny_clear_mask) ||
-      (usage_policy.consumer_deny_set_mask &
-       usage_policy.consumer_deny_clear_mask)) {
+  if ((usage_policy.usage_deny_set_mask &
+       usage_policy.usage_deny_clear_mask)) {
     ALOGE(
         "BufferHubService::OnCreateProducerQueue: illegal usage mask "
-        "configuration: producer_deny_set_mask=%" PRIx64
-        " producer_deny_clear_mask=%" PRIx64 " consumer_deny_set_mask=%" PRIx64
-        " consumer_deny_clear_mask=%" PRIx64,
-        usage_policy.producer_deny_set_mask,
-        usage_policy.producer_deny_clear_mask,
-        usage_policy.consumer_deny_set_mask,
-        usage_policy.consumer_deny_clear_mask);
+        "configuration: usage_deny_set_mask=%" PRIx64
+        " usage_deny_clear_mask=%" PRIx64,
+        usage_policy.usage_deny_set_mask,
+        usage_policy.usage_deny_clear_mask);
     return ErrorStatus(EINVAL);
   }
 
@@ -134,8 +129,7 @@
 Status<std::vector<std::pair<RemoteChannelHandle, size_t>>>
 ProducerQueueChannel::OnProducerQueueAllocateBuffers(
     Message& message, uint32_t width, uint32_t height, uint32_t format,
-    uint64_t producer_usage, uint64_t consumer_usage, size_t slice_count,
-    size_t buffer_count) {
+    uint64_t usage, size_t slice_count, size_t buffer_count) {
   ATRACE_NAME("ProducerQueueChannel::OnProducerQueueAllocateBuffers");
   ALOGD_IF(TRACE,
            "ProducerQueueChannel::OnProducerQueueAllocateBuffers: "
@@ -145,58 +139,32 @@
   std::vector<std::pair<RemoteChannelHandle, size_t>> buffer_handles;
 
   // Deny buffer allocation violating preset rules.
-  if (producer_usage & usage_policy_.producer_deny_set_mask) {
+  if (usage & usage_policy_.usage_deny_set_mask) {
     ALOGE(
-        "ProducerQueueChannel::OnProducerQueueAllocateBuffers: producer_usage: "
-        "%" PRIx64
-        " is not permitted. Violating producer_deny_set_mask, the following "
-        "bits shall not be set: %" PRIx64 ".",
-        producer_usage, usage_policy_.producer_deny_set_mask);
+        "ProducerQueueChannel::OnProducerQueueAllocateBuffers: usage: %" PRIx64
+        " is not permitted. Violating usage_deny_set_mask, the following  bits "
+        "shall not be set: %" PRIx64 ".",
+        usage, usage_policy_.usage_deny_set_mask);
     return ErrorStatus(EINVAL);
   }
 
-  if (consumer_usage & usage_policy_.consumer_deny_set_mask) {
+  if (~usage & usage_policy_.usage_deny_clear_mask) {
     ALOGE(
-        "ProducerQueueChannel::OnProducerQueueAllocateBuffers: consumer_usage: "
-        "%" PRIx64
-        " is not permitted. Violating consumer_deny_set_mask, the following "
-        "bits shall not be set: %" PRIx64 ".",
-        consumer_usage, usage_policy_.consumer_deny_set_mask);
-    return ErrorStatus(EINVAL);
-  }
-
-  if (~producer_usage & usage_policy_.producer_deny_clear_mask) {
-    ALOGE(
-        "ProducerQueueChannel::OnProducerQueueAllocateBuffers: producer_usage: "
-        "%" PRIx64
-        " is not permitted. Violating producer_deny_clear_mask, the following "
+        "ProducerQueueChannel::OnProducerQueueAllocateBuffers: usage: %" PRIx64
+        " is not permitted. Violating usage_deny_clear_mask, the following "
         "bits must be set: %" PRIx64 ".",
-        producer_usage, usage_policy_.producer_deny_clear_mask);
+        usage, usage_policy_.usage_deny_clear_mask);
     return ErrorStatus(EINVAL);
   }
 
-  if (~consumer_usage & usage_policy_.consumer_deny_clear_mask) {
-    ALOGE(
-        "ProducerQueueChannel::OnProducerQueueAllocateBuffers: consumer_usage: "
-        "%" PRIx64
-        " is not permitted. Violating consumer_deny_clear_mask, the following "
-        "bits must be set: %" PRIx64 ".",
-        consumer_usage, usage_policy_.consumer_deny_clear_mask);
-    return ErrorStatus(EINVAL);
-  }
-  // Force set mask and clear mask. Note that |usage_policy_.X_set_mask_| takes
-  // precedence and will overwrite |usage_policy_.X_clear_mask|.
-  uint64_t effective_producer_usage =
-      (producer_usage & ~usage_policy_.producer_clear_mask) |
-      usage_policy_.producer_set_mask;
-  uint64_t effective_consumer_usage =
-      (consumer_usage & ~usage_policy_.consumer_clear_mask) |
-      usage_policy_.consumer_set_mask;
+  // Force set mask and clear mask. Note that |usage_policy_.usage_set_mask_|
+  // takes precedence and will overwrite |usage_policy_.usage_clear_mask|.
+  uint64_t effective_usage =
+      (usage & ~usage_policy_.usage_clear_mask) | usage_policy_.usage_set_mask;
 
   for (size_t i = 0; i < buffer_count; i++) {
-    auto status =
-        AllocateBuffer(message, width, height, format, effective_producer_usage,
-                       effective_consumer_usage, slice_count);
+    auto status = AllocateBuffer(message, width, height, format,
+                                 effective_usage, slice_count);
     if (!status) {
       ALOGE(
           "ProducerQueueChannel::OnProducerQueueAllocateBuffers: Failed to "
@@ -212,9 +180,7 @@
 Status<std::pair<RemoteChannelHandle, size_t>>
 ProducerQueueChannel::AllocateBuffer(Message& message, uint32_t width,
                                      uint32_t height, uint32_t format,
-                                     uint64_t producer_usage,
-                                     uint64_t consumer_usage,
-                                     size_t slice_count) {
+                                     uint64_t usage, size_t slice_count) {
   ATRACE_NAME("ProducerQueueChannel::AllocateBuffer");
   ALOGD_IF(TRACE,
            "ProducerQueueChannel::AllocateBuffer: producer_channel_id=%d",
@@ -239,15 +205,13 @@
 
   ALOGD_IF(TRACE,
            "ProducerQueueChannel::AllocateBuffer: buffer_id=%d width=%u "
-           "height=%u format=%u producer_usage=%" PRIx64
-           " consumer_usage=%" PRIx64 " slice_count=%zu",
-           buffer_id, width, height, format, producer_usage, consumer_usage,
-           slice_count);
+           "height=%u format=%u usage=%" PRIx64 " slice_count=%zu",
+           buffer_id, width, height, format, usage, slice_count);
   auto buffer_handle = status.take();
 
-  auto producer_channel_status = ProducerChannel::Create(
-      service(), buffer_id, width, height, format, producer_usage,
-      consumer_usage, meta_size_bytes_, slice_count);
+  auto producer_channel_status =
+      ProducerChannel::Create(service(), buffer_id, width, height, format,
+                              usage, meta_size_bytes_, slice_count);
   if (!producer_channel_status) {
     ALOGE(
         "ProducerQueueChannel::AllocateBuffer: Failed to create producer "
diff --git a/services/vr/bufferhubd/producer_queue_channel.h b/services/vr/bufferhubd/producer_queue_channel.h
index 09b0243..13c9ddc 100644
--- a/services/vr/bufferhubd/producer_queue_channel.h
+++ b/services/vr/bufferhubd/producer_queue_channel.h
@@ -35,8 +35,7 @@
   pdx::Status<std::vector<std::pair<pdx::RemoteChannelHandle, size_t>>>
   OnProducerQueueAllocateBuffers(pdx::Message& message, uint32_t width,
                                  uint32_t height, uint32_t format,
-                                 uint64_t producer_usage,
-                                 uint64_t consumer_usage, size_t slice_count,
+                                 uint64_t usage, size_t slice_count,
                                  size_t buffer_count);
 
   // Detach a BufferHubProducer indicated by |slot|. Note that the buffer must
@@ -59,7 +58,7 @@
   // allocated buffer.
   pdx::Status<std::pair<pdx::RemoteChannelHandle, size_t>> AllocateBuffer(
       pdx::Message& message, uint32_t width, uint32_t height, uint32_t format,
-      uint64_t producer_usage, uint64_t consumer_usage, size_t slice_count);
+      uint64_t usage, size_t slice_count);
 
   // Size of the meta data associated with all the buffers allocated from the
   // queue. Now we assume the metadata size is immutable once the queue is