Merge "Use absolute paths in tests."
diff --git a/cmds/installd/tests/installd_dexopt_test.cpp b/cmds/installd/tests/installd_dexopt_test.cpp
index 847be51..d640558 100644
--- a/cmds/installd/tests/installd_dexopt_test.cpp
+++ b/cmds/installd/tests/installd_dexopt_test.cpp
@@ -282,7 +282,7 @@
                                                  profile_name_ptr,
                                                  dm_path_ptr,
                                                  compilation_reason_ptr);
-        ASSERT_EQ(should_binder_call_succeed, result.isOk());
+        ASSERT_EQ(should_binder_call_succeed, result.isOk()) << result.toString8().c_str();
         int expected_access = should_dex_be_compiled ? 0 : -1;
         std::string odex = GetSecondaryDexArtifact(path, "odex");
         std::string vdex = GetSecondaryDexArtifact(path, "vdex");
@@ -310,7 +310,7 @@
             storage_flag,
             &out_secondary_dex_exists);
 
-        ASSERT_EQ(should_binder_call_succeed, result.isOk());
+        ASSERT_EQ(should_binder_call_succeed, result.isOk()) << result.toString8().c_str();
         ASSERT_EQ(should_dex_exist, out_secondary_dex_exists);
 
         int expected_access = should_dex_be_deleted ? -1 : 0;
@@ -378,7 +378,7 @@
                 package_name_, kTestUserId, kTestAppId, *profile_name_ptr, apk_path_,
                 /*dex_metadata*/ nullptr, &prof_result);
 
-        ASSERT_TRUE(prof_binder_result.isOk());
+        ASSERT_TRUE(prof_binder_result.isOk()) << prof_binder_result.toString8().c_str();
         ASSERT_TRUE(prof_result);
 
         binder::Status result = service_->dexopt(apk_path_,
@@ -397,7 +397,7 @@
                                                  profile_name_ptr,
                                                  dm_path_ptr,
                                                  compilation_reason_ptr);
