Force vrhwc/wm to report the native resolution
Due to some Yak-shaving, this also involved a partial conversion of our
libraries to soong.
Notes:
* I also changed the name of libsensor to libvrsensor to avoid a naming
clash with an existing library
* The remaining libraries will be soongified in a separate CL
Bug: 36139334
Test: Build and run vr apps.
Change-Id: Ib39687bd01e3d2e1c30adc54e18f362a85954ab9
diff --git a/cmds/vr/pose/Android.mk b/cmds/vr/pose/Android.mk
index de92b5b..8be3214 100644
--- a/cmds/vr/pose/Android.mk
+++ b/cmds/vr/pose/Android.mk
@@ -19,7 +19,7 @@
staticLibraries := \
libdvrcommon \
- libsensor \
+ libvrsensor \
libpdx_default_transport \
sharedLibraries := \
diff --git a/libs/vr/libbufferhub/Android.bp b/libs/vr/libbufferhub/Android.bp
new file mode 100644
index 0000000..452bad0
--- /dev/null
+++ b/libs/vr/libbufferhub/Android.bp
@@ -0,0 +1,58 @@
+// 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.
+
+sourceFiles = [
+ "buffer_hub_client.cpp",
+ "buffer_hub_rpc.cpp",
+ "ion_buffer.cpp",
+]
+
+localIncludeFiles = [
+ "include",
+]
+
+staticLibraries = [
+ "libdvrcommon",
+ "libpdx_default_transport",
+]
+
+sharedLibraries = [
+ "libbase",
+ "libcutils",
+ "libhardware",
+ "liblog",
+ "libui",
+ "libutils",
+]
+
+cc_library {
+ srcs: sourceFiles,
+ cflags: [
+ "-DLOG_TAG=\"libbufferhub\"",
+ "-DTRACE=0"
+ ],
+ export_include_dirs: localIncludeFiles,
+ static_libs: staticLibraries,
+ shared_libs: sharedLibraries,
+ name: "libbufferhub",
+}
+
+cc_test {
+ tags: ["optional"],
+ srcs: ["bufferhub_tests.cpp"],
+ static_libs: ["libbufferhub"] + staticLibraries,
+ shared_libs: sharedLibraries,
+ name: "bufferhub_tests",
+}
+
diff --git a/libs/vr/libbufferhub/Android.mk b/libs/vr/libbufferhub/Android.mk
deleted file mode 100644
index 0877b0b..0000000
--- a/libs/vr/libbufferhub/Android.mk
+++ /dev/null
@@ -1,56 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-sourceFiles := \
- buffer_hub_client.cpp \
- buffer_hub_rpc.cpp \
- ion_buffer.cpp
-
-includeFiles := \
- $(LOCAL_PATH)/include
-
-staticLibraries := \
- libdvrcommon \
- libpdx_default_transport \
-
-sharedLibraries := \
- libbase \
- libcutils \
- libhardware \
- liblog \
- libui \
- libutils
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_CFLAGS := -DLOG_TAG=\"libbufferhub\"
-LOCAL_CFLAGS += -DTRACE=0
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_MODULE := libbufferhub
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := bufferhub_tests.cpp
-LOCAL_STATIC_LIBRARIES := libbufferhub $(staticLibraries)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_MODULE := bufferhub_tests
-include $(BUILD_NATIVE_TEST)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/libs/vr/libbufferhubqueue/Android.bp b/libs/vr/libbufferhubqueue/Android.bp
new file mode 100644
index 0000000..10198fd
--- /dev/null
+++ b/libs/vr/libbufferhubqueue/Android.bp
@@ -0,0 +1,51 @@
+// 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.
+
+sourceFiles = [
+ "buffer_hub_queue_client.cpp",
+ "buffer_hub_queue_core.cpp",
+ "buffer_hub_queue_consumer.cpp",
+ "buffer_hub_queue_producer.cpp",
+]
+
+includeFiles = [
+ "include",
+]
+
+staticLibraries = [
+ "libbufferhub",
+ "libdvrcommon",
+ "libpdx_default_transport",
+]
+
+sharedLibraries = [
+ "libbase",
+ "libbinder",
+ "libcutils",
+ "libhardware",
+ "liblog",
+ "libui",
+ "libutils",
+ "libgui",
+]
+
+cc_library {
+ name: "libbufferhubqueue",
+ cflags = [ "-DLOGTAG=\"libbufferhubqueue\"" ],
+ srcs: sourceFiles,
+ export_include_dirs: includeFiles,
+ static_libs: staticLibraries,
+ shared_libs: sharedLibraries,
+}
+
diff --git a/libs/vr/libbufferhubqueue/Android.mk b/libs/vr/libbufferhubqueue/Android.mk
deleted file mode 100644
index d53f06a..0000000
--- a/libs/vr/libbufferhubqueue/Android.mk
+++ /dev/null
@@ -1,51 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-sourceFiles := \
- buffer_hub_queue_client.cpp \
- buffer_hub_queue_core.cpp \
- buffer_hub_queue_consumer.cpp \
- buffer_hub_queue_producer.cpp \
-
-includeFiles := \
- $(LOCAL_PATH)/include
-
-staticLibraries := \
- libbufferhub \
- libdvrcommon \
- libpdx_default_transport \
-
-sharedLibraries := \
- libbase \
- libbinder \
- libcutils \
- libhardware \
- liblog \
- libui \
- libutils \
- libgui \
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_CFLAGS := -DLOG_TAG=\"libbufferhubqueue\"
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_MODULE := libbufferhubqueue
-include $(BUILD_STATIC_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/libs/vr/libbufferhubqueue/tests/Android.bp b/libs/vr/libbufferhubqueue/tests/Android.bp
new file mode 100644
index 0000000..b8a0da3
--- /dev/null
+++ b/libs/vr/libbufferhubqueue/tests/Android.bp
@@ -0,0 +1,46 @@
+
+
+shared_libraries = [
+ "libbase",
+ "libbinder",
+ "libcutils",
+ "libgui",
+ "liblog",
+ "libhardware",
+ "libui",
+ "libutils",
+]
+
+static_libraries = [
+ "libbufferhubqueue",
+ "libbufferhub",
+ "libchrome",
+ "libdvrcommon",
+ "libpdx_default_transport",
+]
+
+cc_test {
+ srcs: ["buffer_hub_queue-test.cpp"],
+ static_libs: static_libraries,
+ shared_libs: shared_libraries,
+ cflags: [
+ "-DTRACE=0",
+ "-O0",
+ "-g",
+ ],
+ name: "buffer_hub_queue-test",
+ tags: ["optional"],
+}
+
+cc_test {
+ srcs: ["buffer_hub_queue_producer-test.cpp"],
+ static_libs: static_libraries,
+ shared_libs: shared_libraries,
+ cflags: [
+ "-DTRACE=0",
+ "-O0",
+ "-g",
+ ],
+ name: "buffer_hub_queue_producer-test",
+ tags: ["optional"],
+}
diff --git a/libs/vr/libbufferhubqueue/tests/Android.mk b/libs/vr/libbufferhubqueue/tests/Android.mk
deleted file mode 100644
index 59061e6..0000000
--- a/libs/vr/libbufferhubqueue/tests/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-shared_libraries := \
- libbase \
- libbinder \
- libcutils \
- libgui \
- liblog \
- libhardware \
- libui \
- libutils \
-
-static_libraries := \
- libbufferhubqueue \
- libbufferhub \
- libchrome \
- libdvrcommon \
- libpdx_default_transport \
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := buffer_hub_queue-test.cpp
-LOCAL_STATIC_LIBRARIES := $(static_libraries)
-LOCAL_SHARED_LIBRARIES := $(shared_libraries)
-LOCAL_EXPORT_C_INCLUDE_DIRS := ${LOCAL_C_INCLUDES}
-LOCAL_CFLAGS := -DTRACE=0 -O0 -g
-LOCAL_MODULE := buffer_hub_queue-test
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_NATIVE_TEST)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := buffer_hub_queue_producer-test.cpp
-LOCAL_STATIC_LIBRARIES := $(static_libraries)
-LOCAL_SHARED_LIBRARIES := $(shared_libraries)
-LOCAL_EXPORT_C_INCLUDE_DIRS := ${LOCAL_C_INCLUDES}
-LOCAL_CFLAGS := -DTRACE=0 -O0 -g
-LOCAL_MODULE := buffer_hub_queue_producer-test
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_NATIVE_TEST)
diff --git a/libs/vr/libdisplay/Android.bp b/libs/vr/libdisplay/Android.bp
new file mode 100644
index 0000000..f3c71b5
--- /dev/null
+++ b/libs/vr/libdisplay/Android.bp
@@ -0,0 +1,104 @@
+// Copyright (C) 2015 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.
+
+sourceFiles = [
+ "native_buffer_queue.cpp",
+ "display_client.cpp",
+ "display_manager_client.cpp",
+ "display_manager_client_impl.cpp",
+ "display_rpc.cpp",
+ "dummy_native_window.cpp",
+ "gl_fenced_flush.cpp",
+ "graphics.cpp",
+ "late_latch.cpp",
+ "video_mesh_surface_client.cpp",
+ "vsync_client.cpp",
+ "vsync_client_api.cpp",
+ "screenshot_client.cpp",
+ "frame_history.cpp",
+]
+
+localIncludeFiles = [
+ "include",
+]
+
+sharedLibraries = [
+ "libbase",
+ "libcutils",
+ "liblog",
+ "libutils",
+ "libEGL",
+ "libGLESv2",
+ "libvulkan",
+ "libui",
+ "libgui",
+ "libhardware",
+ "libsync",
+ "libnativewindow",
+]
+
+staticLibraries = [
+ "libbufferhub",
+ "libbufferhubqueue",
+ "libdvrcommon",
+ "libdvrgraphics",
+ "libvrsensor",
+ "libpdx_default_transport",
+]
+
+headerLibraries = [
+ "vulkan_headers",
+]
+
+cc_library {
+ tags: ["tests"],
+ srcs: sourceFiles,
+ cflags: ["-DLOG_TAG=\"libdisplay\"",
+ "-DTRACE=0",
+ "-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
+ "-DGL_GLEXT_PROTOTYPES",
+ "-DEGL_EGLEXT_PROTOTYPES",
+ ], // + [ "-UNDEBUG", "-DDEBUG", "-O0", "-g" ],
+ export_include_dirs: localIncludeFiles,
+ shared_libs: sharedLibraries,
+ static_libs: staticLibraries,
+ header_libs: headerLibraries,
+ export_header_lib_headers: headerLibraries,
+
+ name: "libdisplay",
+}
+
+graphicsAppTestFiles = ["tests/graphics_app_tests.cpp"]
+
+cc_test {
+ name: "graphics_app_tests",
+ tags: ["optional"],
+
+ srcs: graphicsAppTestFiles,
+
+ shared_libs: sharedLibraries,
+
+ static_libs: ["libdisplay"] + staticLibraries,
+}
+
+dummyNativeWindowTestFiles = ["tests/dummy_native_window_tests.cpp"]
+
+cc_test {
+ name: "dummy_native_window_tests",
+ tags: [ "optional" ],
+ srcs: dummyNativeWindowTestFiles,
+ shared_libs: sharedLibraries,
+ static_libs: [ "libdisplay" ] + staticLibraries,
+}
+
diff --git a/libs/vr/libdisplay/Android.mk b/libs/vr/libdisplay/Android.mk
deleted file mode 100644
index 60f73c6..0000000
--- a/libs/vr/libdisplay/Android.mk
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright (C) 2015 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)
-
-sourceFiles := \
- native_buffer_queue.cpp \
- display_client.cpp \
- display_manager_client.cpp \
- display_manager_client_impl.cpp \
- display_rpc.cpp \
- dummy_native_window.cpp \
- gl_fenced_flush.cpp \
- graphics.cpp \
- late_latch.cpp \
- video_mesh_surface_client.cpp \
- vsync_client.cpp \
- vsync_client_api.cpp \
- screenshot_client.cpp \
- frame_history.cpp
-
-includeFiles := \
- $(LOCAL_PATH)/include \
- frameworks/native/vulkan/include
-
-sharedLibraries := \
- libbase \
- libcutils \
- liblog \
- libutils \
- libEGL \
- libGLESv2 \
- libvulkan \
- libui \
- libgui \
- libhardware \
- libsync \
- libnativewindow \
-
-staticLibraries := \
- libbufferhub \
- libbufferhubqueue \
- libdvrcommon \
- libdvrgraphics \
- libsensor \
- libpdx_default_transport \
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-#LOCAL_CPPFLAGS := -UNDEBUG -DDEBUG -O0 -g
-LOCAL_CFLAGS += -DLOG_TAG=\"libdisplay\"
-LOCAL_CFLAGS += -DTRACE=0
-LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_GRAPHICS
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_MODULE := libdisplay
-include $(BUILD_STATIC_LIBRARY)
-
-graphicsAppTestFiles := \
- tests/graphics_app_tests.cpp
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := graphics_app_tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- $(graphicsAppTestFiles) \
-
-LOCAL_C_INCLUDES := \
- $(includeFiles) \
-
-LOCAL_SHARED_LIBRARIES := \
- $(sharedLibraries) \
-
-LOCAL_STATIC_LIBRARIES := \
- libdisplay \
- $(staticLibraries) \
-
-include $(BUILD_NATIVE_TEST)
-
-dummyNativeWindowTestFiles := \
- tests/dummy_native_window_tests.cpp \
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := dummy_native_window_tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- $(dummyNativeWindowTestFiles) \
-
-LOCAL_C_INCLUDES := \
- $(includeFiles) \
-
-LOCAL_SHARED_LIBRARIES := \
- $(sharedLibraries) \
-
-LOCAL_STATIC_LIBRARIES := \
- libdisplay \
- $(staticLibraries) \
-include $(BUILD_NATIVE_TEST)
-
diff --git a/libs/vr/libdvrcommon/Android.bp b/libs/vr/libdvrcommon/Android.bp
new file mode 100644
index 0000000..81404a4
--- /dev/null
+++ b/libs/vr/libdvrcommon/Android.bp
@@ -0,0 +1,81 @@
+// 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.
+
+sourceFiles = [
+ "frame_time_history.cpp",
+ "revision.cpp",
+ "revision_path.cpp",
+ "sync_util.cpp",
+]
+
+localIncludeFiles = [
+ "include",
+]
+
+sharedLibraries = [
+ "libbase",
+ "libcutils",
+ "liblog",
+ "libutils",
+ "libEGL",
+ "libGLESv2",
+ "libui",
+ "libgui",
+ "libhardware",
+]
+
+staticLibraries = ["libpdx_default_transport"]
+
+headerLibraries = [
+ "libeigen",
+]
+
+cc_library {
+ srcs: sourceFiles,
+ local_include_dirs: localIncludeFiles,
+
+ cflags: [
+ "-DLOG_TAG=\"libdvrcommon\"",
+ "-DTRACE=0",
+ ],
+ export_include_dirs: localIncludeFiles,
+
+ shared_libs: sharedLibraries,
+ static_libs: staticLibraries,
+ header_libs: headerLibraries,
+ export_header_lib_headers: headerLibraries,
+
+ name: "libdvrcommon",
+}
+
+testFiles = [
+ "tests/numeric_test.cpp",
+ "tests/pose_test.cpp",
+]
+
+cc_test {
+ name: "libdvrcommon_test",
+ tags: ["optional"],
+
+ srcs: testFiles,
+
+ shared_libs: sharedLibraries,
+
+ static_libs: [
+ "libgmock_main",
+ "libgmock",
+ "libgtest",
+ "libdvrcommon",
+ ] + staticLibraries,
+}
diff --git a/libs/vr/libdvrcommon/Android.mk b/libs/vr/libdvrcommon/Android.mk
deleted file mode 100644
index 80eb3a6..0000000
--- a/libs/vr/libdvrcommon/Android.mk
+++ /dev/null
@@ -1,80 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-sourceFiles := \
- frame_time_history.cpp \
- revision.cpp \
- revision_path.cpp \
- sync_util.cpp \
-
-includeFiles := \
- $(LOCAL_PATH)/include \
- external/eigen \
-
-sharedLibraries := \
- libbase \
- libcutils \
- liblog \
- libutils \
- libEGL \
- libGLESv2 \
- libui \
- libgui \
- libhardware
-
-staticLibraries := \
- libpdx_default_transport \
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := \
- $(includeFiles) \
-
-LOCAL_CFLAGS += -DLOG_TAG=\"libdvrcommon\"
-LOCAL_CFLAGS += -DTRACE=0
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
- $(includeFiles) \
-
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_MODULE := libdvrcommon
-include $(BUILD_STATIC_LIBRARY)
-
-testFiles := \
- tests/numeric_test.cpp \
- tests/pose_test.cpp \
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libdvrcommon_test
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- $(testFiles) \
-
-LOCAL_C_INCLUDES := \
- $(includeFiles) \
-
-LOCAL_SHARED_LIBRARIES := \
- $(sharedLibraries) \
-
-LOCAL_STATIC_LIBRARIES := \
- libgmock_main \
- libgmock \
- libgtest \
- $(staticLibraries) \
-
-include $(BUILD_NATIVE_TEST)
-
diff --git a/libs/vr/libdvrgraphics/Android.bp b/libs/vr/libdvrgraphics/Android.bp
new file mode 100644
index 0000000..73a8bf8
--- /dev/null
+++ b/libs/vr/libdvrgraphics/Android.bp
@@ -0,0 +1,45 @@
+
+
+sourceFiles = [
+ "blur.cpp",
+ "debug_text.cpp",
+ "egl_image.cpp",
+ "gpu_profiler.cpp",
+ "shader_program.cpp",
+ "timer_query.cpp",
+ "vr_gl_extensions.cpp",
+]
+
+localIncludeFiles = [
+ "include",
+]
+
+staticLibraries = [
+ "libbufferhub",
+ "libdvrcommon",
+ "libpdx_default_transport",
+]
+
+sharedLibraries = [
+ "libcutils",
+ "libbase",
+ "libEGL",
+ "libGLESv2",
+ "libpng",
+ "liblog",
+]
+
+cc_library_static {
+ srcs: sourceFiles,
+ cflags: [
+ "-DGL_GLEXT_PROTOTYPES",
+ "-DEGL_EGLEXT_PROTOTYPES",
+ ],
+ export_include_dirs: localIncludeFiles,
+ shared_libs: sharedLibraries,
+ static_libs: staticLibraries,
+ // Rather than add this header-file-only library to all users of libdvrgraphics,
+ // include it here.
+ whole_static_libs: ["libarect"],
+ name: "libdvrgraphics",
+}
diff --git a/libs/vr/libdvrgraphics/Android.mk b/libs/vr/libdvrgraphics/Android.mk
deleted file mode 100644
index b9e601c..0000000
--- a/libs/vr/libdvrgraphics/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-sourceFiles := \
- blur.cpp \
- debug_text.cpp \
- egl_image.cpp \
- gpu_profiler.cpp \
- shader_program.cpp \
- timer_query.cpp \
- vr_gl_extensions.cpp \
-
-includeFiles := \
- $(LOCAL_PATH)/include
-
-staticLibraries := \
- libbufferhub \
- libdvrcommon \
- libpdx_default_transport \
-
-sharedLibraries := \
- libcutils \
- libbase \
- libpng
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-# Rather than add this header-file-only library to all users of libdvrgraphics,
-# include it here.
-LOCAL_WHOLE_STATIC_LIBRARIES := libarect
-LOCAL_MODULE := libdvrgraphics
-include $(BUILD_STATIC_LIBRARY)
-
diff --git a/libs/vr/libeds/Android.bp b/libs/vr/libeds/Android.bp
new file mode 100644
index 0000000..a9df847
--- /dev/null
+++ b/libs/vr/libeds/Android.bp
@@ -0,0 +1,85 @@
+// Copyright (C) 2015 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.
+
+sourceFiles = [
+ "eds.cpp",
+ "eds_mesh.cpp",
+ "composite_hmd.cpp",
+ "cpu_thread_pose_updater.cpp",
+ "display_metrics.cpp",
+ "distortion_renderer.cpp",
+ "lucid_metrics.cpp",
+ "lucid_pose_tracker.cpp",
+ "lookup_radial_distortion.cpp",
+ "polynomial_radial_distortion.cpp",
+]
+
+localIncludeFiles = [
+ "include",
+]
+
+sharedLibraries = [
+ "libbase",
+ "libcutils",
+ "liblog",
+ "libEGL",
+ "libGLESv1_CM",
+ "libGLESv2",
+ "libvulkan",
+]
+
+staticLibraries = [
+ "libdisplay",
+ "libdvrcommon",
+ "libdvrgraphics",
+ "libvrsensor",
+ "libpdx_default_transport",
+]
+
+cc_library_static {
+ srcs: sourceFiles,
+ cflags: [
+ "-DGL_GLEXT_PROTOTYPES",
+ "-DEGL_EGLEXT_PROTOTYPES",
+ "-Wno-unused-parameter"],
+ // Enable debug options below to show GL errors and use gdb.
+ // + ["-UNDEBUG", "-DDEBUG", "-O0", "-g", ]
+ export_include_dirs: localIncludeFiles,
+ shared_libs: sharedLibraries,
+ static_libs: staticLibraries,
+ name: "libeds",
+}
+
+testFiles = ["tests/eds_app_tests.cpp"]
+
+cc_test {
+ name: "eds_app_tests",
+ tags: ["optional"],
+
+ srcs: testFiles,
+
+ shared_libs: [
+ "libhardware",
+ "libsync",
+ ] + sharedLibraries,
+
+ static_libs: [
+ "libgmock_main",
+ "libgmock",
+ "libeds",
+ ] + staticLibraries + [
+ "libbufferhub"
+ ],
+
+}
diff --git a/libs/vr/libeds/Android.mk b/libs/vr/libeds/Android.mk
deleted file mode 100644
index d2e6526..0000000
--- a/libs/vr/libeds/Android.mk
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright (C) 2015 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)
-
-sourceFiles := \
- eds.cpp \
- eds_mesh.cpp \
- composite_hmd.cpp \
- cpu_thread_pose_updater.cpp \
- display_metrics.cpp \
- distortion_renderer.cpp \
- lucid_metrics.cpp \
- lucid_pose_tracker.cpp \
- lookup_radial_distortion.cpp \
- polynomial_radial_distortion.cpp
-
-includeFiles += \
- $(LOCAL_PATH)/include
-
-sharedLibraries := \
- libbase \
- libcutils \
- liblog \
- libEGL \
- libGLESv1_CM \
- libGLESv2 \
- libvulkan \
-
-staticLibraries := \
- libdisplay \
- libdvrcommon \
- libdvrgraphics \
- libsensor \
- libpdx_default_transport \
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -Wno-unused-parameter
-# Enable debug options below to show GL errors and use gdb.
-# LOCAL_CFLAGS += -UNDEBUG -DDEBUG -O0 -g
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_MODULE := libeds
-include $(BUILD_STATIC_LIBRARY)
-
-
-testFiles := \
- tests/eds_app_tests.cpp
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := eds_app_tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- $(testFiles) \
-
-LOCAL_C_INCLUDES := \
- $(includeFiles) \
-
-LOCAL_SHARED_LIBRARIES := \
- libhardware \
- libsync \
- $(sharedLibraries) \
-
-LOCAL_STATIC_LIBRARIES := \
- libgmock_main \
- libgmock \
- libdisplay \
- libeds \
- libbufferhub \
- $(staticLibraries) \
-
-include $(BUILD_NATIVE_TEST)
diff --git a/libs/vr/libimageio/Android.bp b/libs/vr/libimageio/Android.bp
new file mode 100644
index 0000000..7dde075
--- /dev/null
+++ b/libs/vr/libimageio/Android.bp
@@ -0,0 +1,26 @@
+
+
+sourceFiles = [
+ "image_io.cpp",
+ "image_io_png.cpp",
+ "image_io_ppm.cpp",
+]
+
+includeFiles = ["include"]
+
+sharedLibraries = [
+ "libcutils",
+ "libpng",
+]
+
+cc_library_static {
+ srcs: sourceFiles,
+ export_include_dirs: includeFiles,
+ shared_libs: sharedLibraries,
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ ],
+ name: "libimageio",
+ tags: ["optional"],
+}
diff --git a/libs/vr/libimageio/Android.mk b/libs/vr/libimageio/Android.mk
deleted file mode 100644
index b3b88ac..0000000
--- a/libs/vr/libimageio/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-sourceFiles := \
- image_io.cpp \
- image_io_png.cpp \
- image_io_ppm.cpp
-
-includeFiles := \
- $(LOCAL_PATH)/include
-
-sharedLibraries := \
- libcutils \
- libpng
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES += $(includeFiles)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_CFLAGS := -Wall -Wextra
-LOCAL_MODULE := libimageio
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_STATIC_LIBRARY)
diff --git a/libs/vr/libperformance/Android.bp b/libs/vr/libperformance/Android.bp
new file mode 100644
index 0000000..364873d
--- /dev/null
+++ b/libs/vr/libperformance/Android.bp
@@ -0,0 +1,41 @@
+// 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.
+
+sourceFiles = [
+ "performance_client.cpp",
+ "performance_rpc.cpp",
+]
+
+includeFiles = [ "include" ]
+
+staticLibraries = ["libpdx_default_transport"]
+
+sharedLibraries = [
+ "libbase",
+ "libcutils",
+ "liblog",
+ "libutils",
+]
+
+cc_library {
+ srcs: sourceFiles,
+ cflags: [
+ "-DLOG_TAG=\"libperformance\"",
+ "-DTRACE=0"
+ ],
+ export_include_dirs: includeFiles,
+ static_libs: staticLibraries,
+ shared_libs: sharedLibraries,
+ name: "libperformance",
+}
diff --git a/libs/vr/libperformance/Android.mk b/libs/vr/libperformance/Android.mk
deleted file mode 100644
index aaacb1a..0000000
--- a/libs/vr/libperformance/Android.mk
+++ /dev/null
@@ -1,43 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-sourceFiles := \
- performance_client.cpp \
- performance_rpc.cpp
-
-includeFiles := \
- $(LOCAL_PATH)/include
-
-staticLibraries := \
- libpdx_default_transport \
-
-sharedLibraries := \
- libbase \
- libcutils \
- liblog \
- libutils
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_CFLAGS := -DLOG_TAG=\"libperformance\"
-LOCAL_CFLAGS += -DTRACE=0
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_MODULE := libperformance
-include $(BUILD_STATIC_LIBRARY)
-
diff --git a/libs/vr/libposepredictor/Android.bp b/libs/vr/libposepredictor/Android.bp
new file mode 100644
index 0000000..2f1d2f5
--- /dev/null
+++ b/libs/vr/libposepredictor/Android.bp
@@ -0,0 +1,58 @@
+// Copyright (C) 2008 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.
+
+sourceFiles = [
+ "predictor.cpp",
+ "buffered_predictor.cpp",
+ "linear_predictor.cpp",
+ "polynomial_predictor.cpp",
+ "dvr_pose_predictor.cpp",
+]
+
+includeFiles = [
+ "include",
+]
+
+staticLibraries = ["libvrsensor"]
+
+sharedLibraries = []
+
+headerLibraries = [ "libeigen" ]
+
+cc_library {
+ srcs: sourceFiles,
+ cflags: [
+ "-DLOG_TAG=\"libposepredictor\"",
+ "-DTRACE=0",
+ ],
+ export_include_dirs: includeFiles,
+ static_libs: staticLibraries,
+ shared_libs: sharedLibraries,
+ header_libs: headerLibraries,
+ export_header_lib_headers: headerLibraries,
+ name: "libposepredictor",
+}
+
+cc_test {
+ tags: ["optional"],
+ srcs: [
+ "predictor_tests.cpp",
+ "linear_predictor_tests.cpp",
+ "polynomial_predictor_tests.cpp",
+ ],
+
+ static_libs: ["libposepredictor"] + staticLibraries,
+ shared_libs: sharedLibraries,
+ name: "pose_predictor_tests",
+}
diff --git a/libs/vr/libposepredictor/Android.mk b/libs/vr/libposepredictor/Android.mk
deleted file mode 100755
index 2217819..0000000
--- a/libs/vr/libposepredictor/Android.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright (C) 2008 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)
-
-sourceFiles := \
- predictor.cpp \
- buffered_predictor.cpp \
- linear_predictor.cpp \
- polynomial_predictor.cpp \
- dvr_pose_predictor.cpp \
-
-includeFiles := \
- $(LOCAL_PATH)/include \
- external/eigen \
-
-staticLibraries := \
- libsensor \
-
-sharedLibraries := \
-
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_CFLAGS := -DLOG_TAG=\"libposepredictor\"
-LOCAL_CFLAGS += -DTRACE=0
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_MODULE := libposepredictor
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := \
- predictor_tests.cpp \
- linear_predictor_tests.cpp \
- polynomial_predictor_tests.cpp \
-
-LOCAL_STATIC_LIBRARIES := libposepredictor $(staticLibraries)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_MODULE := pose_predictor_tests
-include $(BUILD_NATIVE_TEST)
diff --git a/libs/vr/libsensor/Android.mk b/libs/vr/libsensor/Android.mk
deleted file mode 100644
index 8c7ad43..0000000
--- a/libs/vr/libsensor/Android.mk
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright (C) 2015 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)
-
-sourceFiles := \
- pose_client.cpp \
- sensor_client.cpp
-
-includeFiles := \
- $(LOCAL_PATH)/include
-
-staticLibraries := \
- libbufferhub \
- libdvrcommon \
- libpdx_default_transport \
-
-sharedLibraries := \
- libbase \
- libcutils \
- libhardware \
- liblog \
- libutils \
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-LOCAL_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_MODULE := libsensor
-include $(BUILD_STATIC_LIBRARY)
-
-
-testFiles := \
- tests/sensor_app_tests.cpp
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := sensor_app_tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := \
- $(testFiles) \
-
-LOCAL_C_INCLUDES := \
- $(includeFiles) \
-
-LOCAL_SHARED_LIBRARIES := \
- libEGL \
- libGLESv1_CM \
- libGLESv2 \
- libvulkan \
- libsync \
- $(sharedLibraries) \
-
-LOCAL_STATIC_LIBRARIES := \
- libgmock_main \
- libgmock \
- libdisplay \
- libeds \
- libsensor \
- libdvrgraphics \
- $(staticLibraries) \
-
-include $(BUILD_NATIVE_TEST)
diff --git a/libs/vr/libvr_manager/Android.bp b/libs/vr/libvr_manager/Android.bp
new file mode 100644
index 0000000..8784877
--- /dev/null
+++ b/libs/vr/libvr_manager/Android.bp
@@ -0,0 +1,36 @@
+// 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.
+
+exported_include_dirs = [ "include" ]
+
+include_dirs = ["frameworks/native/include/vr/vr_manager"]
+
+src_files = [
+ "vr_manager.cpp",
+ "trusted_uids.cpp",
+]
+
+static_libs = [
+ "libutils",
+ "libbinder",
+]
+
+cc_library_static {
+ srcs: src_files,
+ include_dirs: include_dirs,
+ export_include_dirs: exported_include_dirs,
+ cflags: ["-Wall", "-Werror", "-Wunused", "-Wunreachable-code"],
+ static_libs: static_libs,
+ name: "libvr_manager",
+}
diff --git a/libs/vr/libvr_manager/Android.mk b/libs/vr/libvr_manager/Android.mk
deleted file mode 100644
index e9987f7..0000000
--- a/libs/vr/libvr_manager/Android.mk
+++ /dev/null
@@ -1,42 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-exported_include_dirs := \
- $(LOCAL_PATH)/include
-
-include_dirs := \
- frameworks/native/include/vr/vr_manager \
- $(exported_include_dirs)
-
-src_files := \
- vr_manager.cpp \
- trusted_uids.cpp
-
-static_libs := \
- libutils \
- libbinder \
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(src_files)
-LOCAL_C_INCLUDES := $(include_dirs)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(exported_include_dirs)
-LOCAL_CFLAGS += -Wall
-LOCAL_CFLAGS += -Werror
-LOCAL_CFLAGS += -Wunused
-LOCAL_CFLAGS += -Wunreachable-code
-LOCAL_STATIC_LIBRARIES := $(static_libs)
-LOCAL_MODULE := libvr_manager
-include $(BUILD_STATIC_LIBRARY)
diff --git a/libs/vr/libvrflinger/Android.bp b/libs/vr/libvrflinger/Android.bp
new file mode 100644
index 0000000..4ad7c23
--- /dev/null
+++ b/libs/vr/libvrflinger/Android.bp
@@ -0,0 +1,87 @@
+// Copyright (C) 2008 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.
+
+sourceFiles = [
+ "acquired_buffer.cpp",
+ "compositor.cpp",
+ "debug_hud_data.cpp",
+ "debug_hud_view.cpp",
+ "display_manager_service.cpp",
+ "display_service.cpp",
+ "display_surface.cpp",
+ "epoll_event_dispatcher.cpp",
+ "hardware_composer.cpp",
+ "screenshot_service.cpp",
+ "surface_channel.cpp",
+ "video_compositor.cpp",
+ "video_mesh_surface.cpp",
+ "vr_flinger.cpp",
+ "vsync_service.cpp",
+]
+
+includeFiles = [ "include" ]
+
+staticLibraries = [
+ "libsurfaceflingerincludes",
+ "libhwcomposer-command-buffer",
+ "libbufferhub",
+ "libbufferhubqueue",
+ "libeds",
+ "libdisplay",
+ "libdvrcommon",
+ "libdvrgraphics",
+ "libperformance",
+ "libvrsensor",
+ "libpdx_default_transport",
+ "libvr_manager",
+]
+
+sharedLibraries = [
+ "android.dvr.composer@1.0",
+ "android.hardware.graphics.allocator@2.0",
+ "android.hardware.graphics.composer@2.1",
+ "libbinder",
+ "libbase",
+ "libcutils",
+ "liblog",
+ "libhardware",
+ "libnativewindow",
+ "libutils",
+ "libEGL",
+ "libGLESv1_CM",
+ "libGLESv2",
+ "libvulkan",
+ "libui",
+ "libgui",
+ "libsync",
+ "libhidlbase",
+ "libhidltransport",
+ "libfmq",
+]
+
+cc_library_static {
+ srcs: sourceFiles,
+ export_include_dirs: includeFiles,
+
+ cflags: [
+ "-DLOG_TAG=\"vr_flinger\"",
+ "-DTRACE=0",
+ "-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
+ "-DGL_GLEXT_PROTOTYPES",
+ "-DEGL_EGLEXT_PROTOTYPES",
+ ],
+ shared_libs: sharedLibraries,
+ whole_static_libs: staticLibraries,
+ name: "libvrflinger",
+}
diff --git a/libs/vr/libvrflinger/Android.mk b/libs/vr/libvrflinger/Android.mk
deleted file mode 100644
index 3450788..0000000
--- a/libs/vr/libvrflinger/Android.mk
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright (C) 2008 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)
-
-sourceFiles := \
- acquired_buffer.cpp \
- compositor.cpp \
- debug_hud_data.cpp \
- debug_hud_view.cpp \
- display_manager_service.cpp \
- display_service.cpp \
- display_surface.cpp \
- epoll_event_dispatcher.cpp \
- hardware_composer.cpp \
- screenshot_service.cpp \
- surface_channel.cpp \
- video_compositor.cpp \
- video_mesh_surface.cpp \
- vr_flinger.cpp \
- vsync_service.cpp
-
-includeFiles := $(LOCAL_PATH)/include
-
-staticLibraries := \
- libsurfaceflingerincludes \
- libhwcomposer-command-buffer \
- libbufferhub \
- libbufferhubqueue \
- libeds \
- libdisplay \
- libdvrcommon \
- libdvrgraphics \
- libperformance \
- libsensor \
- libpdx_default_transport \
- libvr_manager \
-
-sharedLibraries := \
- android.dvr.composer@1.0 \
- android.hardware.graphics.allocator@2.0 \
- android.hardware.graphics.composer@2.1 \
- libbinder \
- libbase \
- libcutils \
- liblog \
- libhardware \
- libnativewindow \
- libutils \
- libEGL \
- libGLESv1_CM \
- libGLESv2 \
- libvulkan \
- libui \
- libgui \
- libsync \
- libhidlbase \
- libhidltransport \
- libfmq \
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(sourceFiles)
-LOCAL_C_INCLUDES := $(includeFiles)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(includeFiles)
-
-LOCAL_CFLAGS += -DLOG_TAG=\"vr_flinger\"
-LOCAL_CFLAGS += -DTRACE=0
-LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_GRAPHICS
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
-LOCAL_WHOLE_STATIC_LIBRARIES := $(staticLibraries)
-LOCAL_MODULE := libvrflinger
-include $(BUILD_STATIC_LIBRARY)
diff --git a/libs/vr/libvrsensor/Android.bp b/libs/vr/libvrsensor/Android.bp
new file mode 100644
index 0000000..376630e
--- /dev/null
+++ b/libs/vr/libvrsensor/Android.bp
@@ -0,0 +1,71 @@
+// Copyright (C) 2015 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.
+
+sourceFiles = [
+ "pose_client.cpp",
+ "sensor_client.cpp",
+]
+
+includeFiles = [
+ "include",
+]
+
+staticLibraries = [
+ "libbufferhub",
+ "libdvrcommon",
+ "libpdx_default_transport",
+]
+
+sharedLibraries = [
+ "libbase",
+ "libcutils",
+ "libhardware",
+ "liblog",
+ "libutils",
+]
+
+cc_library {
+ srcs: sourceFiles,
+ export_include_dirs: includeFiles,
+ static_libs: staticLibraries,
+ shared_libs: sharedLibraries,
+ name: "libvrsensor",
+}
+
+testFiles = ["tests/sensor_app_tests.cpp"]
+
+cc_test {
+ name: "sensor_app_tests",
+ tags: ["optional"],
+
+ srcs: testFiles,
+
+ shared_libs: [
+ "libEGL",
+ "libGLESv1_CM",
+ "libGLESv2",
+ "libvulkan",
+ "libsync",
+ ] + sharedLibraries,
+
+ static_libs: [
+ "libgmock_main",
+ "libgmock",
+ "libdisplay",
+ "libeds",
+ "libvrsensor",
+ "libdvrgraphics",
+ ] + staticLibraries,
+
+}
diff --git a/libs/vr/libsensor/include/CPPLINT.cfg b/libs/vr/libvrsensor/include/CPPLINT.cfg
similarity index 100%
rename from libs/vr/libsensor/include/CPPLINT.cfg
rename to libs/vr/libvrsensor/include/CPPLINT.cfg
diff --git a/libs/vr/libsensor/include/dvr/pose_client.h b/libs/vr/libvrsensor/include/dvr/pose_client.h
similarity index 100%
rename from libs/vr/libsensor/include/dvr/pose_client.h
rename to libs/vr/libvrsensor/include/dvr/pose_client.h
diff --git a/libs/vr/libsensor/include/private/dvr/pose-ipc.h b/libs/vr/libvrsensor/include/private/dvr/pose-ipc.h
similarity index 100%
rename from libs/vr/libsensor/include/private/dvr/pose-ipc.h
rename to libs/vr/libvrsensor/include/private/dvr/pose-ipc.h
diff --git a/libs/vr/libsensor/include/private/dvr/pose_client_internal.h b/libs/vr/libvrsensor/include/private/dvr/pose_client_internal.h
similarity index 100%
rename from libs/vr/libsensor/include/private/dvr/pose_client_internal.h
rename to libs/vr/libvrsensor/include/private/dvr/pose_client_internal.h
diff --git a/libs/vr/libsensor/include/private/dvr/sensor-ipc.h b/libs/vr/libvrsensor/include/private/dvr/sensor-ipc.h
similarity index 100%
rename from libs/vr/libsensor/include/private/dvr/sensor-ipc.h
rename to libs/vr/libvrsensor/include/private/dvr/sensor-ipc.h
diff --git a/libs/vr/libsensor/include/private/dvr/sensor_client.h b/libs/vr/libvrsensor/include/private/dvr/sensor_client.h
similarity index 100%
rename from libs/vr/libsensor/include/private/dvr/sensor_client.h
rename to libs/vr/libvrsensor/include/private/dvr/sensor_client.h
diff --git a/libs/vr/libsensor/include/private/dvr/sensor_constants.h b/libs/vr/libvrsensor/include/private/dvr/sensor_constants.h
similarity index 100%
rename from libs/vr/libsensor/include/private/dvr/sensor_constants.h
rename to libs/vr/libvrsensor/include/private/dvr/sensor_constants.h
diff --git a/libs/vr/libsensor/pose_client.cpp b/libs/vr/libvrsensor/pose_client.cpp
similarity index 100%
rename from libs/vr/libsensor/pose_client.cpp
rename to libs/vr/libvrsensor/pose_client.cpp
diff --git a/libs/vr/libsensor/sensor_client.cpp b/libs/vr/libvrsensor/sensor_client.cpp
similarity index 100%
rename from libs/vr/libsensor/sensor_client.cpp
rename to libs/vr/libvrsensor/sensor_client.cpp
diff --git a/libs/vr/libsensor/tests/sensor_app_tests.cpp b/libs/vr/libvrsensor/tests/sensor_app_tests.cpp
similarity index 100%
rename from libs/vr/libsensor/tests/sensor_app_tests.cpp
rename to libs/vr/libvrsensor/tests/sensor_app_tests.cpp
diff --git a/services/Android.bp b/services/Android.bp
new file mode 100644
index 0000000..7a8ee5d
--- /dev/null
+++ b/services/Android.bp
@@ -0,0 +1 @@
+subdirs = [ "*" ]
diff --git a/services/vr/Android.bp b/services/vr/Android.bp
index af8212a..80df479 100644
--- a/services/vr/Android.bp
+++ b/services/vr/Android.bp
@@ -1,3 +1,3 @@
subdirs = [
- "*/*",
+ "*",
]
diff --git a/services/vr/sensord/Android.mk b/services/vr/sensord/Android.mk
index f86664e..f9a1cec 100644
--- a/services/vr/sensord/Android.mk
+++ b/services/vr/sensord/Android.mk
@@ -30,7 +30,7 @@
staticLibraries := \
libdvrcommon \
- libsensor \
+ libvrsensor \
libperformance \
libbufferhub \
libpdx_default_transport \
diff --git a/services/vr/virtual_touchpad/Android.bp b/services/vr/virtual_touchpad/Android.bp
new file mode 100644
index 0000000..ad999b7
--- /dev/null
+++ b/services/vr/virtual_touchpad/Android.bp
@@ -0,0 +1,116 @@
+
+
+// Touchpad implementation.
+
+src = [
+ "EvdevInjector.cpp",
+ "VirtualTouchpadEvdev.cpp",
+]
+
+shared_libs = [
+ "libbase",
+ "liblog",
+ "libutils",
+]
+
+cc_library {
+ srcs: src,
+ export_include_dirs: ["include"],
+ shared_libs: shared_libs,
+ cppflags: ["-std=c++11"],
+ cflags: ["-DLOG_TAG=\"VrVirtualTouchpad\""],
+ name: "libvirtualtouchpad",
+ tags: ["optional"],
+}
+
+// Touchpad unit tests.
+
+test_static_libs = [
+ "libcutils",
+ "libvirtualtouchpad",
+]
+
+test_shared_libs = [
+ "libbase",
+ "liblog",
+ "libutils",
+]
+
+test_src_files = ["tests/VirtualTouchpad_test.cpp"]
+
+cc_test {
+ srcs: test_src_files,
+ static_libs: test_static_libs,
+ shared_libs: test_shared_libs,
+ cppflags = [
+ "-std=c++11",
+ ],
+ host_ldlibs = [
+ "-llog",
+ ],
+ name: "VirtualTouchpad_test",
+ stl: "libc++_static",
+ tags: [ "optional" ],
+}
+
+// Service.
+
+service_src = [
+ "main.cpp",
+ "VirtualTouchpadService.cpp",
+ "aidl/android/dvr/VirtualTouchpadService.aidl",
+]
+
+service_static_libs = [
+ "libcutils",
+ "libvirtualtouchpad",
+]
+
+service_shared_libs = [
+ "libbase",
+ "libbinder",
+ "liblog",
+ "libutils",
+]
+
+cc_binary {
+ srcs: service_src,
+ static_libs: service_static_libs,
+ shared_libs: service_shared_libs,
+ cppflags: ["-std=c++11"],
+ cflags: [
+ "-DLOG_TAG=\"VrVirtualTouchpad\"",
+ "-DSELINUX_ACCESS_CONTROL",
+ ],
+ host_ldlibs: ["-llog"],
+ name: "virtual_touchpad",
+ tags: ["optional"],
+ init_rc: ["virtual_touchpad.rc"],
+ compile_multilib: "64",
+ stl: "libc++_static",
+}
+
+// Touchpad client library.
+
+client_src = [
+ "VirtualTouchpadClient.cpp",
+ "aidl/android/dvr/VirtualTouchpadService.aidl",
+]
+
+client_shared_libs = [
+ "libbase",
+ "libbinder",
+ "liblog",
+ "libutils",
+]
+
+cc_library {
+ srcs: client_src,
+ shared_libs: client_shared_libs,
+ cppflags: ["-std=c++11"],
+ cflags: ["-DLOG_TAG=\"VirtualTouchpadClient\""],
+ host_ldlibs: ["-llog"],
+ name: "libvirtualtouchpadclient",
+ tags: ["optional"],
+ export_include_dirs: ["include"],
+}
diff --git a/services/vr/virtual_touchpad/Android.mk b/services/vr/virtual_touchpad/Android.mk
deleted file mode 100644
index 88b2dd9..0000000
--- a/services/vr/virtual_touchpad/Android.mk
+++ /dev/null
@@ -1,107 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-
-# Touchpad implementation.
-
-src := \
- EvdevInjector.cpp \
- VirtualTouchpadEvdev.cpp
-
-shared_libs := \
- libbase \
- libutils
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(src)
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_SHARED_LIBRARIES := $(shared_libs)
-LOCAL_CPPFLAGS += -std=c++11
-LOCAL_CFLAGS += -DLOG_TAG=\"VrVirtualTouchpad\"
-LOCAL_MODULE := libvirtualtouchpad
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_STATIC_LIBRARY)
-
-
-# Touchpad unit tests.
-
-test_static_libs := \
- libbase \
- libcutils \
- libvirtualtouchpad
-
-test_shared_libs := \
- libutils
-
-test_src_files := \
- tests/VirtualTouchpad_test.cpp
-
-$(foreach file,$(test_src_files), \
- $(eval include $(CLEAR_VARS)) \
- $(eval LOCAL_SRC_FILES := $(file)) \
- $(eval LOCAL_C_INCLUDES := $(LOCAL_PATH)/include) \
- $(eval LOCAL_STATIC_LIBRARIES := $(test_static_libs)) \
- $(eval LOCAL_SHARED_LIBRARIES := $(test_shared_libs)) \
- $(eval LOCAL_CPPFLAGS += -std=c++11) \
- $(eval LOCAL_LDLIBS := -llog) \
- $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
- $(eval LOCAL_MODULE_TAGS := optional) \
- $(eval LOCAL_CXX_STL := libc++_static) \
- $(eval include $(BUILD_NATIVE_TEST)) \
-)
-
-
-# Service.
-
-src := \
- main.cpp \
- VirtualTouchpadService.cpp \
- aidl/android/dvr/VirtualTouchpadService.aidl
-
-static_libs := \
- libcutils \
- libvirtualtouchpad
-
-shared_libs := \
- libbase \
- libbinder \
- libutils
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(src)
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_STATIC_LIBRARIES := $(static_libs)
-LOCAL_SHARED_LIBRARIES := $(shared_libs)
-LOCAL_CPPFLAGS += -std=c++11
-LOCAL_CFLAGS += -DLOG_TAG=\"VrVirtualTouchpad\" -DSELINUX_ACCESS_CONTROL
-LOCAL_LDLIBS := -llog
-LOCAL_MODULE := virtual_touchpad
-LOCAL_MODULE_TAGS := optional
-LOCAL_INIT_RC := virtual_touchpad.rc
-LOCAL_MULTILIB := 64
-LOCAL_CXX_STL := libc++_static
-include $(BUILD_EXECUTABLE)
-
-
-# Touchpad client library.
-
-src := \
- VirtualTouchpadClient.cpp \
- aidl/android/dvr/VirtualTouchpadService.aidl
-
-shared_libs := \
- libbase \
- libbinder \
- libutils
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(src)
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_SHARED_LIBRARIES := $(shared_libs)
-LOCAL_CPPFLAGS += -std=c++11
-LOCAL_CFLAGS += -DLOG_TAG=\"VirtualTouchpadClient\"
-LOCAL_LDLIBS := -llog
-LOCAL_MODULE := libvirtualtouchpadclient
-LOCAL_MODULE_TAGS := optional
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
-include $(BUILD_STATIC_LIBRARY)
diff --git a/services/vr/vr_window_manager/Android.bp b/services/vr/vr_window_manager/Android.bp
new file mode 100644
index 0000000..a7a341c
--- /dev/null
+++ b/services/vr/vr_window_manager/Android.bp
@@ -0,0 +1,103 @@
+// 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.
+
+subdirs = [ "composer", ]
+
+native_src = [
+ "application.cpp",
+ "controller_mesh.cpp",
+ "elbow_model.cpp",
+ "hwc_callback.cpp",
+ "reticle.cpp",
+ "shell_view.cpp",
+ "surface_flinger_view.cpp",
+ "texture.cpp",
+ "vr_window_manager.cpp",
+ "vr_window_manager_binder.cpp",
+ "aidl/android/service/vr/IVrWindowManager.aidl",
+ "display_view.cpp",
+]
+
+static_libs = [
+ "libdisplay",
+ "libbufferhub",
+ "libbufferhubqueue",
+ "libeds",
+ "libdvrgraphics",
+ "libdvrcommon",
+ "libhwcomposer-client",
+ "libvrsensor",
+ "libperformance",
+ "libpdx_default_transport",
+ "libcutils",
+ "libvr_manager",
+ "libvirtualtouchpadclient",
+]
+
+shared_libs = [
+ "android.dvr.composer@1.0",
+ "android.hardware.graphics.composer@2.1",
+ "libvrhwc",
+ "libbase",
+ "libbinder",
+ "libinput",
+ "libhardware",
+ "libhwbinder",
+ "libsync",
+ "libutils",
+ "libgui",
+ "libEGL",
+ "libGLESv2",
+ "libvulkan",
+ "libsync",
+ "libui",
+ "libhidlbase",
+ "libhidltransport",
+ "liblog",
+]
+
+cc_binary {
+ srcs: native_src,
+ static_libs: static_libs,
+ shared_libs: shared_libs,
+ cflags: ["-DGL_GLEXT_PROTOTYPES", "-DEGL_EGLEXT_PROTOTYPES", "-DLOG_TAG=\"VrWindowManager\""],
+ host_ldlibs: ["-llog"],
+ name: "vr_wm",
+ tags: ["optional"],
+ init_rc: ["vr_wm.rc"],
+}
+
+cmd_src = [
+ "vr_wm_ctl.cpp",
+ "aidl/android/service/vr/IVrWindowManager.aidl",
+]
+
+staticLibs = ["libcutils"]
+
+sharedLibs = [
+ "libbase",
+ "libbinder",
+ "libutils",
+]
+
+cc_binary {
+ srcs: cmd_src,
+ static_libs: staticLibs,
+ shared_libs: sharedLibs,
+ cppflags: ["-std=c++11"],
+ cflags: ["-DLOG_TAG=\"vrwmctl\""],
+ host_ldlibs: ["-llog"],
+ name: "vr_wm_ctl",
+ tags: ["optional"],
+}
diff --git a/services/vr/vr_window_manager/Android.mk b/services/vr/vr_window_manager/Android.mk
deleted file mode 100644
index 59ef63c..0000000
--- a/services/vr/vr_window_manager/Android.mk
+++ /dev/null
@@ -1,100 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-native_src := \
- application.cpp \
- controller_mesh.cpp \
- display_view.cpp \
- elbow_model.cpp \
- hwc_callback.cpp \
- reticle.cpp \
- shell_view.cpp \
- surface_flinger_view.cpp \
- texture.cpp \
- vr_window_manager.cpp \
- vr_window_manager_binder.cpp \
- aidl/android/service/vr/IVrWindowManager.aidl
-
-static_libs := \
- libdisplay \
- libbufferhub \
- libbufferhubqueue \
- libeds \
- libdvrgraphics \
- libdvrcommon \
- libhwcomposer-client \
- libsensor \
- libperformance \
- libpdx_default_transport \
- libcutils \
- libvr_manager \
- libvirtualtouchpadclient
-
-shared_libs := \
- android.dvr.composer@1.0 \
- android.hardware.graphics.composer@2.1 \
- libvrhwc \
- libbase \
- libbinder \
- libinput \
- libhardware \
- libhwbinder \
- libsync \
- libutils \
- libgui \
- libEGL \
- libGLESv2 \
- libvulkan \
- libsync \
- libui \
- libhidlbase \
- libhidltransport
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(native_src)
-LOCAL_STATIC_LIBRARIES := $(static_libs)
-LOCAL_SHARED_LIBRARIES := $(shared_libs)
-LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
-LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES
-LOCAL_CFLAGS += -DLOG_TAG=\"VrWindowManager\"
-LOCAL_LDLIBS := -llog
-LOCAL_MODULE := vr_wm
-LOCAL_MODULE_TAGS := optional
-LOCAL_INIT_RC := vr_wm.rc
-include $(BUILD_EXECUTABLE)
-
-cmd_src := \
- vr_wm_ctl.cpp \
- aidl/android/service/vr/IVrWindowManager.aidl
-
-static_libs := \
- libcutils
-
-shared_libs := \
- libbase \
- libbinder \
- libutils
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(cmd_src)
-LOCAL_STATIC_LIBRARIES := $(static_libs)
-LOCAL_SHARED_LIBRARIES := $(shared_libs)
-LOCAL_CPPFLAGS += -std=c++11
-LOCAL_CFLAGS += -DLOG_TAG=\"vrwmctl\"
-LOCAL_LDLIBS := -llog
-LOCAL_MODULE := vr_wm_ctl
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
diff --git a/services/vr/vr_window_manager/composer/Android.bp b/services/vr/vr_window_manager/composer/Android.bp
index 7c8bb86..4349269 100644
--- a/services/vr/vr_window_manager/composer/Android.bp
+++ b/services/vr/vr_window_manager/composer/Android.bp
@@ -13,6 +13,10 @@
static_libs: [
"libhwcomposer-client",
+ "libdisplay",
+ "libpdx_default_transport",
+ "libbufferhub",
+ "libbufferhubqueue",
],
shared_libs: [
diff --git a/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp b/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
index 8b50c01..99e21ec 100644
--- a/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
+++ b/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
@@ -21,6 +21,8 @@
#include <mutex>
+#include <private/dvr/display_client.h>
+
#include "vr_composer_client.h"
using namespace android::hardware::graphics::common::V1_0;
@@ -310,12 +312,32 @@
return Error::BAD_CONFIG;
}
+ int error = 0;
+ auto display_client = DisplayClient::Create(&error);
+ SystemDisplayMetrics metrics;
+
+ if (error) {
+ ALOGE("Could not connect to display service : %s(%d)", strerror(error), error);
+ } else {
+ error = display_client->GetDisplayMetrics(&metrics);
+
+ if (error) {
+ ALOGE("Could not get display metrics from display service : %s(%d)", strerror(error), error);
+ }
+ }
+
+ if (error) {
+ metrics.display_native_width = 1080;
+ metrics.display_native_height = 1920;
+ ALOGI("Setting display metrics to default : width=%d height=%d", metrics.display_native_width, metrics.display_native_height);
+ }
+
switch (attribute) {
case IComposerClient::Attribute::WIDTH:
- *outValue = 1080;
+ *outValue = metrics.display_native_width;
break;
case IComposerClient::Attribute::HEIGHT:
- *outValue = 1920;
+ *outValue = metrics.display_native_height;
break;
case IComposerClient::Attribute::VSYNC_PERIOD:
*outValue = 1000 * 1000 * 1000 / 30; // 30fps
diff --git a/services/vr/vr_window_manager/hwc_callback.cpp b/services/vr/vr_window_manager/hwc_callback.cpp
index b755c60..2d2a85c 100644
--- a/services/vr/vr_window_manager/hwc_callback.cpp
+++ b/services/vr/vr_window_manager/hwc_callback.cpp
@@ -41,6 +41,7 @@
base::unique_fd HwcCallback::OnNewFrame(const ComposerView::Frame& display_frame) {
auto& frame = display_frame.layers;
std::vector<HwcLayer> hwc_frame(frame.size());
+
for (size_t i = 0; i < frame.size(); ++i) {
hwc_frame[i] = HwcLayer{
.fence = frame[i].fence,
diff --git a/services/vr/vr_window_manager/surface_flinger_view.cpp b/services/vr/vr_window_manager/surface_flinger_view.cpp
index 2011967..46eb880 100644
--- a/services/vr/vr_window_manager/surface_flinger_view.cpp
+++ b/services/vr/vr_window_manager/surface_flinger_view.cpp
@@ -1,6 +1,7 @@
#include "surface_flinger_view.h"
#include <impl/vr_composer_view.h>
+#include <private/dvr/display_client.h>
#include <private/dvr/native_buffer.h>
#include "hwc_callback.h"
@@ -38,9 +39,29 @@
vr_composer_view_->Initialize(GetComposerViewFromIComposer(
vr_hwcomposer_.get()));
- // TODO(dnicoara): Query this from the composer service.
- width_ = 1920;
- height_ = 1080;
+ int error = 0;
+ auto display_client = DisplayClient::Create(&error);
+ SystemDisplayMetrics metrics;
+
+ if (error) {
+ ALOGE("Could not connect to display service : %s(%d)", strerror(error), error);
+ } else {
+ error = display_client->GetDisplayMetrics(&metrics);
+
+ if (error) {
+ ALOGE("Could not get display metrics from display service : %s(%d)", strerror(error), error);
+ }
+ }
+
+ if (error) {
+ metrics.display_native_height = 1920;
+ metrics.display_native_width = 1080;
+ ALOGI("Setting display metrics to default : width=%d height=%d", metrics.display_native_height, metrics.display_native_width);
+ }
+
+ // TODO(alexst): Refactor ShellView to account for orientation and change this back.
+ width_ = metrics.display_native_height;
+ height_ = metrics.display_native_width;
return true;
}
diff --git a/vulkan/Android.bp b/vulkan/Android.bp
index 3f077a2..3fd8c51 100644
--- a/vulkan/Android.bp
+++ b/vulkan/Android.bp
@@ -23,7 +23,7 @@
license: "include/vulkan/NOTICE",
}
-cc_library_static {
+cc_library_headers {
name: "vulkan_headers",
export_include_dirs: ["include"],
}
diff --git a/vulkan/libvulkan/Android.bp b/vulkan/libvulkan/Android.bp
index 524de75..2fe880a 100644
--- a/vulkan/libvulkan/Android.bp
+++ b/vulkan/libvulkan/Android.bp
@@ -64,8 +64,8 @@
"vulkan_loader_data.cpp",
],
- export_static_lib_headers: ["vulkan_headers"],
- static_libs: [
+ export_header_lib_headers: ["vulkan_headers"],
+ header_libs: [
"vulkan_headers",
],
shared_libs: [
diff --git a/vulkan/nulldrv/Android.bp b/vulkan/nulldrv/Android.bp
index ea3b781..3329609 100644
--- a/vulkan/nulldrv/Android.bp
+++ b/vulkan/nulldrv/Android.bp
@@ -42,6 +42,6 @@
"null_driver_gen.cpp",
],
- static_libs: ["vulkan_headers"],
+ header_libs: ["vulkan_headers"],
shared_libs: ["liblog"],
}