Reconciliation

Test: Local build
Change-Id: I3debfb4be795bf7995485f1530dbaa7a24e3cbc1
diff --git a/guest/hals/audio/Android.mk b/guest/hals/audio/Android.mk
index 75c78e5..81029cd 100644
--- a/guest/hals/audio/Android.mk
+++ b/guest/hals/audio/Android.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 The Android Open Source Project
+# 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.
@@ -40,8 +40,7 @@
     audio_hal.cpp \
     vsoc_audio.cpp \
     vsoc_audio_input_stream.cpp \
-    vsoc_audio_output_stream.cpp \
-    vsoc_audio_message.cpp
+    vsoc_audio_output_stream.cpp
 
 LOCAL_C_INCLUDES := \
     device/google/cuttlefish_common \
@@ -56,13 +55,9 @@
     $(VSOC_STLPORT_STATIC_LIBS)
 
 LOCAL_CFLAGS := \
-    -Wall -Werror -Wno-parentheses -Wno-missing-field-initializers \
-    -DLOG_TAG=\"VSoC-Audio\" \
+    -Wall -Werror \
     $(VSOC_VERSION_CFLAGS)
 
-# Work-around for the non-standard language feautures used in
-# system/media/audio/include/system/audio.h
-LOCAL_CLANG_CFLAGS := -Wno-gnu-designator
 
 LOCAL_MODULE := audio.primary.vsoc
 LOCAL_VENDOR_MODULE := true
diff --git a/guest/hals/audio/audio_hal.cpp b/guest/hals/audio/audio_hal.cpp
index ff19a32..74180b5 100644
--- a/guest/hals/audio/audio_hal.cpp
+++ b/guest/hals/audio/audio_hal.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
diff --git a/guest/hals/audio/audio_hal.h b/guest/hals/audio/audio_hal.h
index 36d47cb..b965641 100644
--- a/guest/hals/audio/audio_hal.h
+++ b/guest/hals/audio/audio_hal.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
@@ -28,5 +28,15 @@
 #include <cutils/log.h>
 
 #include <hardware/hardware.h>
+
+#include "guest/libs/platform_support/api_level_fixes.h"
+
+#pragma GCC diagnostic push
+#pragma  GCC diagnostic ignored "-Wparentheses"
+#if VSOC_PLATFORM_SDK_AFTER(K)
+#pragma  GCC diagnostic ignored "-Wgnu-designator"
+#endif
 #include <system/audio.h>
+#pragma GCC diagnostic pop
+
 #include <hardware/audio.h>
diff --git a/guest/hals/audio/policy/Android.mk b/guest/hals/audio/policy/Android.mk
index da72309..0b2ef8c 100644
--- a/guest/hals/audio/policy/Android.mk
+++ b/guest/hals/audio/policy/Android.mk
@@ -37,7 +37,7 @@
     frameworks/native/include/media/hardware \
     $(call include-path-for, audio)
 
-LOCAL_CFLAGS := -Wall -DLOG_TAG=\"VSoC-AudioPolicy\"
+LOCAL_CFLAGS := -Wall -Werror
 
 LOCAL_MODULE := audio_policy.vsoc
 LOCAL_VENDOR_MODULE := true
diff --git a/guest/hals/audio/policy/vsoc_audio_policy_hal.h b/guest/hals/audio/policy/vsoc_audio_policy_hal.h
index 365d1c4..7f97556 100644
--- a/guest/hals/audio/policy/vsoc_audio_policy_hal.h
+++ b/guest/hals/audio/policy/vsoc_audio_policy_hal.h
@@ -31,7 +31,9 @@
 #  define D(...) ((void)0)
 #endif
 
-namespace cvd {
+#define LOG_TAG "GceAudioPolicy"
+
+namespace avd {
 
 struct gce_audio_policy {
   audio_policy policy;
@@ -241,4 +243,3 @@
 };
 
 }
-
diff --git a/guest/hals/audio/simulated_buffer.h b/guest/hals/audio/simulated_buffer.h
index 5ea31c2..a61108d 100644
--- a/guest/hals/audio/simulated_buffer.h
+++ b/guest/hals/audio/simulated_buffer.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
@@ -312,4 +312,3 @@
   int64_t input_buffer_item_num_;
   int64_t lost_input_items_;
 };