-        ASSERT_EQ(should_binder_call_succeed, result.isOk());
+        ASSERT_EQ(should_binder_call_succeed, result.isOk()) << result.toString8().c_str();
 
         if (!should_binder_call_succeed) {
             return;
@@ -662,7 +662,7 @@
         bool result;
         binder::Status binder_result = service_->createProfileSnapshot(
                 appid, package_name, kPrimaryProfile, apk_path_, &result);
-        ASSERT_TRUE(binder_result.isOk());
+        ASSERT_TRUE(binder_result.isOk()) << binder_result.toString8().c_str();
         ASSERT_EQ(expected_result, result);
 
         if (!expected_result) {
@@ -704,7 +704,7 @@
         bool result;
         binder::Status binder_result = service_->mergeProfiles(
                 kTestAppUid, package_name, code_path, &result);
-        ASSERT_TRUE(binder_result.isOk());
+        ASSERT_TRUE(binder_result.isOk()) << binder_result.toString8().c_str();
         ASSERT_EQ(expected_result, result);
 
         if (!expected_result) {
@@ -733,7 +733,7 @@
         binder::Status binder_result = service_->prepareAppProfile(
                 package_name, kTestUserId, kTestAppId, profile_name, apk_path_,
                 /*dex_metadata*/ nullptr, &result);
-        ASSERT_TRUE(binder_result.isOk());
+        ASSERT_TRUE(binder_result.isOk()) << binder_result.toString8().c_str();
         ASSERT_EQ(expected_result, result);
 
         if (!expected_result) {
@@ -820,7 +820,7 @@
     createProfileSnapshot(kTestAppId, package_name_, /*expected_result*/ true);
 
     binder::Status binder_result = service_->destroyProfileSnapshot(package_name_, kPrimaryProfile);
-    ASSERT_TRUE(binder_result.isOk());
+    ASSERT_TRUE(binder_result.isOk()) << binder_result.toString8().c_str();
     struct stat st;
     ASSERT_EQ(-1, stat(snap_profile_.c_str(), &st));
     ASSERT_EQ(ENOENT, errno);
diff --git a/cmds/surfacereplayer/proto/Android.bp b/cmds/surfacereplayer/proto/Android.bp
index 7b402fe..71a5e23 100644
--- a/cmds/surfacereplayer/proto/Android.bp
+++ b/cmds/surfacereplayer/proto/Android.bp
@@ -7,11 +7,6 @@
         "-Wall",
         "-Werror",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     proto: {
         type: "lite",
         export_proto_headers: true,
diff --git a/include/input/KeyCharacterMap.h b/include/input/KeyCharacterMap.h
index 7935927..33d2757 100644
--- a/include/input/KeyCharacterMap.h
+++ b/include/input/KeyCharacterMap.h
@@ -51,6 +51,9 @@
         KEYBOARD_TYPE_PREDICTIVE = 2,
         KEYBOARD_TYPE_ALPHA = 3,
         KEYBOARD_TYPE_FULL = 4,
+        /**
+         * Deprecated. Set 'keyboard.specialFunction' to '1' in the device's IDC file instead.
+         */
         KEYBOARD_TYPE_SPECIAL_FUNCTION = 5,
         KEYBOARD_TYPE_OVERLAY = 6,
     };
diff --git a/libs/binder/BufferedTextOutput.cpp b/libs/binder/BufferedTextOutput.cpp
index a2443c0..30e70b0 100644
--- a/libs/binder/BufferedTextOutput.cpp
+++ b/libs/binder/BufferedTextOutput.cpp
@@ -17,11 +17,11 @@
 #include <binder/BufferedTextOutput.h>
 #include <binder/Debug.h>
 
-#include <utils/Atomic.h>
+#include <cutils/atomic.h>
+#include <cutils/threads.h>
 #include <utils/Log.h>
 #include <utils/RefBase.h>
 #include <utils/Vector.h>
-#include <cutils/threads.h>
 
 #include <private/binder/Static.h>
 
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 597fca9..d1c6f84 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -18,12 +18,12 @@
 
 #include <binder/ProcessState.h>
 
-#include <utils/Atomic.h>
 #include <binder/BpBinder.h>
 #include <binder/IPCThreadState.h>
+#include <binder/IServiceManager.h>
+#include <cutils/atomic.h>
 #include <utils/Log.h>
 #include <utils/String8.h>
-#include <binder/IServiceManager.h>
 #include <utils/String8.h>
 #include <utils/threads.h>
 
diff --git a/libs/input/KeyCharacterMap.cpp b/libs/input/KeyCharacterMap.cpp
index 0627ca6..cba1111 100644
--- a/libs/input/KeyCharacterMap.cpp
+++ b/libs/input/KeyCharacterMap.cpp
@@ -824,6 +824,9 @@
     } else if (typeToken == "FULL") {
         type = KEYBOARD_TYPE_FULL;
     } else if (typeToken == "SPECIAL_FUNCTION") {
+        ALOGW("The SPECIAL_FUNCTION type is now declared in the device's IDC file, please set "
+                "the property 'keyboard.specialFunction' to '1' there instead.");
+        // TODO: return BAD_VALUE here in Q
         type = KEYBOARD_TYPE_SPECIAL_FUNCTION;
     } else if (typeToken == "OVERLAY") {
         type = KEYBOARD_TYPE_OVERLAY;
diff --git a/libs/input/Keyboard.cpp b/libs/input/Keyboard.cpp
index 07f2289..11842ee 100644
--- a/libs/input/Keyboard.cpp
+++ b/libs/input/Keyboard.cpp
@@ -148,9 +148,19 @@
 
 // --- Global functions ---
 
+bool isKeyboardSpecialFunction(const PropertyMap* config) {
+    if (config == nullptr) {
+        return false;
+    }
+    bool isSpecialFunction = false;
+    config->tryGetProperty(String8("keyboard.specialFunction"), isSpecialFunction);
+    return isSpecialFunction;
+}
+
 bool isEligibleBuiltInKeyboard(const InputDeviceIdentifier& deviceIdentifier,
         const PropertyMap* deviceConfiguration, const KeyMap* keyMap) {
-    if (!keyMap->haveKeyCharacterMap()
+    // TODO: remove the third OR statement (SPECIAL_FUNCTION) in Q
+    if (!keyMap->haveKeyCharacterMap() || isKeyboardSpecialFunction(deviceConfiguration)
             || keyMap->keyCharacterMap->getKeyboardType()
                     == KeyCharacterMap::KEYBOARD_TYPE_SPECIAL_FUNCTION) {
         return false;
diff --git a/libs/vr/libbufferhub/Android.bp b/libs/vr/libbufferhub/Android.bp
index e6803da..39814cc 100644
--- a/libs/vr/libbufferhub/Android.bp
+++ b/libs/vr/libbufferhub/Android.bp
@@ -48,11 +48,6 @@
         "-Wall",
         "-Werror",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     export_include_dirs: localIncludeFiles,
     shared_libs: sharedLibraries,
     header_libs: headerLibraries,
diff --git a/libs/vr/libbufferhub/buffer_hub-test.cpp b/libs/vr/libbufferhub/buffer_hub-test.cpp
index 471ec7b..b7a6099 100644
--- a/libs/vr/libbufferhub/buffer_hub-test.cpp
+++ b/libs/vr/libbufferhub/buffer_hub-test.cpp
@@ -599,74 +599,6 @@
   EXPECT_NE(0, p->Post(LocalHandle(), sequence));
 }
 
-TEST_F(LibBufferHubTest, TestPersistentBufferPersistence) {
-  auto p = BufferProducer::Create("TestPersistentBuffer", -1, -1, kWidth,
-                                  kHeight, kFormat, kUsage);
-  ASSERT_NE(nullptr, p);
-
-  // Record the original buffer id for later comparison.
-  const int buffer_id = p->id();
-
-  auto c = BufferConsumer::Import(p->CreateConsumer());
-  ASSERT_NE(nullptr, c);
-
-  EXPECT_EQ(0, p->Post<void>(LocalHandle()));
-
-  // Close the connection to the producer. This should not affect the consumer.
-  p = nullptr;
-
-  LocalHandle fence;
-  EXPECT_EQ(0, c->Acquire(&fence));
-  EXPECT_EQ(0, c->Release(LocalHandle()));
-
-  // Attempt to reconnect to the persistent buffer.
-  p = BufferProducer::Create("TestPersistentBuffer");
-  ASSERT_NE(nullptr, p);
-  EXPECT_EQ(buffer_id, p->id());
-  EXPECT_EQ(0, p->Gain(&fence));
-}
-
-TEST_F(LibBufferHubTest, TestPersistentBufferMismatchParams) {
-  auto p = BufferProducer::Create("TestPersistentBuffer", -1, -1, kWidth,
-                                  kHeight, kFormat, kUsage);
-  ASSERT_NE(nullptr, p);
-
-  // Close the connection to the producer.
-  p = nullptr;
-
-  // Mismatch the params.
-  p = BufferProducer::Create("TestPersistentBuffer", -1, -1, kWidth * 2,
-                             kHeight, kFormat, kUsage);
-  ASSERT_EQ(nullptr, p);
-}
-
-TEST_F(LibBufferHubTest, TestRemovePersistentBuffer) {
-  auto p = BufferProducer::Create("TestPersistentBuffer", -1, -1, kWidth,
-                                  kHeight, kFormat, kUsage);
-  ASSERT_NE(nullptr, p);
-
-  LocalHandle fence;
-  auto c = BufferConsumer::Import(p->CreateConsumer());
-  ASSERT_NE(nullptr, c);
-  EXPECT_EQ(0, p->Post<void>(LocalHandle()));
-  EXPECT_EQ(0, c->Acquire(&fence));
-  EXPECT_EQ(0, c->Release(LocalHandle()));
-  EXPECT_LT(0, RETRY_EINTR(p->Poll(kPollTimeoutMs)));
-
-  // Test that removing persistence and closing the producer orphans the
-  // consumer.
-  EXPECT_EQ(0, p->Gain(&fence));
-  EXPECT_EQ(0, p->Post<void>(LocalHandle()));
-  EXPECT_EQ(0, p->RemovePersistence());
-  p = nullptr;
-
-  // Orphaned consumer can acquire the posted buffer one more time in
-  // asynchronous manner. But synchronous call will fail.
-  DvrNativeBufferMetadata meta;
-  EXPECT_EQ(0, c->AcquireAsync(&meta, &fence));
-  EXPECT_EQ(-EPIPE, c->Release(LocalHandle()));
-}
-
 namespace {
 
 int PollFd(int fd, int timeout_ms) {
diff --git a/libs/vr/libbufferhub/buffer_hub_client.cpp b/libs/vr/libbufferhub/buffer_hub_client.cpp
index 97341b1..8fe9dfb 100644
--- a/libs/vr/libbufferhub/buffer_hub_client.cpp
+++ b/libs/vr/libbufferhub/buffer_hub_client.cpp
@@ -431,50 +431,6 @@
   }
 }
 
-BufferProducer::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 user_metadata_size)
-    : BufferProducer(name, user_id, group_id, width, height, format, usage,
-                     usage, user_metadata_size) {}
-
-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 user_metadata_size)
-    : 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 " user_metadata_size=%zu",
-           event_fd(), name.c_str(), user_id, group_id, width, height, format,
-           producer_usage, consumer_usage, user_metadata_size);
-
-  // (b/37881101) Deprecate producer/consumer usage
-  auto status = InvokeRemoteMethod<BufferHubRPC::CreatePersistentBuffer>(
-      name, user_id, group_id, width, height, format,
-      (producer_usage | consumer_usage), user_metadata_size);
-  if (!status) {
-    ALOGE(
-        "BufferProducer::BufferProducer: Failed to create/get persistent "
-        "buffer \"%s\": %s",
-        name.c_str(), status.GetErrorMessage().c_str());
-    Close(-status.error());
-    return;
-  }
-
-  const int ret = ImportBuffer();
-  if (ret < 0) {
-    ALOGE(
-        "BufferProducer::BufferProducer: Failed to import producer buffer "
-        "\"%s\": %s",
-        name.c_str(), strerror(-ret));
-    Close(ret);
-  }
-}
-
 BufferProducer::BufferProducer(uint32_t usage, size_t size)
     : BufferProducer(usage, usage, size) {}
 
@@ -511,73 +467,6 @@
   }
 }
 
