liboboe: rename Oboe to AAudio

All of the edits were done using scripts in media/liboboe/scripts.
The conversion is done using SED, which is called from
convert_oboe_aaudio.sh
The conversion can be reverted when debugging using revert_all_aaudio.sh
The string substitutions are in oboe_to_aaudio.sed

Bug: 34749573
Test: cts/tests/tests/nativemedia/aaudio

Change-Id: Ia10b34472a90df2652b87607c99156e9084e57aa
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/media/liboboe/src/binding/OboeServiceDefinitions.h b/media/liboboe/src/binding/AAudioServiceDefinitions.h
similarity index 87%
rename from media/liboboe/src/binding/OboeServiceDefinitions.h
rename to media/liboboe/src/binding/AAudioServiceDefinitions.h
index 33a192f..ca637ef 100644
--- a/media/liboboe/src/binding/OboeServiceDefinitions.h
+++ b/media/liboboe/src/binding/AAudioServiceDefinitions.h
@@ -14,22 +14,22 @@
  * limitations under the License.
  */
 
-#ifndef BINDING_OBOESERVICEDEFINITIONS_H
-#define BINDING_OBOESERVICEDEFINITIONS_H
+#ifndef BINDING_AAUDIOSERVICEDEFINITIONS_H
+#define BINDING_AAUDIOSERVICEDEFINITIONS_H
 
 #include <stdint.h>
 #include <utils/RefBase.h>
 #include <binder/TextOutput.h>
 #include <binder/IInterface.h>
 
