Move DVR platform C API into libdvr
Introduce a new static library build with Android.mk. The reasoning
behind this is:
1/ This library is going to consolidate all C headers and implementation
of the DVR platform library.
2/ No other internal system components need to depend on this library.
3/ This library is build with Android.mk so that it has depend on other
system components (such as libandroid_runtime) without worrying about
that Android.bp-based libs cannot depent and Androib.mk-based libraries.
4/ This library defines dvr_api.h header as the official definition of
DVR platform library headers. The header is moved from
'vendor/unbundled_google/packages/PrebuiltGoogleVr', which is not an
ideal place to hold the platform library anyway.
5/ If we ever decide to move these C wrappers out of frameworks/native,
this makes it easier to do so by bundling things now.
TODO: C APIs from libvrsensor and libvirtualtouchpadclient are not moved
into this bundle as some functions are still used by internal system
components. Ideally, these will be moved either to Google3 or vendor projects.
Test: Built and flash
Bug: 36563654
Change-Id: Ie5ce89faa70f86ac934a77d8f7d4fca7e94112ee
diff --git a/libs/vr/libdvr/Android.mk b/libs/vr/libdvr/Android.mk
new file mode 100644
index 0000000..5a21418
--- /dev/null
+++ b/libs/vr/libdvr/Android.mk
@@ -0,0 +1,51 @@
+# 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.
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libdvr
+LOCAL_MODULE_OWNER := google
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+
+LOCAL_CFLAGS += \
+ -fvisibility=hidden \
+ -D DVR_EXPORT='__attribute__ ((visibility ("default")))'
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/include \
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH)/include \
+
+LOCAL_SRC_FILES := \
+ display_manager_client.cpp \
+ dvr_api.cpp \
+ dvr_buffer.cpp \
+ dvr_surface.cpp \
+ vsync_client_api.cpp \
+
+LOCAL_STATIC_LIBRARIES := \
+ libbufferhub \
+ libbufferhubqueue \
+ libdisplay \
+ libvrsensor \
+ libvirtualtouchpadclient \
+
+LOCAL_SHARED_LIBRARIES := \
+ android.hardware.graphics.bufferqueue@1.0 \
+ android.hidl.token@1.0-utils \
+ libandroid_runtime \
+ libbase \
+
+include $(BUILD_STATIC_LIBRARY)