-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)
-    : 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);
-  const int width = static_cast<int>(size);
-  const int height = 1;
-  const int format = HAL_PIXEL_FORMAT_BLOB;
-  const size_t user_metadata_size = 0;
-
-  // (b/37881101) Deprecate producer/consumer usage
-  auto status = InvokeRemoteMethod<BufferHubRPC::CreatePersistentBuffer>(
-      name, user_id, group_id, width, height, format,
-      (producer_usage | consumer_usage), user_metadata_size);
-  if (!status) {
-    ALOGE(
-        "BufferProducer::BufferProducer: Failed to create persistent "
-        "buffer \"%s\": %s",
-        name.c_str(), status.GetErrorMessage().c_str());
-    Close(-status.error());
-    return;
-  }
-
-  const int ret = ImportBuffer();
-  if (ret < 0) {
-    ALOGE(
-        "BufferProducer::BufferProducer: Failed to import producer buffer "
-        "\"%s\": %s",
-        name.c_str(), strerror(-ret));
-    Close(ret);
-  }
-}
-
-BufferProducer::BufferProducer(const std::string& name)
-    : BASE(BufferHubRPC::kClientPath) {
-  ATRACE_NAME("BufferProducer::BufferProducer");
-  ALOGD_IF(TRACE, "BufferProducer::BufferProducer: name=%s", name.c_str());
-
-  auto status = InvokeRemoteMethod<BufferHubRPC::GetPersistentBuffer>(name);
-  if (!status) {
-    ALOGE(
-        "BufferProducer::BufferProducer: Failed to get producer buffer by name "
-        "\"%s\": %s",
-        name.c_str(), status.GetErrorMessage().c_str());
-    Close(-status.error());
-    return;
-  }
-
-  const int ret = ImportBuffer();
-  if (ret < 0) {
-    ALOGE(
-        "BufferProducer::BufferProducer: Failed to import producer buffer "
-        "\"%s\": %s",
-        name.c_str(), strerror(-ret));
-    Close(ret);
-  }
-}
-
 BufferProducer::BufferProducer(LocalChannelHandle channel)
     : BASE(std::move(channel)) {
   const int ret = ImportBuffer();
@@ -736,19 +625,5 @@
                        : LocalChannelHandle{nullptr, -status.error()});
 }
 
-int BufferProducer::MakePersistent(const std::string& name, int user_id,
-                                   int group_id) {
-  ATRACE_NAME("BufferProducer::MakePersistent");
-  return ReturnStatusOrError(
-      InvokeRemoteMethod<BufferHubRPC::ProducerMakePersistent>(name, user_id,
-                                                               group_id));
-}
-
-int BufferProducer::RemovePersistence() {
-  ATRACE_NAME("BufferProducer::RemovePersistence");
-  return ReturnStatusOrError(
-      InvokeRemoteMethod<BufferHubRPC::ProducerRemovePersistence>());
-}
-
 }  // namespace dvr
 }  // namespace android
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 a356959..8a4440f 100644
--- a/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
+++ b/libs/vr/libbufferhub/include/private/dvr/buffer_hub_client.h
@@ -221,19 +221,6 @@
   // succeeded, or a negative errno code if local error check fails.
   int GainAsync(DvrNativeBufferMetadata* out_meta, LocalHandle* out_fence);
 
-  // Attaches the producer to |name| so that it becomes a persistent buffer that
-  // may be retrieved by name at a later time. This may be used in cases where a
-  // shared memory buffer should persist across the life of the producer process
-  // (i.e. the buffer may be held by clients across a service restart). The
-  // buffer may be associated with a user and/or group id to restrict access to
-  // the buffer. If user_id or group_id is -1 then checks for the respective id
-  // are disabled. If user_id or group_id is 0 then the respective id of the
-  // calling process is used instead.
-  int MakePersistent(const std::string& name, int user_id, int group_id);
-
-  // Removes the persistence of the producer.
-  int RemovePersistence();
-
  private:
   friend BASE;
 
@@ -248,40 +235,10 @@
                  uint64_t producer_usage, uint64_t consumer_usage,
                  size_t metadata_size);
 