-#include <oboe/OboeAudio.h>
+#include <aaudio/AAudio.h>
 
 using android::NO_ERROR;
 using android::IBinder;
 
 namespace android {
 
-enum oboe_commands_t {
+enum aaudio_commands_t {
     OPEN_STREAM = IBinder::FIRST_CALL_TRANSACTION,
     CLOSE_STREAM,
     GET_STREAM_DESCRIPTION,
@@ -42,9 +42,9 @@
 
 } // namespace android
 
-namespace oboe {
+namespace aaudio {
 
-enum oboe_commands_t {
+enum aaudio_commands_t {
     OPEN_STREAM = IBinder::FIRST_CALL_TRANSACTION,
     CLOSE_STREAM,
     GET_STREAM_DESCRIPTION,
@@ -56,12 +56,12 @@
 };
 
 // TODO Expand this to include all the open parameters.
-typedef struct OboeServiceStreamInfo_s {
+typedef struct AAudioServiceStreamInfo_s {
     int32_t             deviceId;
     int32_t             samplesPerFrame;  // number of channels
-    oboe_sample_rate_t  sampleRate;
-    oboe_audio_format_t audioFormat;
-} OboeServiceStreamInfo;
+    aaudio_sample_rate_t  sampleRate;
+    aaudio_audio_format_t audioFormat;
+} AAudioServiceStreamInfo;
 
 // This must be a fixed width so it can be in shared memory.
 enum RingbufferFlags : uint32_t {
@@ -95,6 +95,6 @@
     RingBufferDescriptor downDataQueueDescriptor;    // eg. playback
 } EndpointDescriptor;
 
-} // namespace oboe
+} // namespace aaudio
 
-#endif //BINDING_OBOESERVICEDEFINITIONS_H
+#endif //BINDING_AAUDIOSERVICEDEFINITIONS_H
diff --git a/media/liboboe/src/binding/AAudioServiceMessage.h b/media/liboboe/src/binding/AAudioServiceMessage.h
new file mode 100644
index 0000000..16cb5eb
--- /dev/null
+++ b/media/liboboe/src/binding/AAudioServiceMessage.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AAUDIO_AAUDIO_SERVICE_MESSAGE_H
+#define AAUDIO_AAUDIO_SERVICE_MESSAGE_H
+
+#include <stdint.h>
+
+#include <aaudio/AAudioDefinitions.h>
+
+namespace aaudio {
+
+// TODO move this an "include" folder for the service.
+
+struct AAudioMessageTimestamp {
+    aaudio_position_frames_t position;
+    int64_t                deviceOffset; // add to client position to get device position
+    aaudio_nanoseconds_t     timestamp;
+};
+
+typedef enum aaudio_service_event_e : uint32_t {
+    AAUDIO_SERVICE_EVENT_STARTED,
+    AAUDIO_SERVICE_EVENT_PAUSED,
+    AAUDIO_SERVICE_EVENT_FLUSHED,
+    AAUDIO_SERVICE_EVENT_CLOSED,
+    AAUDIO_SERVICE_EVENT_DISCONNECTED
+} aaudio_service_event_t;
+
+struct AAudioMessageEvent {
+    aaudio_service_event_t event;
+    int32_t data1;
+    int64_t data2;
+};
+
+typedef struct AAudioServiceMessage_s {
+    enum class code : uint32_t {
+        NOTHING,
+        TIMESTAMP,
+        EVENT,
+    };
+
+    code what;
+    union {
+        AAudioMessageTimestamp timestamp;
+        AAudioMessageEvent event;
+    };
+} AAudioServiceMessage;
+
+
+} /* namespace aaudio */
+
+#endif //AAUDIO_AAUDIO_SERVICE_MESSAGE_H
diff --git a/media/liboboe/src/binding/AAudioStreamConfiguration.cpp b/media/liboboe/src/binding/AAudioStreamConfiguration.cpp
new file mode 100644
index 0000000..1cb2bfa
--- /dev/null
+++ b/media/liboboe/src/binding/AAudioStreamConfiguration.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+#include <sys/mman.h>
+#include <binder/Parcel.h>
+#include <binder/Parcelable.h>
+
+#include <aaudio/AAudioDefinitions.h>
+
+#include "binding/AAudioStreamConfiguration.h"
+
+using android::NO_ERROR;
+using android::status_t;
+using android::Parcel;
+using android::Parcelable;
+
+using namespace aaudio;
+
+AAudioStreamConfiguration::AAudioStreamConfiguration() {}
+AAudioStreamConfiguration::~AAudioStreamConfiguration() {}
+
+status_t AAudioStreamConfiguration::writeToParcel(Parcel* parcel) const {
+    parcel->writeInt32(mDeviceId);
+    parcel->writeInt32(mSampleRate);
+    parcel->writeInt32(mSamplesPerFrame);
+    parcel->writeInt32((int32_t) mAudioFormat);
+    return NO_ERROR; // TODO check for errors above
+}
+
+status_t AAudioStreamConfiguration::readFromParcel(const Parcel* parcel) {
+    int32_t temp;
+    parcel->readInt32(&mDeviceId);
+    parcel->readInt32(&mSampleRate);
+    parcel->readInt32(&mSamplesPerFrame);
+    parcel->readInt32(&temp);
+    mAudioFormat = (aaudio_audio_format_t) temp;
+    return NO_ERROR; // TODO check for errors above
+}
+
+aaudio_result_t AAudioStreamConfiguration::validate() {
+    // Validate results of the open.
+    if (mSampleRate < 0 || mSampleRate >= 8 * 48000) { // TODO review limits
+        ALOGE("AAudioStreamConfiguration.validate(): invalid sampleRate = %d", mSampleRate);
+        return AAUDIO_ERROR_INTERNAL;
+    }
+
+    if (mSamplesPerFrame < 1 || mSamplesPerFrame >= 32) { // TODO review limits
+        ALOGE("AAudioStreamConfiguration.validate() invalid samplesPerFrame = %d", mSamplesPerFrame);
+        return AAUDIO_ERROR_INTERNAL;
+    }
+
+    switch (mAudioFormat) {
+    case AAUDIO_FORMAT_PCM_I16:
+    case AAUDIO_FORMAT_PCM_FLOAT:
+    case AAUDIO_FORMAT_PCM_I8_24:
+    case AAUDIO_FORMAT_PCM_I32:
+        break;
+    default:
+        ALOGE("AAudioStreamConfiguration.validate() invalid audioFormat = %d", mAudioFormat);
+        return AAUDIO_ERROR_INTERNAL;
+    }
+    return AAUDIO_OK;
+}
+
+void AAudioStreamConfiguration::dump() {
+    ALOGD("AAudioStreamConfiguration mSampleRate = %d -----", mSampleRate);
+    ALOGD("AAudioStreamConfiguration mSamplesPerFrame = %d", mSamplesPerFrame);
+    ALOGD("AAudioStreamConfiguration mAudioFormat = %d", (int)mAudioFormat);
+}
diff --git a/media/liboboe/src/binding/AAudioStreamConfiguration.h b/media/liboboe/src/binding/AAudioStreamConfiguration.h
new file mode 100644
index 0000000..ef21443
--- /dev/null
+++ b/media/liboboe/src/binding/AAudioStreamConfiguration.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BINDING_AAUDIO_STREAM_CONFIGURATION_H
+#define BINDING_AAUDIO_STREAM_CONFIGURATION_H
+
+#include <stdint.h>
+
+#include <binder/Parcel.h>
+#include <binder/Parcelable.h>
+#include <aaudio/AAudioDefinitions.h>
+
+using android::status_t;
+using android::Parcel;
+using android::Parcelable;
+
+namespace aaudio {
+
+class AAudioStreamConfiguration : public Parcelable {
+public:
+    AAudioStreamConfiguration();
+    virtual ~AAudioStreamConfiguration();
+
+    aaudio_device_id_t getDeviceId() const {
+        return mDeviceId;
+    }
+
+    void setDeviceId(aaudio_device_id_t deviceId) {
+        mDeviceId = deviceId;
+    }
+
+    aaudio_sample_rate_t getSampleRate() const {
+        return mSampleRate;
+    }
+
+    void setSampleRate(aaudio_sample_rate_t sampleRate) {
+        mSampleRate = sampleRate;
+    }
+
+    int32_t getSamplesPerFrame() const {
+        return mSamplesPerFrame;
+    }
+
+    void setSamplesPerFrame(int32_t samplesPerFrame) {
+        mSamplesPerFrame = samplesPerFrame;
+    }
+
+    aaudio_audio_format_t getAudioFormat() const {
+        return mAudioFormat;
+    }
+
+    void setAudioFormat(aaudio_audio_format_t audioFormat) {
+        mAudioFormat = audioFormat;
+    }
+
+    virtual status_t writeToParcel(Parcel* parcel) const override;
+
+    virtual status_t readFromParcel(const Parcel* parcel) override;
+
+    aaudio_result_t validate();
+
+    void dump();
+
+protected:
+    aaudio_device_id_t    mDeviceId        = AAUDIO_DEVICE_UNSPECIFIED;
+    aaudio_sample_rate_t  mSampleRate      = AAUDIO_UNSPECIFIED;
+    int32_t             mSamplesPerFrame = AAUDIO_UNSPECIFIED;
+    aaudio_audio_format_t mAudioFormat     = AAUDIO_FORMAT_UNSPECIFIED;
+};
+
+} /* namespace aaudio */
+
+#endif //BINDING_AAUDIO_STREAM_CONFIGURATION_H
diff --git a/media/liboboe/src/binding/OboeStreamRequest.cpp b/media/liboboe/src/binding/AAudioStreamRequest.cpp
similarity index 69%
rename from media/liboboe/src/binding/OboeStreamRequest.cpp
rename to media/liboboe/src/binding/AAudioStreamRequest.cpp
index 5d521d0..5202b73 100644
--- a/media/liboboe/src/binding/OboeStreamRequest.cpp
+++ b/media/liboboe/src/binding/AAudioStreamRequest.cpp
@@ -20,32 +20,32 @@
 #include <binder/Parcel.h>
 #include <binder/Parcelable.h>
 
-#include <oboe/OboeDefinitions.h>
+#include <aaudio/AAudioDefinitions.h>
 
-#include "binding/OboeStreamConfiguration.h"
-#include "binding/OboeStreamRequest.h"
+#include "binding/AAudioStreamConfiguration.h"
+#include "binding/AAudioStreamRequest.h"
 
 using android::NO_ERROR;
 using android::status_t;
 using android::Parcel;
 using android::Parcelable;
 
-using namespace oboe;
+using namespace aaudio;
 
-OboeStreamRequest::OboeStreamRequest()
+AAudioStreamRequest::AAudioStreamRequest()
     : mConfiguration()
     {}
 
-OboeStreamRequest::~OboeStreamRequest() {}
+AAudioStreamRequest::~AAudioStreamRequest() {}
 
-status_t OboeStreamRequest::writeToParcel(Parcel* parcel) const {
+status_t AAudioStreamRequest::writeToParcel(Parcel* parcel) const {
     parcel->writeInt32((int32_t) mUserId);
     parcel->writeInt32((int32_t) mProcessId);
     mConfiguration.writeToParcel(parcel);
     return NO_ERROR; // TODO check for errors above
 }
 
-status_t OboeStreamRequest::readFromParcel(const Parcel* parcel) {
+status_t AAudioStreamRequest::readFromParcel(const Parcel* parcel) {
     int32_t temp;
     parcel->readInt32(&temp);
     mUserId = (uid_t) temp;
@@ -55,12 +55,12 @@
     return NO_ERROR; // TODO check for errors above
 }
 
-oboe_result_t OboeStreamRequest::validate() {
+aaudio_result_t AAudioStreamRequest::validate() {
     return mConfiguration.validate();
 }
 
-void OboeStreamRequest::dump() {
-    ALOGD("OboeStreamRequest mUserId = %d -----", mUserId);
-    ALOGD("OboeStreamRequest mProcessId = %d", mProcessId);
+void AAudioStreamRequest::dump() {
+    ALOGD("AAudioStreamRequest mUserId = %d -----", mUserId);
+    ALOGD("AAudioStreamRequest mProcessId = %d", mProcessId);
     mConfiguration.dump();
 }
diff --git a/media/liboboe/src/binding/OboeStreamRequest.h b/media/liboboe/src/binding/AAudioStreamRequest.h
similarity index 72%
rename from media/liboboe/src/binding/OboeStreamRequest.h
rename to media/liboboe/src/binding/AAudioStreamRequest.h
index aab3c97..0fd28ba 100644
--- a/media/liboboe/src/binding/OboeStreamRequest.h
+++ b/media/liboboe/src/binding/AAudioStreamRequest.h
@@ -14,27 +14,27 @@
  * limitations under the License.
  */
 
-#ifndef BINDING_OBOE_STREAM_REQUEST_H
-#define BINDING_OBOE_STREAM_REQUEST_H
+#ifndef BINDING_AAUDIO_STREAM_REQUEST_H
+#define BINDING_AAUDIO_STREAM_REQUEST_H
 
 #include <stdint.h>
 
 #include <binder/Parcel.h>
 #include <binder/Parcelable.h>
-#include <oboe/OboeDefinitions.h>
+#include <aaudio/AAudioDefinitions.h>
 
-#include "binding/OboeStreamConfiguration.h"
+#include "binding/AAudioStreamConfiguration.h"
 
 using android::status_t;
 using android::Parcel;
 using android::Parcelable;
 
-namespace oboe {
+namespace aaudio {
 
-class OboeStreamRequest : public Parcelable {
+class AAudioStreamRequest : public Parcelable {
 public:
-    OboeStreamRequest();
-    virtual ~OboeStreamRequest();
+    AAudioStreamRequest();
+    virtual ~AAudioStreamRequest();
 
     uid_t getUserId() const {
         return mUserId;
@@ -52,7 +52,7 @@
         mProcessId = processId;
     }
 
-    OboeStreamConfiguration &getConfiguration() {
+    AAudioStreamConfiguration &getConfiguration() {
         return mConfiguration;
     }
 
@@ -60,16 +60,16 @@
 
     virtual status_t readFromParcel(const Parcel* parcel) override;
 
-    oboe_result_t validate();
+    aaudio_result_t validate();
 
     void dump();
 
 protected:
-    OboeStreamConfiguration  mConfiguration;
+    AAudioStreamConfiguration  mConfiguration;
     uid_t    mUserId;
     pid_t    mProcessId;
 };
 
-} /* namespace oboe */
+} /* namespace aaudio */
 
-#endif //BINDING_OBOE_STREAM_REQUEST_H
+#endif //BINDING_AAUDIO_STREAM_REQUEST_H
diff --git a/media/liboboe/src/binding/AudioEndpointParcelable.cpp b/media/liboboe/src/binding/AudioEndpointParcelable.cpp
index 096a819..f40ee02 100644
--- a/media/liboboe/src/binding/AudioEndpointParcelable.cpp
+++ b/media/liboboe/src/binding/AudioEndpointParcelable.cpp
@@ -20,7 +20,7 @@
 #include <binder/Parcel.h>
 #include <binder/Parcelable.h>
 
-#include "binding/OboeServiceDefinitions.h"
+#include "binding/AAudioServiceDefinitions.h"
 #include "binding/RingBufferParcelable.h"
 #include "binding/AudioEndpointParcelable.h"
 
@@ -29,11 +29,11 @@
 using android::Parcel;
 using android::Parcelable;
 
-using namespace oboe;
+using namespace aaudio;
 
 /**
  * Container for information about the message queues plus
- * general stream information needed by Oboe clients.
+ * general stream information needed by AAudio clients.
  * It contains no addresses, just sizes, offsets and file descriptors for
  * shared memory that can be passed through Binder.
  */
@@ -47,7 +47,7 @@
  */
 int32_t AudioEndpointParcelable::addFileDescriptor(int fd, int32_t sizeInBytes) {
     if (mNumSharedMemories >= MAX_SHARED_MEMORIES) {
-        return OBOE_ERROR_OUT_OF_RANGE;
+        return AAUDIO_ERROR_OUT_OF_RANGE;
     }
     int32_t index = mNumSharedMemories++;
     mSharedMemories[index].setup(fd, sizeInBytes);
@@ -81,45 +81,45 @@
     return NO_ERROR; // TODO check for errors above
 }
 
-oboe_result_t AudioEndpointParcelable::resolve(EndpointDescriptor *descriptor) {
+aaudio_result_t AudioEndpointParcelable::resolve(EndpointDescriptor *descriptor) {
     // TODO error check
     mUpMessageQueueParcelable.resolve(mSharedMemories, &descriptor->upMessageQueueDescriptor);
     mDownMessageQueueParcelable.resolve(mSharedMemories,
                                         &descriptor->downMessageQueueDescriptor);
     mUpDataQueueParcelable.resolve(mSharedMemories, &descriptor->upDataQueueDescriptor);
     mDownDataQueueParcelable.resolve(mSharedMemories, &descriptor->downDataQueueDescriptor);
-    return OBOE_OK;
+    return AAUDIO_OK;
 }
 
-oboe_result_t AudioEndpointParcelable::validate() {
-    oboe_result_t result;
+aaudio_result_t AudioEndpointParcelable::validate() {
+    aaudio_result_t result;
     if (mNumSharedMemories < 0 || mNumSharedMemories >= MAX_SHARED_MEMORIES) {
         ALOGE("AudioEndpointParcelable invalid mNumSharedMemories = %d", mNumSharedMemories);
-        return OBOE_ERROR_INTERNAL;
+        return AAUDIO_ERROR_INTERNAL;
     }
     for (int i = 0; i < mNumSharedMemories; i++) {
         result = mSharedMemories[i].validate();
-        if (result != OBOE_OK) {
+        if (result != AAUDIO_OK) {
             return result;
         }
     }
-    if ((result = mUpMessageQueueParcelable.validate()) != OBOE_OK) {
+    if ((result = mUpMessageQueueParcelable.validate()) != AAUDIO_OK) {
         ALOGE("AudioEndpointParcelable invalid mUpMessageQueueParcelable = %d", result);
         return result;
     }
-    if ((result = mDownMessageQueueParcelable.validate()) != OBOE_OK) {
+    if ((result = mDownMessageQueueParcelable.validate()) != AAUDIO_OK) {
         ALOGE("AudioEndpointParcelable invalid mDownMessageQueueParcelable = %d", result);
         return result;
     }
-    if ((result = mUpDataQueueParcelable.validate()) != OBOE_OK) {
+    if ((result = mUpDataQueueParcelable.validate()) != AAUDIO_OK) {
         ALOGE("AudioEndpointParcelable invalid mUpDataQueueParcelable = %d", result);
         return result;
     }
-    if ((result = mDownDataQueueParcelable.validate()) != OBOE_OK) {
+    if ((result = mDownDataQueueParcelable.validate()) != AAUDIO_OK) {
         ALOGE("AudioEndpointParcelable invalid mDownDataQueueParcelable = %d", result);
         return result;
     }
-    return OBOE_OK;
+    return AAUDIO_OK;
 }
 
 void AudioEndpointParcelable::dump() {
diff --git a/media/liboboe/src/binding/AudioEndpointParcelable.h b/media/liboboe/src/binding/AudioEndpointParcelable.h
index 6bdd8a4..d4646d0 100644
--- a/media/liboboe/src/binding/AudioEndpointParcelable.h
+++ b/media/liboboe/src/binding/AudioEndpointParcelable.h
@@ -23,18 +23,18 @@
 #include <binder/Parcel.h>
 #include <binder/Parcelable.h>
 
-#include "binding/OboeServiceDefinitions.h"
+#include "binding/AAudioServiceDefinitions.h"
 #include "binding/RingBufferParcelable.h"
 
 using android::status_t;
 using android::Parcel;
 using android::Parcelable;
 
-namespace oboe {
+namespace aaudio {
 
 /**
  * Container for information about the message queues plus
- * general stream information needed by Oboe clients.
+ * general stream information needed by AAudio clients.
  * It contains no addresses, just sizes, offsets and file descriptors for
  * shared memory that can be passed through Binder.
  */
@@ -53,9 +53,9 @@
 
     virtual status_t readFromParcel(const Parcel* parcel) override;
 
-    oboe_result_t resolve(EndpointDescriptor *descriptor);
+    aaudio_result_t resolve(EndpointDescriptor *descriptor);
 
-    oboe_result_t validate();
+    aaudio_result_t validate();
 
     void dump();
 
@@ -71,6 +71,6 @@
     SharedMemoryParcelable  mSharedMemories[MAX_SHARED_MEMORIES];
 };
 
-} /* namespace oboe */
+} /* namespace aaudio */
 
 #endif //BINDING_AUDIOENDPOINTPARCELABLE_H
diff --git a/media/liboboe/src/binding/IAAudioService.cpp b/media/liboboe/src/binding/IAAudioService.cpp
new file mode 100644
index 0000000..899ebc0
--- /dev/null
+++ b/media/liboboe/src/binding/IAAudioService.cpp
@@ -0,0 +1,284 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aaudio/AAudioDefinitions.h>
+
+#include "binding/AudioEndpointParcelable.h"
+#include "binding/AAudioStreamRequest.h"
+#include "binding/AAudioStreamConfiguration.h"
+#include "binding/IAAudioService.h"
+#include "utility/AAudioUtilities.h"
+
+namespace android {
+
+/**
+ * This is used by the AAudio Client to talk to the AAudio Service.
+ *
+ * The order of parameters in the Parcels must match with code in AAudioService.cpp.
+ */
+class BpAAudioService : public BpInterface<IAAudioService>
+{
+public:
+    explicit BpAAudioService(const sp<IBinder>& impl)
+        : BpInterface<IAAudioService>(impl)
+    {
+    }
+
+    virtual aaudio_handle_t openStream(aaudio::AAudioStreamRequest &request,
+                                     aaudio::AAudioStreamConfiguration &configuration) override {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        request.writeToParcel(&data);
+        status_t err = remote()->transact(OPEN_STREAM, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        aaudio_handle_t stream;
+        reply.readInt32(&stream);
+        configuration.readFromParcel(&reply);
+        return stream;
+    }
+
+    virtual aaudio_result_t closeStream(aaudio_handle_t streamHandle) override {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        data.writeInt32(streamHandle);
+        status_t err = remote()->transact(CLOSE_STREAM, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        aaudio_result_t res;
+        reply.readInt32(&res);
+        return res;
+    }
+
+    virtual aaudio_result_t getStreamDescription(aaudio_handle_t streamHandle,
+                                               aaudio::AudioEndpointParcelable &parcelable)   {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        data.writeInt32(streamHandle);
+        status_t err = remote()->transact(GET_STREAM_DESCRIPTION, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        parcelable.readFromParcel(&reply);
+        parcelable.dump();
+        aaudio_result_t result = parcelable.validate();
+        if (result != AAUDIO_OK) {
+            return result;
+        }
+        reply.readInt32(&result);
+        return result;
+    }
+
+    // TODO should we wait for a reply?
+    virtual aaudio_result_t startStream(aaudio_handle_t streamHandle) override {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        data.writeInt32(streamHandle);
+        status_t err = remote()->transact(START_STREAM, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        aaudio_result_t res;
+        reply.readInt32(&res);
+        return res;
+    }
+
+    virtual aaudio_result_t pauseStream(aaudio_handle_t streamHandle) override {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        data.writeInt32(streamHandle);
+        status_t err = remote()->transact(PAUSE_STREAM, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        aaudio_result_t res;
+        reply.readInt32(&res);
+        return res;
+    }
+
+    virtual aaudio_result_t flushStream(aaudio_handle_t streamHandle) override {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        data.writeInt32(streamHandle);
+        status_t err = remote()->transact(FLUSH_STREAM, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        aaudio_result_t res;
+        reply.readInt32(&res);
+        return res;
+    }
+
+    virtual aaudio_result_t registerAudioThread(aaudio_handle_t streamHandle, pid_t clientThreadId,
+                                              aaudio_nanoseconds_t periodNanoseconds)
+    override {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        data.writeInt32(streamHandle);
+        data.writeInt32((int32_t) clientThreadId);
+        data.writeInt64(periodNanoseconds);
+        status_t err = remote()->transact(REGISTER_AUDIO_THREAD, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        aaudio_result_t res;
+        reply.readInt32(&res);
+        return res;
+    }
+
+    virtual aaudio_result_t unregisterAudioThread(aaudio_handle_t streamHandle, pid_t clientThreadId)
+    override {
+        Parcel data, reply;
+        // send command
+        data.writeInterfaceToken(IAAudioService::getInterfaceDescriptor());
+        data.writeInt32(streamHandle);
+        data.writeInt32((int32_t) clientThreadId);
+        status_t err = remote()->transact(UNREGISTER_AUDIO_THREAD, data, &reply);
+        if (err != NO_ERROR) {
+            return AAudioConvert_androidToAAudioResult(err);
+        }
+        // parse reply
+        aaudio_result_t res;
+        reply.readInt32(&res);
+        return res;
+    }
+
+};
+
+// Implement an interface to the service.
+// This is here so that you don't have to link with liboboe static library.
+IMPLEMENT_META_INTERFACE(AAudioService, "IAAudioService");
+
+// The order of parameters in the Parcels must match with code in BpAAudioService
+
+status_t BnAAudioService::onTransact(uint32_t code, const Parcel& data,
+                                        Parcel* reply, uint32_t flags) {
+    AAudioStream stream;
+    aaudio::AAudioStreamRequest request;
+    aaudio::AAudioStreamConfiguration configuration;
+    pid_t pid;
+    aaudio_nanoseconds_t nanoseconds;
+    aaudio_result_t result;
+    ALOGV("BnAAudioService::onTransact(%i) %i", code, flags);
+    data.checkInterface(this);
+
+    switch(code) {
+        case OPEN_STREAM: {
+            request.readFromParcel(&data);
+            stream = openStream(request, configuration);
+            ALOGD("BnAAudioService::onTransact OPEN_STREAM server handle = 0x%08X", stream);
+            reply->writeInt32(stream);
+            configuration.writeToParcel(reply);
+            return NO_ERROR;
+        } break;
+
+        case CLOSE_STREAM: {
+            data.readInt32(&stream);
+            ALOGD("BnAAudioService::onTransact CLOSE_STREAM 0x%08X", stream);
+            result = closeStream(stream);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        } break;
+
+        case GET_STREAM_DESCRIPTION: {
+            data.readInt32(&stream);
+            ALOGD("BnAAudioService::onTransact GET_STREAM_DESCRIPTION 0x%08X", stream);
+            aaudio::AudioEndpointParcelable parcelable;
+            result = getStreamDescription(stream, parcelable);
+            if (result != AAUDIO_OK) {
+                return AAudioConvert_aaudioToAndroidStatus(result);
+            }
+            parcelable.dump();
+            result = parcelable.validate();
+            if (result != AAUDIO_OK) {
+                return AAudioConvert_aaudioToAndroidStatus(result);
+            }
+            parcelable.writeToParcel(reply);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        } break;
+
+        case START_STREAM: {
+            data.readInt32(&stream);
+            result = startStream(stream);
+            ALOGD("BnAAudioService::onTransact START_STREAM 0x%08X, result = %d",
+                    stream, result);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        } break;
+
+        case PAUSE_STREAM: {
+            data.readInt32(&stream);
+            result = pauseStream(stream);
+            ALOGD("BnAAudioService::onTransact PAUSE_STREAM 0x%08X, result = %d",
+                    stream, result);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        } break;
+
+        case FLUSH_STREAM: {
+            data.readInt32(&stream);
+            result = flushStream(stream);
+            ALOGD("BnAAudioService::onTransact FLUSH_STREAM 0x%08X, result = %d",
+                    stream, result);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        } break;
+
+        case REGISTER_AUDIO_THREAD: {
+            data.readInt32(&stream);
+            data.readInt32(&pid);
+            data.readInt64(&nanoseconds);
+            result = registerAudioThread(stream, pid, nanoseconds);
+            ALOGD("BnAAudioService::onTransact REGISTER_AUDIO_THREAD 0x%08X, result = %d",
+                    stream, result);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        } break;
+
+        case UNREGISTER_AUDIO_THREAD: {
+            data.readInt32(&stream);
+            data.readInt32(&pid);
+            result = unregisterAudioThread(stream, pid);
+            ALOGD("BnAAudioService::onTransact UNREGISTER_AUDIO_THREAD 0x%08X, result = %d",
+                    stream, result);
+            reply->writeInt32(result);
+            return NO_ERROR;
+        } break;
+
+        default:
+            // ALOGW("BnAAudioService::onTransact not handled %u", code);
+            return BBinder::onTransact(code, data, reply, flags);
+    }
+}
+
+} /* namespace android */
diff --git a/media/liboboe/src/binding/IAAudioService.h b/media/liboboe/src/binding/IAAudioService.h
new file mode 100644
index 0000000..7d2fd29
--- /dev/null
+++ b/media/liboboe/src/binding/IAAudioService.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BINDING_IAAUDIOSERVICE_H
+#define BINDING_IAAUDIOSERVICE_H
+
+#include <stdint.h>
+#include <utils/RefBase.h>
+#include <binder/TextOutput.h>
+#include <binder/IInterface.h>
+
+#include <aaudio/AAudio.h>
+
+#include "binding/AAudioServiceDefinitions.h"
+#include "binding/AudioEndpointParcelable.h"
+#include "binding/AAudioStreamRequest.h"
+#include "binding/AAudioStreamConfiguration.h"
+
+
+namespace android {
+
+// Interface (our AIDL) - Shared by server and client
+class IAAudioService : public IInterface {
+public:
+
+    DECLARE_META_INTERFACE(AAudioService);
+
+    virtual aaudio_handle_t openStream(aaudio::AAudioStreamRequest &request,
+                                     aaudio::AAudioStreamConfiguration &configuration) = 0;
+
+    virtual aaudio_result_t closeStream(aaudio_handle_t streamHandle) = 0;
+
+    /* Get an immutable description of the in-memory queues
+    * used to communicate with the underlying HAL or Service.
+    */
+    virtual aaudio_result_t getStreamDescription(aaudio_handle_t streamHandle,
+                                               aaudio::AudioEndpointParcelable &parcelable) = 0;
+
+    /**
+     * Start the flow of data.
+     */
+    virtual aaudio_result_t startStream(aaudio_handle_t streamHandle) = 0;
+
+    /**
+     * Stop the flow of data such that start() can resume without loss of data.
+     */
+    virtual aaudio_result_t pauseStream(aaudio_handle_t streamHandle) = 0;
+
+    /**
+     *  Discard any data held by the underlying HAL or Service.
+     */
+    virtual aaudio_result_t flushStream(aaudio_handle_t streamHandle) = 0;
+
+    /**
+     * Manage the specified thread as a low latency audio thread.
+     */
+    virtual aaudio_result_t registerAudioThread(aaudio_handle_t streamHandle, pid_t clientThreadId,
+                                              aaudio_nanoseconds_t periodNanoseconds) = 0;
+
+    virtual aaudio_result_t unregisterAudioThread(aaudio_handle_t streamHandle,
+                                                pid_t clientThreadId) = 0;
+};
+
+class BnAAudioService : public BnInterface<IAAudioService> {
+public:
+    virtual status_t onTransact(uint32_t code, const Parcel& data,
+                                Parcel* reply, uint32_t flags = 0);
+
+};
+
+} /* namespace android */
+
+#endif //BINDING_IAAUDIOSERVICE_H
diff --git a/media/liboboe/src/binding/IOboeAudioService.cpp b/media/liboboe/src/binding/IOboeAudioService.cpp
deleted file mode 100644
index 2584bc9..0000000
--- a/media/liboboe/src/binding/IOboeAudioService.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <oboe/OboeDefinitions.h>
-
-#include "binding/AudioEndpointParcelable.h"
-#include "binding/OboeStreamRequest.h"
-#include "binding/OboeStreamConfiguration.h"
-#include "binding/IOboeAudioService.h"
-#include "utility/OboeUtilities.h"
-
-namespace android {
-
-/**
- * This is used by the Oboe Client to talk to the Oboe Service.
- *
- * The order of parameters in the Parcels must match with code in OboeAudioService.cpp.
- */
-class BpOboeAudioService : public BpInterface<IOboeAudioService>
-{
-public:
-    explicit BpOboeAudioService(const sp<IBinder>& impl)
-        : BpInterface<IOboeAudioService>(impl)
-    {
-    }
-
-    virtual oboe_handle_t openStream(oboe::OboeStreamRequest &request,
-                                     oboe::OboeStreamConfiguration &configuration) override {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        request.writeToParcel(&data);
-        status_t err = remote()->transact(OPEN_STREAM, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        oboe_handle_t stream;
-        reply.readInt32(&stream);
-        configuration.readFromParcel(&reply);
-        return stream;
-    }
-
-    virtual oboe_result_t closeStream(oboe_handle_t streamHandle) override {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        data.writeInt32(streamHandle);
-        status_t err = remote()->transact(CLOSE_STREAM, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        oboe_result_t res;
-        reply.readInt32(&res);
-        return res;
-    }
-
-    virtual oboe_result_t getStreamDescription(oboe_handle_t streamHandle,
-                                               oboe::AudioEndpointParcelable &parcelable)   {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        data.writeInt32(streamHandle);
-        status_t err = remote()->transact(GET_STREAM_DESCRIPTION, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        parcelable.readFromParcel(&reply);
-        parcelable.dump();
-        oboe_result_t result = parcelable.validate();
-        if (result != OBOE_OK) {
-            return result;
-        }
-        reply.readInt32(&result);
-        return result;
-    }
-
-    // TODO should we wait for a reply?
-    virtual oboe_result_t startStream(oboe_handle_t streamHandle) override {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        data.writeInt32(streamHandle);
-        status_t err = remote()->transact(START_STREAM, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        oboe_result_t res;
-        reply.readInt32(&res);
-        return res;
-    }
-
-    virtual oboe_result_t pauseStream(oboe_handle_t streamHandle) override {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        data.writeInt32(streamHandle);
-        status_t err = remote()->transact(PAUSE_STREAM, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        oboe_result_t res;
-        reply.readInt32(&res);
-        return res;
-    }
-
-    virtual oboe_result_t flushStream(oboe_handle_t streamHandle) override {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        data.writeInt32(streamHandle);
-        status_t err = remote()->transact(FLUSH_STREAM, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        oboe_result_t res;
-        reply.readInt32(&res);
-        return res;
-    }
-
-    virtual oboe_result_t registerAudioThread(oboe_handle_t streamHandle, pid_t clientThreadId,
-                                              oboe_nanoseconds_t periodNanoseconds)
-    override {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        data.writeInt32(streamHandle);
-        data.writeInt32((int32_t) clientThreadId);
-        data.writeInt64(periodNanoseconds);
-        status_t err = remote()->transact(REGISTER_AUDIO_THREAD, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        oboe_result_t res;
-        reply.readInt32(&res);
-        return res;
-    }
-
-    virtual oboe_result_t unregisterAudioThread(oboe_handle_t streamHandle, pid_t clientThreadId)
-    override {
-        Parcel data, reply;
-        // send command
-        data.writeInterfaceToken(IOboeAudioService::getInterfaceDescriptor());
-        data.writeInt32(streamHandle);
-        data.writeInt32((int32_t) clientThreadId);
-        status_t err = remote()->transact(UNREGISTER_AUDIO_THREAD, data, &reply);
-        if (err != NO_ERROR) {
-            return OboeConvert_androidToOboeResult(err);
-        }
-        // parse reply
-        oboe_result_t res;
-        reply.readInt32(&res);
-        return res;
-    }
-
-};
-
-// Implement an interface to the service.
-// This is here so that you don't have to link with liboboe static library.
-IMPLEMENT_META_INTERFACE(OboeAudioService, "IOboeAudioService");
-
-// The order of parameters in the Parcels must match with code in BpOboeAudioService
-
-status_t BnOboeAudioService::onTransact(uint32_t code, const Parcel& data,
-                                        Parcel* reply, uint32_t flags) {
-    OboeStream stream;
-    oboe::OboeStreamRequest request;
-    oboe::OboeStreamConfiguration configuration;
-    pid_t pid;
-    oboe_nanoseconds_t nanoseconds;
-    oboe_result_t result;
-    ALOGV("BnOboeAudioService::onTransact(%i) %i", code, flags);
-    data.checkInterface(this);
-
-    switch(code) {
-        case OPEN_STREAM: {
-            request.readFromParcel(&data);
-            stream = openStream(request, configuration);
-            ALOGD("BnOboeAudioService::onTransact OPEN_STREAM server handle = 0x%08X", stream);
-            reply->writeInt32(stream);
-            configuration.writeToParcel(reply);
-            return NO_ERROR;
-        } break;
-
-        case CLOSE_STREAM: {
-            data.readInt32(&stream);
-            ALOGD("BnOboeAudioService::onTransact CLOSE_STREAM 0x%08X", stream);
-            result = closeStream(stream);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        } break;
-
-        case GET_STREAM_DESCRIPTION: {
-            data.readInt32(&stream);
-            ALOGD("BnOboeAudioService::onTransact GET_STREAM_DESCRIPTION 0x%08X", stream);
-            oboe::AudioEndpointParcelable parcelable;
-            result = getStreamDescription(stream, parcelable);
-            if (result != OBOE_OK) {
-                return OboeConvert_oboeToAndroidStatus(result);
-            }
-            parcelable.dump();
-            result = parcelable.validate();
-            if (result != OBOE_OK) {
-                return OboeConvert_oboeToAndroidStatus(result);
-            }
-            parcelable.writeToParcel(reply);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        } break;
-
-        case START_STREAM: {
-            data.readInt32(&stream);
-            result = startStream(stream);
-            ALOGD("BnOboeAudioService::onTransact START_STREAM 0x%08X, result = %d",
-                    stream, result);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        } break;
-
-        case PAUSE_STREAM: {
-            data.readInt32(&stream);
-            result = pauseStream(stream);
-            ALOGD("BnOboeAudioService::onTransact PAUSE_STREAM 0x%08X, result = %d",
-                    stream, result);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        } break;
-
-        case FLUSH_STREAM: {
-            data.readInt32(&stream);
-            result = flushStream(stream);
-            ALOGD("BnOboeAudioService::onTransact FLUSH_STREAM 0x%08X, result = %d",
-                    stream, result);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        } break;
-
-        case REGISTER_AUDIO_THREAD: {
-            data.readInt32(&stream);
-            data.readInt32(&pid);
-            data.readInt64(&nanoseconds);
-            result = registerAudioThread(stream, pid, nanoseconds);
-            ALOGD("BnOboeAudioService::onTransact REGISTER_AUDIO_THREAD 0x%08X, result = %d",
-                    stream, result);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        } break;
-
-        case UNREGISTER_AUDIO_THREAD: {
-            data.readInt32(&stream);
-            data.readInt32(&pid);
-            result = unregisterAudioThread(stream, pid);
-            ALOGD("BnOboeAudioService::onTransact UNREGISTER_AUDIO_THREAD 0x%08X, result = %d",
-                    stream, result);
-            reply->writeInt32(result);
-            return NO_ERROR;
-        } break;
-
-        default:
-            // ALOGW("BnOboeAudioService::onTransact not handled %u", code);
-            return BBinder::onTransact(code, data, reply, flags);
-    }
-}
-
-} /* namespace android */
diff --git a/media/liboboe/src/binding/IOboeAudioService.h b/media/liboboe/src/binding/IOboeAudioService.h
deleted file mode 100644
index e2a9c15..0000000
--- a/media/liboboe/src/binding/IOboeAudioService.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef BINDING_IOBOEAUDIOSERVICE_H
-#define BINDING_IOBOEAUDIOSERVICE_H
-
-#include <stdint.h>
-#include <utils/RefBase.h>
-#include <binder/TextOutput.h>
-#include <binder/IInterface.h>
-
-#include <oboe/OboeAudio.h>
-
-#include "binding/OboeServiceDefinitions.h"
-#include "binding/AudioEndpointParcelable.h"
-#include "binding/OboeStreamRequest.h"
-#include "binding/OboeStreamConfiguration.h"
-
-
-namespace android {
-
-// Interface (our AIDL) - Shared by server and client
-class IOboeAudioService : public IInterface {
-public:
-
-    DECLARE_META_INTERFACE(OboeAudioService);
-
-    virtual oboe_handle_t openStream(oboe::OboeStreamRequest &request,
-                                     oboe::OboeStreamConfiguration &configuration) = 0;
-
-    virtual oboe_result_t closeStream(oboe_handle_t streamHandle) = 0;
-
-    /* Get an immutable description of the in-memory queues
-    * used to communicate with the underlying HAL or Service.
-    */
-    virtual oboe_result_t getStreamDescription(oboe_handle_t streamHandle,
-                                               oboe::AudioEndpointParcelable &parcelable) = 0;
-
-    /**
-     * Start the flow of data.
-     */
-    virtual oboe_result_t startStream(oboe_handle_t streamHandle) = 0;
-
-    /**
-     * Stop the flow of data such that start() can resume without loss of data.
-     */
-    virtual oboe_result_t pauseStream(oboe_handle_t streamHandle) = 0;
-
-    /**
-     *  Discard any data held by the underlying HAL or Service.
-     */
-    virtual oboe_result_t flushStream(oboe_handle_t streamHandle) = 0;
-
-    /**
-     * Manage the specified thread as a low latency audio thread.
-     */
-    virtual oboe_result_t registerAudioThread(oboe_handle_t streamHandle, pid_t clientThreadId,
-                                              oboe_nanoseconds_t periodNanoseconds) = 0;
-
-    virtual oboe_result_t unregisterAudioThread(oboe_handle_t streamHandle,
-                                                pid_t clientThreadId) = 0;
-};
-
-class BnOboeAudioService : public BnInterface<IOboeAudioService> {
-public:
-    virtual status_t onTransact(uint32_t code, const Parcel& data,
-                                Parcel* reply, uint32_t flags = 0);
-
-};
-
-} /* namespace android */
-
-#endif //BINDING_IOBOEAUDIOSERVICE_H
diff --git a/media/liboboe/src/binding/OboeServiceMessage.h b/media/liboboe/src/binding/OboeServiceMessage.h
deleted file mode 100644
index aa13571..0000000
--- a/media/liboboe/src/binding/OboeServiceMessage.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OBOE_OBOE_SERVICE_MESSAGE_H
-#define OBOE_OBOE_SERVICE_MESSAGE_H
-
-#include <stdint.h>
-
-#include <oboe/OboeDefinitions.h>
-
-namespace oboe {
-
-// TODO move this an "include" folder for the service.
-
-struct OboeMessageTimestamp {
-    oboe_position_frames_t position;
-    int64_t                deviceOffset; // add to client position to get device position
-    oboe_nanoseconds_t     timestamp;
-};
-
-typedef enum oboe_service_event_e : uint32_t {
-    OBOE_SERVICE_EVENT_STARTED,
-    OBOE_SERVICE_EVENT_PAUSED,
-    OBOE_SERVICE_EVENT_FLUSHED,
-    OBOE_SERVICE_EVENT_CLOSED,
-    OBOE_SERVICE_EVENT_DISCONNECTED
-} oboe_service_event_t;
-
-struct OboeMessageEvent {
-    oboe_service_event_t event;
-    int32_t data1;
-    int64_t data2;
-};
-
-typedef struct OboeServiceMessage_s {
-    enum class code : uint32_t {
-        NOTHING,
-        TIMESTAMP,
-        EVENT,
-    };
-
-    code what;
-    union {
-        OboeMessageTimestamp timestamp;
-        OboeMessageEvent event;
-    };
-} OboeServiceMessage;
-
-
-} /* namespace oboe */
-
-#endif //OBOE_OBOE_SERVICE_MESSAGE_H
diff --git a/media/liboboe/src/binding/OboeStreamConfiguration.cpp b/media/liboboe/src/binding/OboeStreamConfiguration.cpp
deleted file mode 100644
index 124e964..0000000
--- a/media/liboboe/src/binding/OboeStreamConfiguration.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdint.h>
-
-#include <sys/mman.h>
-#include <binder/Parcel.h>
-#include <binder/Parcelable.h>
-
-#include <oboe/OboeDefinitions.h>
-
-#include "binding/OboeStreamConfiguration.h"
-
-using android::NO_ERROR;
-using android::status_t;
-using android::Parcel;
-using android::Parcelable;
-
-using namespace oboe;
-
-OboeStreamConfiguration::OboeStreamConfiguration() {}
-OboeStreamConfiguration::~OboeStreamConfiguration() {}
-
-status_t OboeStreamConfiguration::writeToParcel(Parcel* parcel) const {
-    parcel->writeInt32(mDeviceId);
-    parcel->writeInt32(mSampleRate);
-    parcel->writeInt32(mSamplesPerFrame);
-    parcel->writeInt32((int32_t) mAudioFormat);
-    return NO_ERROR; // TODO check for errors above
-}
-
-status_t OboeStreamConfiguration::readFromParcel(const Parcel* parcel) {
-    int32_t temp;
-    parcel->readInt32(&mDeviceId);
-    parcel->readInt32(&mSampleRate);
-    parcel->readInt32(&mSamplesPerFrame);
-    parcel->readInt32(&temp);
-    mAudioFormat = (oboe_audio_format_t) temp;
-    return NO_ERROR; // TODO check for errors above
-}
-
-oboe_result_t OboeStreamConfiguration::validate() {
-    // Validate results of the open.
-    if (mSampleRate < 0 || mSampleRate >= 8 * 48000) { // TODO review limits
-        ALOGE("OboeStreamConfiguration.validate(): invalid sampleRate = %d", mSampleRate);
-        return OBOE_ERROR_INTERNAL;
-    }
-
-    if (mSamplesPerFrame < 1 || mSamplesPerFrame >= 32) { // TODO review limits
-        ALOGE("OboeStreamConfiguration.validate() invalid samplesPerFrame = %d", mSamplesPerFrame);
-        return OBOE_ERROR_INTERNAL;
-    }
-
-    switch (mAudioFormat) {
-    case OBOE_AUDIO_FORMAT_PCM_I16:
-    case OBOE_AUDIO_FORMAT_PCM_FLOAT:
-    case OBOE_AUDIO_FORMAT_PCM_I8_24:
-    case OBOE_AUDIO_FORMAT_PCM_I32:
-        break;
-    default:
-        ALOGE("OboeStreamConfiguration.validate() invalid audioFormat = %d", mAudioFormat);
-        return OBOE_ERROR_INTERNAL;
-    }
-    return OBOE_OK;
-}
-
-void OboeStreamConfiguration::dump() {
-    ALOGD("OboeStreamConfiguration mSampleRate = %d -----", mSampleRate);
-    ALOGD("OboeStreamConfiguration mSamplesPerFrame = %d", mSamplesPerFrame);
-    ALOGD("OboeStreamConfiguration mAudioFormat = %d", (int)mAudioFormat);
-}
diff --git a/media/liboboe/src/binding/OboeStreamConfiguration.h b/media/liboboe/src/binding/OboeStreamConfiguration.h
deleted file mode 100644
index 6bc1924..0000000
--- a/media/liboboe/src/binding/OboeStreamConfiguration.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef BINDING_OBOE_STREAM_CONFIGURATION_H
-#define BINDING_OBOE_STREAM_CONFIGURATION_H
-
-#include <stdint.h>
-
-#include <binder/Parcel.h>
-#include <binder/Parcelable.h>
-#include <oboe/OboeDefinitions.h>
-
-using android::status_t;
-using android::Parcel;
-using android::Parcelable;
-
-namespace oboe {
-
-class OboeStreamConfiguration : public Parcelable {
-public:
-    OboeStreamConfiguration();
-    virtual ~OboeStreamConfiguration();
-
-    oboe_device_id_t getDeviceId() const {
-        return mDeviceId;
-    }
-
-    void setDeviceId(oboe_device_id_t deviceId) {
-        mDeviceId = deviceId;
-    }
-
-    oboe_sample_rate_t getSampleRate() const {
-        return mSampleRate;
-    }
-
-    void setSampleRate(oboe_sample_rate_t sampleRate) {
-        mSampleRate = sampleRate;
-    }
-
-    int32_t getSamplesPerFrame() const {
-        return mSamplesPerFrame;
-    }
-
-    void setSamplesPerFrame(int32_t samplesPerFrame) {
-        mSamplesPerFrame = samplesPerFrame;
-    }
-
-    oboe_audio_format_t getAudioFormat() const {
-        return mAudioFormat;
-    }
-
-    void setAudioFormat(oboe_audio_format_t audioFormat) {
-        mAudioFormat = audioFormat;
-    }
-
-    virtual status_t writeToParcel(Parcel* parcel) const override;
-
-    virtual status_t readFromParcel(const Parcel* parcel) override;
-
-    oboe_result_t validate();
-
-    void dump();
-
-protected:
-    oboe_device_id_t    mDeviceId        = OBOE_DEVICE_UNSPECIFIED;
-    oboe_sample_rate_t  mSampleRate      = OBOE_UNSPECIFIED;
-    int32_t             mSamplesPerFrame = OBOE_UNSPECIFIED;
-    oboe_audio_format_t mAudioFormat     = OBOE_AUDIO_FORMAT_UNSPECIFIED;
-};
-
-} /* namespace oboe */
-
-#endif //BINDING_OBOE_STREAM_CONFIGURATION_H
diff --git a/media/liboboe/src/binding/RingBufferParcelable.cpp b/media/liboboe/src/binding/RingBufferParcelable.cpp
index f097655..3a92929 100644
--- a/media/liboboe/src/binding/RingBufferParcelable.cpp
+++ b/media/liboboe/src/binding/RingBufferParcelable.cpp
@@ -18,11 +18,11 @@
 
 #include <binder/Parcelable.h>
 
-#include "binding/OboeServiceDefinitions.h"
+#include "binding/AAudioServiceDefinitions.h"
 #include "binding/SharedRegionParcelable.h"
 #include "binding/RingBufferParcelable.h"
 
-using namespace oboe;
+using namespace aaudio;
 
 RingBufferParcelable::RingBufferParcelable() {}
 RingBufferParcelable::~RingBufferParcelable() {}
@@ -100,23 +100,23 @@
     return NO_ERROR; // TODO check for errors above
 }
 
-oboe_result_t RingBufferParcelable::resolve(SharedMemoryParcelable *memoryParcels, RingBufferDescriptor *descriptor) {
-    oboe_result_t result;
+aaudio_result_t RingBufferParcelable::resolve(SharedMemoryParcelable *memoryParcels, RingBufferDescriptor *descriptor) {
+    aaudio_result_t result;
 
     result = mReadCounterParcelable.resolve(memoryParcels,
                                             (void **) &descriptor->readCounterAddress);
-    if (result != OBOE_OK) {
+    if (result != AAUDIO_OK) {
         return result;
     }
 
     result = mWriteCounterParcelable.resolve(memoryParcels,
                                              (void **) &descriptor->writeCounterAddress);
-    if (result != OBOE_OK) {
+    if (result != AAUDIO_OK) {
         return result;
     }
 
     result = mDataParcelable.resolve(memoryParcels, (void **) &descriptor->dataAddress);
-    if (result != OBOE_OK) {
+    if (result != AAUDIO_OK) {
         return result;
     }
 
@@ -124,36 +124,36 @@
     descriptor->framesPerBurst = mFramesPerBurst;
     descriptor->capacityInFrames = mCapacityInFrames;
     descriptor->flags = mFlags;
-    return OBOE_OK;
+    return AAUDIO_OK;
 }
 
-oboe_result_t RingBufferParcelable::validate() {
-    oboe_result_t result;
+aaudio_result_t RingBufferParcelable::validate() {
+    aaudio_result_t result;
     if (mCapacityInFrames < 0 || mCapacityInFrames >= 32 * 1024) {
         ALOGE("RingBufferParcelable invalid mCapacityInFrames = %d", mCapacityInFrames);
-        return OBOE_ERROR_INTERNAL;
+        return AAUDIO_ERROR_INTERNAL;
     }
     if (mBytesPerFrame < 0 || mBytesPerFrame >= 256) {
         ALOGE("RingBufferParcelable invalid mBytesPerFrame = %d", mBytesPerFrame);
-        return OBOE_ERROR_INTERNAL;
+        return AAUDIO_ERROR_INTERNAL;
     }
     if (mFramesPerBurst < 0 || mFramesPerBurst >= 1024) {
         ALOGE("RingBufferParcelable invalid mFramesPerBurst = %d", mFramesPerBurst);
-        return OBOE_ERROR_INTERNAL;
+        return AAUDIO_ERROR_INTERNAL;
     }
-    if ((result = mReadCounterParcelable.validate()) != OBOE_OK) {
+    if ((result = mReadCounterParcelable.validate()) != AAUDIO_OK) {
         ALOGE("RingBufferParcelable invalid mReadCounterParcelable = %d", result);
         return result;
     }
-    if ((result = mWriteCounterParcelable.validate()) != OBOE_OK) {
+    if ((result = mWriteCounterParcelable.validate()) != AAUDIO_OK) {
         ALOGE("RingBufferParcelable invalid mWriteCounterParcelable = %d", result);
         return result;
     }
-    if ((result = mDataParcelable.validate()) != OBOE_OK) {
+    if ((result = mDataParcelable.validate()) != AAUDIO_OK) {
         ALOGE("RingBufferParcelable invalid mDataParcelable = %d", result);
         return result;
     }
-    return OBOE_OK;
+    return AAUDIO_OK;
 }
 
 
diff --git a/media/liboboe/src/binding/RingBufferParcelable.h b/media/liboboe/src/binding/RingBufferParcelable.h
index 9bb695a..3f82c79 100644
--- a/media/liboboe/src/binding/RingBufferParcelable.h
+++ b/media/liboboe/src/binding/RingBufferParcelable.h
@@ -21,10 +21,10 @@
 
 #include <binder/Parcelable.h>
 
-#include "binding/OboeServiceDefinitions.h"
+#include "binding/AAudioServiceDefinitions.h"
 #include "binding/SharedRegionParcelable.h"
 
-namespace oboe {
+namespace aaudio {
 
 class RingBufferParcelable : public Parcelable {
 public:
@@ -62,9 +62,9 @@
 
     virtual status_t readFromParcel(const Parcel* parcel) override;
 
-    oboe_result_t resolve(SharedMemoryParcelable *memoryParcels, RingBufferDescriptor *descriptor);
+    aaudio_result_t resolve(SharedMemoryParcelable *memoryParcels, RingBufferDescriptor *descriptor);
 
-    oboe_result_t validate();
+    aaudio_result_t validate();
 
     void dump();
 
@@ -78,6 +78,6 @@
     RingbufferFlags         mFlags = RingbufferFlags::NONE;
 };
 
-} /* namespace oboe */
+} /* namespace aaudio */
 
 #endif //BINDING_RINGBUFFER_PARCELABLE_H
diff --git a/media/liboboe/src/binding/SharedMemoryParcelable.cpp b/media/liboboe/src/binding/SharedMemoryParcelable.cpp
index 5b739c0..277a992 100644
--- a/media/liboboe/src/binding/SharedMemoryParcelable.cpp
+++ b/media/liboboe/src/binding/SharedMemoryParcelable.cpp
@@ -17,7 +17,7 @@
 #include <stdint.h>
 
 #include <sys/mman.h>
-#include <oboe/OboeDefinitions.h>
+#include <aaudio/AAudioDefinitions.h>
 
 #include <binder/Parcelable.h>
 
@@ -28,7 +28,7 @@
 using android::Parcel;
 using android::Parcelable;
 
-using namespace oboe;
+using namespace aaudio;
 
 SharedMemoryParcelable::SharedMemoryParcelable() {}
 SharedMemoryParcelable::~SharedMemoryParcelable() {};
@@ -56,48 +56,48 @@
 
 // TODO Add code to unmmap()
 
-oboe_result_t SharedMemoryParcelable::resolve(int32_t offsetInBytes, int32_t sizeInBytes,
+aaudio_result_t SharedMemoryParcelable::resolve(int32_t offsetInBytes, int32_t sizeInBytes,
                                               void **regionAddressPtr) {
     if (offsetInBytes < 0) {
         ALOGE("SharedMemoryParcelable illegal offsetInBytes = %d", offsetInBytes);
-        return OBOE_ERROR_OUT_OF_RANGE;
+        return AAUDIO_ERROR_OUT_OF_RANGE;
     } else if ((offsetInBytes + sizeInBytes) > mSizeInBytes) {
         ALOGE("SharedMemoryParcelable out of range, offsetInBytes = %d, "
               "sizeInBytes = %d, mSizeInBytes = %d",
               offsetInBytes, sizeInBytes, mSizeInBytes);
-        return OBOE_ERROR_OUT_OF_RANGE;
+        return AAUDIO_ERROR_OUT_OF_RANGE;
     }
     if (mResolvedAddress == nullptr) {
         mResolvedAddress = (uint8_t *) mmap(0, mSizeInBytes, PROT_READ|PROT_WRITE,
                                           MAP_SHARED, mFd, 0);
         if (mResolvedAddress == nullptr) {
             ALOGE("SharedMemoryParcelable mmap failed for fd = %d", mFd);
-            return OBOE_ERROR_INTERNAL;
+            return AAUDIO_ERROR_INTERNAL;
         }
     }
     *regionAddressPtr = mResolvedAddress + offsetInBytes;
     ALOGD("SharedMemoryParcelable mResolvedAddress = %p", mResolvedAddress);
     ALOGD("SharedMemoryParcelable offset by %d, *regionAddressPtr = %p",
           offsetInBytes, *regionAddressPtr);
-    return OBOE_OK;
+    return AAUDIO_OK;
 }
 
 int32_t SharedMemoryParcelable::getSizeInBytes() {
     return mSizeInBytes;
 }
 
-oboe_result_t SharedMemoryParcelable::validate() {
+aaudio_result_t SharedMemoryParcelable::validate() {
     if (mSizeInBytes < 0 || mSizeInBytes >= MAX_MMAP_SIZE) {
         ALOGE("SharedMemoryParcelable invalid mSizeInBytes = %d", mSizeInBytes);
-        return OBOE_ERROR_INTERNAL;
+        return AAUDIO_ERROR_INTERNAL;
     }
     if (mSizeInBytes > 0) {
         if (mFd == -1) {
             ALOGE("SharedMemoryParcelable uninitialized mFd = %d", mFd);
-            return OBOE_ERROR_INTERNAL;
+            return AAUDIO_ERROR_INTERNAL;
         }
     }
-    return OBOE_OK;
+    return AAUDIO_OK;
 }
 
 void SharedMemoryParcelable::dump() {
diff --git a/media/liboboe/src/binding/SharedMemoryParcelable.h b/media/liboboe/src/binding/SharedMemoryParcelable.h
index 9585779..5768ea9 100644
--- a/media/liboboe/src/binding/SharedMemoryParcelable.h
+++ b/media/liboboe/src/binding/SharedMemoryParcelable.h
@@ -27,7 +27,7 @@
 using android::Parcel;
 using android::Parcelable;
 
-namespace oboe {
+namespace aaudio {
 
 // Arbitrary limits for sanity checks. TODO remove after debugging.
 #define MAX_SHARED_MEMORIES (32)
@@ -49,11 +49,11 @@
 
     virtual status_t readFromParcel(const Parcel* parcel) override;
 
-    oboe_result_t resolve(int32_t offsetInBytes, int32_t sizeInBytes, void **regionAddressPtr);
+    aaudio_result_t resolve(int32_t offsetInBytes, int32_t sizeInBytes, void **regionAddressPtr);
 
     int32_t getSizeInBytes();
 
-    oboe_result_t validate();
+    aaudio_result_t validate();
 
     void dump();
 
@@ -63,6 +63,6 @@
     uint8_t *mResolvedAddress = nullptr;
 };
 
-} /* namespace oboe */
+} /* namespace aaudio */
 
 #endif //BINDING_SHAREDMEMORYPARCELABLE_H
diff --git a/media/liboboe/src/binding/SharedRegionParcelable.cpp b/media/liboboe/src/binding/SharedRegionParcelable.cpp
index 86ce8f3..a3e0111 100644
--- a/media/liboboe/src/binding/SharedRegionParcelable.cpp
+++ b/media/liboboe/src/binding/SharedRegionParcelable.cpp
@@ -19,7 +19,7 @@
 #include <sys/mman.h>
 #include <binder/Parcelable.h>
 
-#include <oboe/OboeDefinitions.h>
+#include <aaudio/AAudioDefinitions.h>
 
 #include "binding/SharedMemoryParcelable.h"
 #include "binding/SharedRegionParcelable.h"
@@ -29,7 +29,7 @@
 using android::Parcel;
 using android::Parcelable;
 
-using namespace oboe;
+using namespace aaudio;
 
 SharedRegionParcelable::SharedRegionParcelable() {}
 SharedRegionParcelable::~SharedRegionParcelable() {}
@@ -60,36 +60,36 @@
     return NO_ERROR; // TODO check for errors above
 }
 
-oboe_result_t SharedRegionParcelable::resolve(SharedMemoryParcelable *memoryParcels,
+aaudio_result_t SharedRegionParcelable::resolve(SharedMemoryParcelable *memoryParcels,
                                               void **regionAddressPtr) {
     if (mSizeInBytes == 0) {
         *regionAddressPtr = nullptr;
-        return OBOE_OK;
+        return AAUDIO_OK;
     }
     if (mSharedMemoryIndex < 0) {
         ALOGE("SharedRegionParcelable invalid mSharedMemoryIndex = %d", mSharedMemoryIndex);
-        return OBOE_ERROR_INTERNAL;
+        return AAUDIO_ERROR_INTERNAL;
     }
     SharedMemoryParcelable *memoryParcel = &memoryParcels[mSharedMemoryIndex];
     return memoryParcel->resolve(mOffsetInBytes, mSizeInBytes, regionAddressPtr);
 }
 
-oboe_result_t SharedRegionParcelable::validate() {
+aaudio_result_t SharedRegionParcelable::validate() {
     if (mSizeInBytes < 0 || mSizeInBytes >= MAX_MMAP_SIZE) {
         ALOGE("SharedRegionParcelable invalid mSizeInBytes = %d", mSizeInBytes);
-        return OBOE_ERROR_INTERNAL;
+        return AAUDIO_ERROR_INTERNAL;
     }
     if (mSizeInBytes > 0) {
         if (mOffsetInBytes < 0 || mOffsetInBytes >= MAX_MMAP_OFFSET) {
             ALOGE("SharedRegionParcelable invalid mOffsetInBytes = %d", mOffsetInBytes);
-            return OBOE_ERROR_INTERNAL;
+            return AAUDIO_ERROR_INTERNAL;
         }
         if (mSharedMemoryIndex < 0 || mSharedMemoryIndex >= MAX_SHARED_MEMORIES) {
             ALOGE("SharedRegionParcelable invalid mSharedMemoryIndex = %d", mSharedMemoryIndex);
-            return OBOE_ERROR_INTERNAL;
+            return AAUDIO_ERROR_INTERNAL;
         }
     }
-    return OBOE_OK;
+    return AAUDIO_OK;
 }
 
 void SharedRegionParcelable::dump() {
diff --git a/media/liboboe/src/binding/SharedRegionParcelable.h b/media/liboboe/src/binding/SharedRegionParcelable.h
index bccdaa8..d6c2281 100644
--- a/media/liboboe/src/binding/SharedRegionParcelable.h
+++ b/media/liboboe/src/binding/SharedRegionParcelable.h
@@ -22,7 +22,7 @@
 #include <sys/mman.h>
 #include <binder/Parcelable.h>
 
-#include <oboe/OboeDefinitions.h>
+#include <aaudio/AAudioDefinitions.h>
 
 #include "binding/SharedMemoryParcelable.h"
 
@@ -30,7 +30,7 @@
 using android::Parcel;
 using android::Parcelable;
 
-namespace oboe {
+namespace aaudio {
 
 class SharedRegionParcelable : public Parcelable {
 public:
@@ -43,9 +43,9 @@
 
     virtual status_t readFromParcel(const Parcel* parcel) override;
 
-    oboe_result_t resolve(SharedMemoryParcelable *memoryParcels, void **regionAddressPtr);
+    aaudio_result_t resolve(SharedMemoryParcelable *memoryParcels, void **regionAddressPtr);
 
-    oboe_result_t validate();
+    aaudio_result_t validate();
 
     void dump();
 
@@ -55,6 +55,6 @@
     int32_t mSizeInBytes       = 0;
 };
 
-} /* namespace oboe */
+} /* namespace aaudio */
 
 #endif //BINDING_SHAREDREGIONPARCELABLE_H