-
diff --git a/guest/hals/audio/vsoc_audio.cpp b/guest/hals/audio/vsoc_audio.cpp
index 28292ff..38352ff 100644
--- a/guest/hals/audio/vsoc_audio.cpp
+++ b/guest/hals/audio/vsoc_audio.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
diff --git a/guest/hals/audio/vsoc_audio.h b/guest/hals/audio/vsoc_audio.h
index 73d88ba..80a73cf 100644
--- a/guest/hals/audio/vsoc_audio.h
+++ b/guest/hals/audio/vsoc_audio.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
@@ -305,4 +305,3 @@
 };
 
 }
-
diff --git a/guest/hals/audio/vsoc_audio_input_stream.cpp b/guest/hals/audio/vsoc_audio_input_stream.cpp
index 547689b..4c91237 100644
--- a/guest/hals/audio/vsoc_audio_input_stream.cpp
+++ b/guest/hals/audio/vsoc_audio_input_stream.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
@@ -13,6 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+#include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <cstdint>
diff --git a/guest/hals/audio/vsoc_audio_input_stream.h b/guest/hals/audio/vsoc_audio_input_stream.h
index 5e7cc63..f7d275c 100644
--- a/guest/hals/audio/vsoc_audio_input_stream.h
+++ b/guest/hals/audio/vsoc_audio_input_stream.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
diff --git a/guest/hals/audio/vsoc_audio_message.cpp b/guest/hals/audio/vsoc_audio_message.cpp
deleted file mode 100644
index 2cbfe4e..0000000
--- a/guest/hals/audio/vsoc_audio_message.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2017 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 "guest/hals/audio/vsoc_audio_message.h"
-
-const char* gce_audio_message::kAudioHALSocketName =
-    "/var/run/media/audio_hal_socket";
diff --git a/guest/hals/audio/vsoc_audio_message.h b/guest/hals/audio/vsoc_audio_message.h
index 4e02f91..5b36215 100644
--- a/guest/hals/audio/vsoc_audio_message.h
+++ b/guest/hals/audio/vsoc_audio_message.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
@@ -18,10 +18,21 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <time.h>
+
+#include "guest/libs/platform_support/api_level_fixes.h"
+
+#pragma GCC diagnostic push
+#pragma  GCC diagnostic ignored "-Wparentheses"
+#if VSOC_PLATFORM_SDK_AFTER(K)
+#pragma  GCC diagnostic ignored "-Wgnu-designator"
+#endif
 #include <system/audio.h>
+#pragma GCC diagnostic pop
+
+//TODO(b/71777986) Use a shared memory window instead
+#define AUDIO_HAL_SOCKET_NAME "/var/run/media/audio_hal_socket"
 
 struct gce_audio_message {
-  static const char* kAudioHALSocketName;
   static const size_t kMaxAudioFrameLen = 65536;
   enum message_t {
     UNKNOWN = 0,
diff --git a/guest/hals/audio/vsoc_audio_output_stream.cpp b/guest/hals/audio/vsoc_audio_output_stream.cpp
index cd86a5c..8490a08 100644
--- a/guest/hals/audio/vsoc_audio_output_stream.cpp
+++ b/guest/hals/audio/vsoc_audio_output_stream.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.
@@ -15,6 +15,7 @@
  */
 #include "guest/hals/audio/vsoc_audio_message.h"
 
+#include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory>
diff --git a/guest/hals/audio/vsoc_audio_output_stream.h b/guest/hals/audio/vsoc_audio_output_stream.h
index b5cc9f0..69b976a 100644
--- a/guest/hals/audio/vsoc_audio_output_stream.h
+++ b/guest/hals/audio/vsoc_audio_output_stream.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 The Android Open Source Project
+ * 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.