-  // 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
-  // and settings already exists and matches the given geometry and parameters,
-  // that buffer is connected to this client instead of creating a new buffer.
-  // If the name matches but the geometry or settings do not match then
-  // construction fails and BufferProducer::Create() returns nullptr.
-  //
-  // Access to the persistent buffer may be restricted by |user_id| and/or
-  // |group_id|; these settings are established only when the buffer is first
-  // created and cannot be changed. A user or group id of -1 disables checks for
-  // that respective id. A user or group id of 0 is substituted with the
-  // 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);
-  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 user_metadata_size);
-
   // 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);
 
-  // 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);
-
-  // Constructs a channel to persistent buffer by name only. The buffer must
-  // have been previously created or made persistent.
-  explicit BufferProducer(const std::string& name);
-
   // Imports the given file handle to a producer channel, taking ownership.
   explicit BufferProducer(LocalChannelHandle channel);
 
diff --git a/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h b/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h
index f105b02..c70fffc 100644
--- a/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h
+++ b/libs/vr/libbufferhub/include/private/dvr/bufferhub_rpc.h
@@ -366,12 +366,8 @@
   // Op codes.
   enum {
     kOpCreateBuffer = 0,
-    kOpCreatePersistentBuffer,
-    kOpGetPersistentBuffer,
     kOpGetBuffer,
     kOpNewConsumer,
-    kOpProducerMakePersistent,
-    kOpProducerRemovePersistence,
     kOpProducerPost,
     kOpProducerGain,
     kOpConsumerAcquire,
@@ -394,19 +390,9 @@
   PDX_REMOTE_METHOD(CreateBuffer, kOpCreateBuffer,
                     void(uint32_t width, uint32_t height, uint32_t format,
                          uint64_t usage, size_t user_metadata_size));
-  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 usage, size_t user_metadata_size));
-  PDX_REMOTE_METHOD(GetPersistentBuffer, kOpGetPersistentBuffer,
-                    void(const std::string& name));
   PDX_REMOTE_METHOD(GetBuffer, kOpGetBuffer,
                     BufferDescription<LocalHandle>(Void));
   PDX_REMOTE_METHOD(NewConsumer, kOpNewConsumer, LocalChannelHandle(Void));
-  PDX_REMOTE_METHOD(ProducerMakePersistent, kOpProducerMakePersistent,
-                    void(const std::string& name, int user_id, int group_id));
-  PDX_REMOTE_METHOD(ProducerRemovePersistence, kOpProducerRemovePersistence,
-                    void(Void));
   PDX_REMOTE_METHOD(ProducerPost, kOpProducerPost,
                     void(LocalFence acquire_fence));
   PDX_REMOTE_METHOD(ProducerGain, kOpProducerGain, LocalFence(Void));
diff --git a/libs/vr/libbufferhubqueue/Android.bp b/libs/vr/libbufferhubqueue/Android.bp
index cf2c59b..eeec9ec 100644
--- a/libs/vr/libbufferhubqueue/Android.bp
+++ b/libs/vr/libbufferhubqueue/Android.bp
@@ -53,11 +53,6 @@
         "-Wno-unused-parameter",
         "-Wno-unused-variable",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     srcs: sourceFiles,
     export_include_dirs: includeFiles,
     export_static_lib_headers: staticLibraries,
diff --git a/libs/vr/libdisplay/Android.bp b/libs/vr/libdisplay/Android.bp
index 093ad92..192fb5d 100644
--- a/libs/vr/libdisplay/Android.bp
+++ b/libs/vr/libdisplay/Android.bp
@@ -52,11 +52,6 @@
 cc_library {
     tags: ["tests"],
     srcs: sourceFiles,
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     cflags: ["-DLOG_TAG=\"libdisplay\"",
         "-DTRACE=0",
         "-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
diff --git a/libs/vr/libpdx/Android.bp b/libs/vr/libpdx/Android.bp
index d183f71..9b84d65 100644
--- a/libs/vr/libpdx/Android.bp
+++ b/libs/vr/libpdx/Android.bp
@@ -8,11 +8,6 @@
         "-DLOG_TAG=\"libpdx\"",
         "-DTRACE=0",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     export_include_dirs: ["private"],
     local_include_dirs: ["private"],
     srcs: [
diff --git a/libs/vr/libpdx_uds/Android.bp b/libs/vr/libpdx_uds/Android.bp
index e7cf357..79cfdf6 100644
--- a/libs/vr/libpdx_uds/Android.bp
+++ b/libs/vr/libpdx_uds/Android.bp
@@ -19,11 +19,6 @@
         "ipc_helper.cpp",
         "service_endpoint.cpp",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     static_libs: [
         "libcutils",
         "libbase",
diff --git a/libs/vr/libperformance/Android.bp b/libs/vr/libperformance/Android.bp
index 2eed602..35d3dea 100644
--- a/libs/vr/libperformance/Android.bp
+++ b/libs/vr/libperformance/Android.bp
@@ -36,11 +36,6 @@
         "-Wall",
         "-Werror",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     export_include_dirs: includeFiles,
     shared_libs: sharedLibraries,
     name: "libperformance",
diff --git a/libs/vr/libvr_manager/Android.bp b/libs/vr/libvr_manager/Android.bp
index 6060c6e..8784877 100644
--- a/libs/vr/libvr_manager/Android.bp
+++ b/libs/vr/libvr_manager/Android.bp
@@ -31,11 +31,6 @@
     include_dirs: include_dirs,
     export_include_dirs: exported_include_dirs,
     cflags: ["-Wall", "-Werror", "-Wunused", "-Wunreachable-code"],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     static_libs: static_libs,
     name: "libvr_manager",
 }
diff --git a/libs/vr/libvrflinger/Android.bp b/libs/vr/libvrflinger/Android.bp
index c762e46..23a9853 100644
--- a/libs/vr/libvrflinger/Android.bp
+++ b/libs/vr/libvrflinger/Android.bp
@@ -81,11 +81,6 @@
         "-Wno-error=sign-compare", // to fix later
         "-Wno-unused-variable",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     shared_libs: sharedLibraries,
     whole_static_libs: staticLibraries,
     header_libs: headerLibraries,
diff --git a/opengl/libagl/BufferObjectManager.cpp b/opengl/libagl/BufferObjectManager.cpp
index 6bf28ee..3d93c19 100644
--- a/opengl/libagl/BufferObjectManager.cpp
+++ b/opengl/libagl/BufferObjectManager.cpp
@@ -18,7 +18,7 @@
 #include <stddef.h>
 #include <sys/types.h>
 
-#include <utils/Atomic.h>
+#include <cutils/atomic.h>
 #include <utils/RefBase.h>
 #include <utils/KeyedVector.h>
 #include <utils/Errors.h>
diff --git a/opengl/libagl/TextureObjectManager.h b/opengl/libagl/TextureObjectManager.h
index de9e03e..9cf8771 100644
--- a/opengl/libagl/TextureObjectManager.h
+++ b/opengl/libagl/TextureObjectManager.h
@@ -21,7 +21,7 @@
 #include <stddef.h>
 #include <sys/types.h>
 
-#include <utils/Atomic.h>
+#include <cutils/atomic.h>
 #include <utils/threads.h>
 #include <utils/RefBase.h>
 #include <utils/KeyedVector.h>
diff --git a/opengl/tests/testFramerate/Android.mk b/opengl/tests/testFramerate/Android.mk
index 2864fcf..ca6654a 100644
--- a/opengl/tests/testFramerate/Android.mk
+++ b/opengl/tests/testFramerate/Android.mk
@@ -15,6 +15,6 @@
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
 LOCAL_PACKAGE_NAME := TestFramerate
-LOCAL_PRIVATE_PLATFORM_APIS := true
+LOCAL_SDK_VERSION := system_current
 
 include $(BUILD_PACKAGE)
diff --git a/services/sensorservice/BatteryService.cpp b/services/sensorservice/BatteryService.cpp
index 330861d..d8e5b29 100644
--- a/services/sensorservice/BatteryService.cpp
+++ b/services/sensorservice/BatteryService.cpp
@@ -18,7 +18,7 @@
 #include <math.h>
 #include <sys/types.h>
 
-#include <utils/Atomic.h>
+#include <cutils/atomic.h>
 #include <utils/Errors.h>
 #include <utils/Singleton.h>
 
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index fdb69d3..115a983 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -18,7 +18,7 @@
 
 #include <android-base/logging.h>
 #include <sensors/convert.h>
-#include <utils/Atomic.h>
+#include <cutils/atomic.h>
 #include <utils/Errors.h>
 #include <utils/Singleton.h>
 
diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp
index ae589ca..ae34d34 100644
--- a/services/surfaceflinger/Android.bp
+++ b/services/surfaceflinger/Android.bp
@@ -133,11 +133,6 @@
     srcs: [
         ":libsurfaceflinger_sources",
     ],
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
     logtags: ["EventLog/EventLogTags.logtags"],
     include_dirs: [
         "external/vulkan-validation-layers/libs/vkjson",
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 08c4a5e..6da1409 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -26,8 +26,8 @@
  */
 
 #include <cutils/compiler.h>
+#include <cutils/atomic.h>
 
-#include <utils/Atomic.h>
 #include <utils/Errors.h>
 #include <utils/KeyedVector.h>
 #include <utils/RefBase.h>
diff --git a/services/surfaceflinger/layerproto/Android.bp b/services/surfaceflinger/layerproto/Android.bp
index 75612c0..8eb218c 100644
--- a/services/surfaceflinger/layerproto/Android.bp
+++ b/services/surfaceflinger/layerproto/Android.bp
@@ -9,12 +9,6 @@
         "layerstrace.proto",
     ],
 
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
-
     shared_libs: [
         "libui",
         "libprotobuf-cpp-lite",
@@ -39,4 +33,4 @@
         "-Wno-undef",
     ],
 
-}
+}
\ No newline at end of file
diff --git a/services/utils/Android.bp b/services/utils/Android.bp
index a5f7dc1..6132956 100644
--- a/services/utils/Android.bp
+++ b/services/utils/Android.bp
@@ -27,12 +27,6 @@
         "PriorityDumper.cpp",
     ],
 
-    arch: {
-        arm: {
-            instruction_set: "arm",
-        },
-    },
-
     clang: true,
     export_include_dirs: ["include"],
 }
diff --git a/services/vr/bufferhubd/buffer_hub.cpp b/services/vr/bufferhubd/buffer_hub.cpp
index cdb1f91..1eb4ef9 100644
--- a/services/vr/bufferhubd/buffer_hub.cpp
+++ b/services/vr/bufferhubd/buffer_hub.cpp
@@ -62,8 +62,6 @@
   stream << std::setw(18) << "Signaled";
   stream << " ";
   stream << std::setw(10) << "Index";
-  stream << " ";
-  stream << "Name";
   stream << std::endl;
 
   for (const auto& channel : channels) {
@@ -100,8 +98,6 @@
       stream << std::dec << std::setfill(' ');
       stream << " ";
       stream << std::setw(8) << info.index;
-      stream << " ";
-      stream << info.name;
       stream << std::endl;
     }
   }
@@ -166,9 +162,7 @@
   stream << std::right;
   stream << std::setw(6) << "Id";
   stream << " ";
-  stream << std::setw(14) << "Geometry";
-  stream << " ";
-  stream << "Name";
+  stream << std::setw(14) << "Info";
   stream << std::endl;
 
   for (const auto& channel : channels) {
@@ -216,16 +210,6 @@
           *this, &BufferHubService::OnCreateBuffer, message);
       return {};
 
-    case BufferHubRPC::CreatePersistentBuffer::Opcode:
-      DispatchRemoteMethod<BufferHubRPC::CreatePersistentBuffer>(
-          *this, &BufferHubService::OnCreatePersistentBuffer, message);
-      return {};
-
-    case BufferHubRPC::GetPersistentBuffer::Opcode:
-      DispatchRemoteMethod<BufferHubRPC::GetPersistentBuffer>(
-          *this, &BufferHubService::OnGetPersistentBuffer, message);
-      return {};
-
     case BufferHubRPC::CreateProducerQueue::Opcode:
       DispatchRemoteMethod<BufferHubRPC::CreateProducerQueue>(
           *this, &BufferHubService::OnCreateProducerQueue, message);
@@ -236,12 +220,6 @@
   }
 }
 
-void BufferHubService::OnChannelClose(Message&,
-                                      const std::shared_ptr<Channel>& channel) {
-  if (auto buffer = std::static_pointer_cast<BufferHubChannel>(channel))
-    buffer->Detach();
-}
-
 Status<void> BufferHubService::OnCreateBuffer(Message& message, uint32_t width,
                                               uint32_t height, uint32_t format,
                                               uint64_t usage,
@@ -273,117 +251,6 @@
   }
 }
 
-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 usage,
-    size_t meta_size_bytes) {
-  const uint32_t kDefaultLayerCount = 1;
-  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 "
-           "usage=%" PRIx64 " meta_size_bytes=%zu",
-           channel_id, name.c_str(), user_id, group_id, width, height, format,
-           usage, meta_size_bytes);
-
-  // See if this channel is already attached to a buffer.
-  if (const auto channel = message.GetChannel<BufferHubChannel>()) {
-    ALOGE(
-        "BufferHubService::OnCreatePersistentBuffer: Channel already attached "
-        "to buffer: channel_id=%d buffer_id=%d",
-        channel_id, channel->buffer_id());
-    return ErrorStatus(EALREADY);
-  }
-
-  const int euid = message.GetEffectiveUserId();
-  const int egid = message.GetEffectiveGroupId();
-
-  if (auto buffer = GetNamedBuffer(name)) {
-    if (!buffer->CheckAccess(euid, egid)) {
-      ALOGE(
-          "BufferHubService::OnCreatePersistentBuffer: Requesting process does "
-          "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, kDefaultLayerCount,
-                                        format, usage, meta_size_bytes)) {
-      ALOGE(
-          "BufferHubService::OnCreatePersistentBuffer: Requested an existing "
-          "buffer with different parameters: name=%s",
-          name.c_str());
-      return ErrorStatus(EINVAL);
-    } else if (!buffer->IsDetached()) {
-      ALOGE(
-          "BufferHubService::OnCreatePersistentBuffer: Requesting a persistent "
-          "buffer that is already attached to a channel: name=%s",
-          name.c_str());
-      return ErrorStatus(EINVAL);
-    } else {
-      buffer->Attach(channel_id);
-      message.SetChannel(buffer);
-      return {};
-    }
-  } else {
-    auto status = ProducerChannel::Create(this, channel_id, width, height,
-                                          kDefaultLayerCount, format, usage,
-                                          meta_size_bytes);
-    if (!status) {
-      ALOGE("BufferHubService::OnCreateBuffer: Failed to create producer!!");
-      return status.error_status();
-    }
-    auto persistent_buffer = status.take();
-    auto make_persistent_status = persistent_buffer->OnProducerMakePersistent(
-        message, name, user_id, group_id);
-    if (make_persistent_status)
-      message.SetChannel(persistent_buffer);
-    return make_persistent_status;
-  }
-}
-
-Status<void> BufferHubService::OnGetPersistentBuffer(Message& message,
-                                                     const std::string& name) {
-  const int channel_id = message.GetChannelId();
-  ALOGD_IF(TRACE,
-           "BufferHubService::OnGetPersistentBuffer: channel_id=%d name=%s",
-           channel_id, name.c_str());
-
-  // See if this channel is already attached to a buffer.
-  if (const auto channel = message.GetChannel<BufferHubChannel>()) {
-    ALOGE(
-        "BufferHubService::OnGetPersistentBuffer: Channel already attached to "
-        "buffer: channel_id=%d buffer_id=%d",
-        channel_id, channel->buffer_id());
-    return ErrorStatus(EALREADY);
-  }
-
-  const int euid = message.GetEffectiveUserId();
-  const int egid = message.GetEffectiveGroupId();
-
-  if (auto buffer = GetNamedBuffer(name)) {
-    if (!buffer->CheckAccess(euid, egid)) {
-      ALOGE(
-          "BufferHubService::OnGetPersistentBuffer: Requesting process does "
-          "not have permission to access named buffer: name=%s euid=%d egid=%d",
-          name.c_str(), euid, egid);
-      return ErrorStatus(EPERM);
-    } else if (!buffer->IsDetached()) {
-      ALOGE(
-          "BufferHubService::OnGetPersistentBuffer: Requesting a persistent "
-          "buffer that is already attached to a channel: name=%s",
-          name.c_str());
-      return ErrorStatus(EINVAL);
-    } else {
-      buffer->Attach(channel_id);
-      message.SetChannel(buffer);
-      return {};
-    }
-  } else {
-    ALOGE("BufferHubService::OnGetPersistentBuffer: Buffer \"%s\" not found!",
-          name.c_str());
-    return ErrorStatus(ENOENT);
-  }
-}
-
 Status<QueueInfo> BufferHubService::OnCreateProducerQueue(
     pdx::Message& message, const ProducerQueueConfig& producer_config,
     const UsagePolicy& usage_policy) {
@@ -410,52 +277,17 @@
   }
 }
 
-bool BufferHubService::AddNamedBuffer(
-    const std::string& name, const std::shared_ptr<ProducerChannel>& buffer) {
-  auto search = named_buffers_.find(name);
-  if (search == named_buffers_.end()) {
-    named_buffers_.emplace(name, buffer);
-    return true;
-  } else {
-    return false;
-  }
-}
-
-std::shared_ptr<ProducerChannel> BufferHubService::GetNamedBuffer(
-    const std::string& name) {
-  auto search = named_buffers_.find(name);
-  if (search != named_buffers_.end())
-    return search->second;
-  else
-    return nullptr;
-}
-
-bool BufferHubService::RemoveNamedBuffer(const ProducerChannel& buffer) {
-  for (auto it = named_buffers_.begin(); it != named_buffers_.end();) {
-    if (it->second.get() == &buffer) {
-      named_buffers_.erase(it);
-      return true;
-    }
-    ++it;
-  }
-  return false;
-}
-
 void BufferHubChannel::SignalAvailable() {
   ATRACE_NAME("BufferHubChannel::SignalAvailable");
   ALOGD_IF(TRACE,
            "BufferHubChannel::SignalAvailable: channel_id=%d buffer_id=%d",
            channel_id(), buffer_id());
-  if (!IsDetached()) {
-    signaled_ = true;
-    const auto status = service_->ModifyChannelEvents(channel_id_, 0, POLLIN);
-    ALOGE_IF(!status,
-             "BufferHubChannel::SignalAvailable: failed to signal availability "
-             "channel_id=%d: %s",
-             channel_id_, status.GetErrorMessage().c_str());
-  } else {
-    ALOGD_IF(TRACE, "BufferHubChannel::SignalAvailable: detached buffer.");
-  }
+  signaled_ = true;
+  const auto status = service_->ModifyChannelEvents(channel_id_, 0, POLLIN);
+  ALOGE_IF(!status,
+           "BufferHubChannel::SignalAvailable: failed to signal availability "
+           "channel_id=%d: %s",
+           channel_id_, status.GetErrorMessage().c_str());
 }
 
 void BufferHubChannel::ClearAvailable() {
@@ -463,31 +295,23 @@
   ALOGD_IF(TRACE,
            "BufferHubChannel::ClearAvailable: channel_id=%d buffer_id=%d",
            channel_id(), buffer_id());
-  if (!IsDetached()) {
-    signaled_ = false;
-    const auto status = service_->ModifyChannelEvents(channel_id_, POLLIN, 0);
-    ALOGE_IF(!status,
-             "BufferHubChannel::ClearAvailable: failed to clear availability "
-             "channel_id=%d: %s",
-             channel_id_, status.GetErrorMessage().c_str());
-  } else {
-    ALOGD_IF(TRACE, "BufferHubChannel::ClearAvailable: detached buffer.");
-  }
+  signaled_ = false;
+  const auto status = service_->ModifyChannelEvents(channel_id_, POLLIN, 0);
+  ALOGE_IF(!status,
+           "BufferHubChannel::ClearAvailable: failed to clear availability "
+           "channel_id=%d: %s",
+           channel_id_, status.GetErrorMessage().c_str());
 }
 
 void BufferHubChannel::Hangup() {
   ATRACE_NAME("BufferHubChannel::Hangup");
   ALOGD_IF(TRACE, "BufferHubChannel::Hangup: channel_id=%d buffer_id=%d",
            channel_id(), buffer_id());
-  if (!IsDetached()) {
-    const auto status = service_->ModifyChannelEvents(channel_id_, 0, POLLHUP);
-    ALOGE_IF(
-        !status,
-        "BufferHubChannel::Hangup: failed to signal hangup channel_id=%d: %s",
-        channel_id_, status.GetErrorMessage().c_str());
-  } else {
-    ALOGD_IF(TRACE, "BufferHubChannel::Hangup: detached buffer.");
-  }
+  const auto status = service_->ModifyChannelEvents(channel_id_, 0, POLLHUP);
+  ALOGE_IF(
+      !status,
+      "BufferHubChannel::Hangup: failed to signal hangup channel_id=%d: %s",
+      channel_id_, status.GetErrorMessage().c_str());
 }
 
 }  // namespace dvr
diff --git a/services/vr/bufferhubd/buffer_hub.h b/services/vr/bufferhubd/buffer_hub.h
index 270ac95..b487b0b 100644
--- a/services/vr/bufferhubd/buffer_hub.h
+++ b/services/vr/bufferhubd/buffer_hub.h
@@ -27,8 +27,6 @@
     kConsumerQueueType,
   };
 
-  enum : int { kDetachedId = -1 };
-
   BufferHubChannel(BufferHubService* service, int buffer_id, int channel_id,
                    ChannelType channel_type)
       : service_(service),
@@ -57,7 +55,6 @@
     uint64_t state = 0;
     uint64_t signaled_mask = 0;
     uint64_t index = 0;
-    std::string name;
 
     // Data filed for producer queue.
     size_t capacity = 0;
@@ -66,7 +63,7 @@
     BufferInfo(int id, size_t consumer_count, uint32_t width, uint32_t height,
                uint32_t layer_count, uint32_t format, uint64_t usage,
                size_t pending_count, uint64_t state, uint64_t signaled_mask,
-               uint64_t index, const std::string& name)
+               uint64_t index)
         : id(id),
           type(kProducerType),
           consumer_count(consumer_count),
@@ -78,8 +75,7 @@
           pending_count(pending_count),
           state(state),
           signaled_mask(signaled_mask),
-          index(index),
-          name(name) {}
+          index(index) {}
 
     BufferInfo(int id, size_t consumer_count, size_t capacity,
                const UsagePolicy& usage_policy)
@@ -109,19 +105,9 @@
   int buffer_id() const { return buffer_id_; }
 
   int channel_id() const { return channel_id_; }
-  bool IsDetached() const { return channel_id_ == kDetachedId; }
 
   bool signaled() const { return signaled_; }
 
-  void Detach() {
-    if (channel_type_ == kProducerType)
-      channel_id_ = kDetachedId;
-  }
-  void Attach(int channel_id) {
-    if (channel_type_ == kProducerType && channel_id_ == kDetachedId)
-      channel_id_ = channel_id;
-  }
-
  private:
   BufferHubService* service_;
 
@@ -132,8 +118,7 @@
   // general because channel ids are not used for any lookup in this service.
   int buffer_id_;
 
-  // The channel id of the buffer. This may change for a persistent producer
-  // buffer if it is detached and re-attached to another channel.
+  // The channel id of the buffer.
   int channel_id_;
 
   bool signaled_;
@@ -152,34 +137,15 @@
   pdx::Status<void> HandleMessage(pdx::Message& message) override;
   void HandleImpulse(pdx::Message& message) override;
 
-  void OnChannelClose(pdx::Message& message,
-                      const std::shared_ptr<pdx::Channel>& channel) override;
-
   bool IsInitialized() const override;
   std::string DumpState(size_t max_length) override;
 
-  bool AddNamedBuffer(const std::string& name,
-                      const std::shared_ptr<ProducerChannel>& buffer);
-  std::shared_ptr<ProducerChannel> GetNamedBuffer(const std::string& name);
-  bool RemoveNamedBuffer(const ProducerChannel& buffer);
-
  private:
   friend BASE;
 
-  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 usage, size_t meta_size_bytes);
-  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);
-  pdx::Status<void> OnGetPersistentBuffer(pdx::Message& message,
-                                          const std::string& name);
   pdx::Status<QueueInfo> OnCreateProducerQueue(
       pdx::Message& message, const ProducerQueueConfig& producer_config,
       const UsagePolicy& usage_policy);
diff --git a/services/vr/bufferhubd/producer_channel.cpp b/services/vr/bufferhubd/producer_channel.cpp
index 716db5e..8160193 100644
--- a/services/vr/bufferhubd/producer_channel.cpp
+++ b/services/vr/bufferhubd/producer_channel.cpp
@@ -145,7 +145,7 @@
   return BufferInfo(buffer_id(), consumer_channels_.size(), buffer_.width(),
                     buffer_.height(), buffer_.layer_count(), buffer_.format(),
                     buffer_.usage(), pending_consumers_, buffer_state_->load(),
-                    signaled_mask, metadata_header_->queue_index, name_);
+                    signaled_mask, metadata_header_->queue_index);
 }
 
 void ProducerChannel::HandleImpulse(Message& message) {
@@ -183,16 +183,6 @@
           *this, &ProducerChannel::OnProducerGain, message);
       return true;
 
-    case BufferHubRPC::ProducerMakePersistent::Opcode:
-      DispatchRemoteMethod<BufferHubRPC::ProducerMakePersistent>(
-          *this, &ProducerChannel::OnProducerMakePersistent, message);
-      return true;
-
-    case BufferHubRPC::ProducerRemovePersistence::Opcode:
-      DispatchRemoteMethod<BufferHubRPC::ProducerRemovePersistence>(
-          *this, &ProducerChannel::OnRemovePersistence, message);
-      return true;
-
     default:
       return false;
   }
@@ -459,50 +449,6 @@
       buffer_state_->load(), fence_state_->load());
 }
 
-Status<void> ProducerChannel::OnProducerMakePersistent(Message& message,
-                                                       const std::string& name,
-                                                       int user_id,
-                                                       int group_id) {
-  ATRACE_NAME("ProducerChannel::OnProducerMakePersistent");
-  ALOGD_IF(TRACE,
-           "ProducerChannel::OnProducerMakePersistent: buffer_id=%d name=%s "
-           "user_id=%d group_id=%d",
-           buffer_id(), name.c_str(), user_id, group_id);
-
-  if (name.empty() || (user_id < 0 && user_id != kNoCheckId) ||
-      (group_id < 0 && group_id != kNoCheckId)) {
-    return ErrorStatus(EINVAL);
-  }
-
-  // Try to add this buffer with the requested name.
-  if (service()->AddNamedBuffer(name, std::static_pointer_cast<ProducerChannel>(
-                                          shared_from_this()))) {
-    // If successful, set the requested permissions.
-
-    // A value of zero indicates that the ids from the sending process should be
-    // used.
-    if (user_id == kUseCallerId)
-      user_id = message.GetEffectiveUserId();
-    if (group_id == kUseCallerId)
-      group_id = message.GetEffectiveGroupId();
-
-    owner_user_id_ = user_id;
-    owner_group_id_ = group_id;
-    name_ = name;
-    return {};
-  } else {
-    // Otherwise a buffer with that name already exists.
-    return ErrorStatus(EALREADY);
-  }
-}
-
-Status<void> ProducerChannel::OnRemovePersistence(Message&) {
-  if (service()->RemoveNamedBuffer(*this))
-    return {};
-  else
-    return ErrorStatus(ENOENT);
-}
-
 void ProducerChannel::AddConsumer(ConsumerChannel* channel) {
   consumer_channels_.push_back(channel);
 }
@@ -546,16 +492,6 @@
   }
 }
 
-// Returns true if either the user or group ids match the owning ids or both
-// owning ids are not set, in which case access control does not apply.
-bool ProducerChannel::CheckAccess(int euid, int egid) {
-  const bool no_check =
-      owner_user_id_ == kNoCheckId && owner_group_id_ == kNoCheckId;
-  const bool euid_check = euid == owner_user_id_ || euid == kRootId;
-  const bool egid_check = egid == owner_group_id_ || egid == kRootId;
-  return no_check || euid_check || egid_check;
-}
-
 // Returns true if the given parameters match the underlying buffer parameters.
 bool ProducerChannel::CheckParameters(uint32_t width, uint32_t height,
                                       uint32_t layer_count, uint32_t format,
diff --git a/services/vr/bufferhubd/producer_channel.h b/services/vr/bufferhubd/producer_channel.h
index e280f4d..c5dbf0e 100644
--- a/services/vr/bufferhubd/producer_channel.h
+++ b/services/vr/bufferhubd/producer_channel.h
@@ -57,16 +57,10 @@
   void AddConsumer(ConsumerChannel* channel);
   void RemoveConsumer(ConsumerChannel* channel);
 
-  bool CheckAccess(int euid, int egid);
   bool CheckParameters(uint32_t width, uint32_t height, uint32_t layer_count,
                        uint32_t format, uint64_t usage,
                        size_t user_metadata_size);
 
-  pdx::Status<void> OnProducerMakePersistent(Message& message,
-                                             const std::string& name,
-                                             int user_id, int group_id);
-  pdx::Status<void> OnRemovePersistence(Message& message);
-
  private:
   std::vector<ConsumerChannel*> consumer_channels_;
   // This counts the number of consumers left to process this buffer. If this is
@@ -98,16 +92,6 @@
   pdx::LocalHandle release_fence_fd_;
   pdx::LocalHandle dummy_fence_fd_;
 
-  static constexpr int kNoCheckId = -1;
-  static constexpr int kUseCallerId = 0;
-  static constexpr int kRootId = 0;
-
-  // User and group id to check when obtaining a persistent buffer.
-  int owner_user_id_ = kNoCheckId;
-  int owner_group_id_ = kNoCheckId;
-
-  std::string name_;
-
   ProducerChannel(BufferHubService* service, int channel, uint32_t width,
                   uint32_t height, uint32_t layer_count, uint32_t format,
                   uint64_t usage, size_t user_metadata_size, int* error);