diff --git a/device.mk b/device.mk
index 1a48a595..2a47b3e9 100644
--- a/device.mk
+++ b/device.mk
@@ -22,6 +22,7 @@ include device/google/gs-common/modem/modem.mk
include device/google/gs-common/aoc/aoc.mk
include device/google/gs-common/trusty/trusty.mk
include device/google/gs-common/storage/storage.mk
+include device/google/gs-common/gps/brcm/device.mk
TARGET_BOARD_PLATFORM := zuma
ALLOW_MISSING_DEPENDENCIES := true
@@ -883,9 +884,8 @@ ifneq ($(BOARD_WITHOUT_RADIO),true)
$(call inherit-product-if-exists, vendor/samsung_slsi/telephony/$(BOARD_USES_SHARED_VENDOR_TELEPHONY)/common/device-vendor.mk)
endif
-#GPS HAL
+#GPS conf
include device/google/zuma/gnss/device-gnss.mk
-BOARD_VENDOR_SEPOLICY_DIRS += device/google/zuma-sepolicy/gps
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
#$(call inherit-product, hardware/google_devices/exynos5/exynos5.mk)
diff --git a/device_framework_matrix_product.xml b/device_framework_matrix_product.xml
index a9ee93e9..66dfe2a9 100644
--- a/device_framework_matrix_product.xml
+++ b/device_framework_matrix_product.xml
@@ -21,13 +21,6 @@
default
-
- android.hardware.gnss
-
- IGnss
- default
-
-
android.hardware.graphics.composer3
1
diff --git a/gnss/47765/Android.bp b/gnss/47765/Android.bp
deleted file mode 100644
index 2a3315ac..00000000
--- a/gnss/47765/Android.bp
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright (C) 2020 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.
-
-soong_namespace {
-}
-
-package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "//device/google/zuma:device_google_zuma_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: [
- "//device/google/zuma:device_google_zuma_license",
- ],
-}
-
-cc_prebuilt_library_shared {
- name: "android.hardware.gnss@2.1-impl-google",
- arch: {
- arm64: {
- srcs: ["bin/android.hardware.gnss@2.1-impl-google.so"],
- shared_libs: [
- "liblog",
- "libhidlbase",
- // "libhidltransport",
- "libutils",
- "android.hardware.gnss@1.0",
- "android.hardware.gnss@1.1",
- "android.hardware.gnss@2.0",
- "android.hardware.gnss@2.1",
- "android.hardware.gnss.measurement_corrections@1.0",
- "android.hardware.gnss.visibility_control@1.0",
- "android.hardware.gnss-V2-ndk",
- "libhardware",
- "libc++",
- "libc",
- "libm",
- "libdl",
- ],
- },
- },
- compile_multilib: "64",
- vendor: true,
- relative_install_path: "hw",
- strip: {
- none: true,
- },
- // Bypass because libhidltransport is deprecated
- check_elf_files: false,
-}
-
-cc_prebuilt_binary {
- name: "android.hardware.gnss@2.1-service-brcm",
- arch: {
- arm64: {
- srcs: ["bin/android.hardware.gnss@2.1-service-brcm"],
- shared_libs: [
- "liblog",
- "libutils",
- "libhardware",
- "android.hardware.gnss@1.0",
- "libhidlbase",
- // "libhidltransport",
- // "libhwbinder",
- "android.hardware.gnss@1.1",
- "android.hardware.gnss@2.0",
- "android.hardware.gnss@2.1",
- "android.hardware.gnss-V2-ndk",
- "libc++",
- "libc",
- "libm",
- "libdl",
- ],
- },
- },
- compile_multilib: "64",
- vendor: true,
- relative_install_path: "hw",
- strip: {
- none: true,
- },
- // Bypass because libhidltransport is deprecated
- // Bypass because libhwbinder is deprecated
- check_elf_files: false,
- vintf_fragments: ["android.hardware.gnss@2.1-service-brcm.xml"]
-}
-
-cc_prebuilt_library_shared {
- name: "flp.default",
- arch: {
- arm64: {
- srcs: ["bin/flp.default.so"],
- shared_libs: [
- "liblog",
- "libcutils",
- "libutils",
- "libc++",
- "libc",
- "libm",
- "libdl",
- ],
- },
- },
- compile_multilib: "64",
- vendor: true,
- relative_install_path: "hw",
- strip: {
- none: true,
- },
- // Bypass because soname mismatch
- check_elf_files: false,
-}
-
-cc_prebuilt_binary {
- name: "gpsd",
- arch: {
- arm64: {
- srcs: ["bin/gpsd"],
- shared_libs: [
- "liblog",
- "libutils",
- "libhardware_legacy",
- "libcutils",
- "libssl",
- "libcrypto",
- // "libsitril-gps",
- "android.frameworks.sensorservice@1.0",
- "libhidlbase",
- "libandroid_net",
- "libc++",
- "libc",
- "libm",
- "libdl",
- ],
- },
- },
- compile_multilib: "64",
- vendor: true,
- relative_install_path: "hw",
- strip: {
- none: true,
- },
- // Bypass because libsitril-gps is Android.mk module
- check_elf_files: false,
-}
-
-cc_prebuilt_library_shared {
- name: "gps.default",
- arch: {
- arm64: {
- srcs: ["bin/gps.default.so"],
- shared_libs: [
- "liblog",
- "libcutils",
- "libutils",
- "libc++",
- "libc",
- "libm",
- "libdl",
- ],
- },
- },
- compile_multilib: "64",
- vendor: true,
- relative_install_path: "hw",
- strip: {
- none: true,
- },
- // Bypass because soname mismatch
- check_elf_files: false,
-}
-
-cc_prebuilt_binary {
- name: "lhd",
- arch: {
- arm64: {
- srcs: ["bin/lhd"],
- shared_libs: [
- "liblog",
- "libutils",
- "libhardware_legacy",
- "libc++",
- "libc",
- "libm",
- "libz",
- "android.hardware.contexthub@1.0",
- "libhidlbase",
- "libdl",
- ],
- },
- },
- compile_multilib: "64",
- vendor: true,
- relative_install_path: "hw",
- strip: {
- none: true,
- },
-}
-
-cc_prebuilt_binary {
- name: "scd",
- arch: {
- arm64: {
- srcs: ["bin/scd"],
- shared_libs: [
- "liblog",
- "libutils",
- "libssl",
- "libcrypto",
- "libandroid_net",
- ],
- },
- },
- compile_multilib: "64",
- vendor: true,
- relative_install_path: "hw",
- strip: {
- none: true,
- },
-}
diff --git a/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml b/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml
deleted file mode 100644
index 97538b88..00000000
--- a/gnss/47765/android.hardware.gnss@2.1-service-brcm.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- android.hardware.gnss
- 2
- IGnss/default
-
-
diff --git a/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so b/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so
deleted file mode 100755
index 53f8a7d5..00000000
Binary files a/gnss/47765/bin/android.hardware.gnss@2.1-impl-google.so and /dev/null differ
diff --git a/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm b/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm
deleted file mode 100755
index 58df6c61..00000000
Binary files a/gnss/47765/bin/android.hardware.gnss@2.1-service-brcm and /dev/null differ
diff --git a/gnss/47765/bin/flp.default.so b/gnss/47765/bin/flp.default.so
deleted file mode 100755
index 5927607f..00000000
Binary files a/gnss/47765/bin/flp.default.so and /dev/null differ
diff --git a/gnss/47765/bin/gps.default.so b/gnss/47765/bin/gps.default.so
deleted file mode 100755
index 343e47ed..00000000
Binary files a/gnss/47765/bin/gps.default.so and /dev/null differ
diff --git a/gnss/47765/bin/gpsd b/gnss/47765/bin/gpsd
deleted file mode 100755
index c39f6aca..00000000
Binary files a/gnss/47765/bin/gpsd and /dev/null differ
diff --git a/gnss/47765/bin/lhd b/gnss/47765/bin/lhd
deleted file mode 100755
index 019a7032..00000000
Binary files a/gnss/47765/bin/lhd and /dev/null differ
diff --git a/gnss/47765/bin/scd b/gnss/47765/bin/scd
deleted file mode 100755
index 9dd12b56..00000000
Binary files a/gnss/47765/bin/scd and /dev/null differ
diff --git a/gnss/47765/firmware/SensorHub.patch b/gnss/47765/firmware/SensorHub.patch
deleted file mode 100644
index be98bf37..00000000
--- a/gnss/47765/firmware/SensorHub.patch
+++ /dev/null
@@ -1,7050 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gnss/Android.mk b/gnss/Android.mk
deleted file mode 100644
index 12f46b76..00000000
--- a/gnss/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2010 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.
-
-
-# We're moving the emulator-specific platform libs to
-# development.git/tools/emulator/. The following test is to ensure
-# smooth builds even if the tree contains both versions.
-#
-
-ifeq ($(BOARD_USES_EXYNOS_GNSS_DUMMY), true)
-
-LOCAL_PATH := $(call my-dir)
-
-# HAL module implemenation stored in
-# hw/..so
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware
-LOCAL_SRC_FILES := gps_dummy.c
-LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM)
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../NOTICE
-LOCAL_PROPRIETARY_MODULE := true
-
-include $(BUILD_SHARED_LIBRARY)
-
-endif
diff --git a/gnss/47765/config/gps.cer b/gnss/config/gps.cer
similarity index 100%
rename from gnss/47765/config/gps.cer
rename to gnss/config/gps.cer
diff --git a/gnss/47765/config/lhd.conf b/gnss/config/lhd.conf
similarity index 100%
rename from gnss/47765/config/lhd.conf
rename to gnss/config/lhd.conf
diff --git a/gnss/47765/config/lhd_user.conf b/gnss/config/lhd_user.conf
similarity index 100%
rename from gnss/47765/config/lhd_user.conf
rename to gnss/config/lhd_user.conf
diff --git a/gnss/47765/config/scd.conf b/gnss/config/scd.conf
similarity index 100%
rename from gnss/47765/config/scd.conf
rename to gnss/config/scd.conf
diff --git a/gnss/47765/config/scd_user.conf b/gnss/config/scd_user.conf
similarity index 100%
rename from gnss/47765/config/scd_user.conf
rename to gnss/config/scd_user.conf
diff --git a/gnss/device-gnss.mk b/gnss/device-gnss.mk
index ca40c778..6a991131 100644
--- a/gnss/device-gnss.mk
+++ b/gnss/device-gnss.mk
@@ -1,29 +1,13 @@
PRODUCT_COPY_FILES += \
- frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
- device/google/zuma/gnss/47765/config/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer \
- device/google/zuma/gnss/47765/firmware/SensorHub.patch:$(TARGET_COPY_OUT_VENDOR)/firmware/SensorHub.patch
+ device/google/zuma/gnss/config/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
PRODUCT_COPY_FILES += \
- device/google/zuma/gnss/47765/config/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
- device/google/zuma/gnss/47765/config/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
+ device/google/zuma/gnss/config/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
+ device/google/zuma/gnss/config/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
else
PRODUCT_COPY_FILES += \
- device/google/zuma/gnss/47765/config/lhd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
- device/google/zuma/gnss/47765/config/scd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
+ device/google/zuma/gnss/config/lhd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
+ device/google/zuma/gnss/config/scd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
endif
-PRODUCT_SOONG_NAMESPACES += \
- device/google/zuma/gnss/47765
-
-PRODUCT_PACKAGES += \
- android.hardware.gnss@2.1-impl-google \
- gps.default \
- flp.default \
- gpsd \
- lhd \
- scd \
- android.hardware.gnss@2.1-service-brcm
-
-PRODUCT_PACKAGES_DEBUG += \
- init.gps_log.rc
diff --git a/gnss/gps_dummy.c b/gnss/gps_dummy.c
deleted file mode 100644
index 9ccde1d3..00000000
--- a/gnss/gps_dummy.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-/* this implements a GPS hardware library for the Android emulator.
- * the following code should be built as a shared library that will be
- * placed into /system/lib/hw/gps.goldfish.so
- *
- * it will be loaded by the code in hardware/libhardware/hardware.c
- * which is itself called from android_location_GpsLocationProvider.cpp
- */
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define LOG_TAG "gps_dummy"
-#include
-//#include
-#include
-
-#define GPS_DEBUG 0
-
-#if GPS_DEBUG
-# define D(...) ALOGD(__VA_ARGS__)
-#else
-# define D(...) ((void)0)
-#endif
-
-static int
-dummy_gps_init(GpsCallbacks* callbacks)
-{
- return 0;
-}
-
-static void
-dummy_gps_cleanup(void)
-{
-}
-
-
-static int
-dummy_gps_start()
-{
- return 0;
-}
-
-
-static int
-dummy_gps_stop()
-{
- return 0;
-}
-
-
-static int
-dummy_gps_inject_time(GpsUtcTime __unused time,
- int64_t __unused timeReference,
- int __unused uncertainty)
-{
- return 0;
-}
-
-static int
-dummy_gps_inject_location(double __unused latitude,
- double __unused longitude,
- float __unused accuracy)
-{
- return 0;
-}
-
-static void
-dummy_gps_delete_aiding_data(GpsAidingData __unused flags)
-{
-}
-
-static int dummy_gps_set_position_mode(GpsPositionMode __unused mode,
- GpsPositionRecurrence __unused recurrence,
- uint32_t __unused min_interval,
- uint32_t __unused preferred_accuracy,
- uint32_t __unused preferred_time)
-{
- // FIXME - support fix_frequency
- return 0;
-}
-
-static const void*
-dummy_gps_get_extension(const char* __unused name)
-{
- // no extensions supported
- return NULL;
-}
-
-static const GpsInterface dummyGpsInterface = {
- sizeof(GpsInterface),
- dummy_gps_init,
- dummy_gps_start,
- dummy_gps_stop,
- dummy_gps_cleanup,
- dummy_gps_inject_time,
- dummy_gps_inject_location,
- dummy_gps_delete_aiding_data,
- dummy_gps_set_position_mode,
- dummy_gps_get_extension,
-};
-
-const GpsInterface* gps__get_gps_interface(struct gps_device_t* __unused dev)
-{
- return &dummyGpsInterface;
-}
-
-static int open_gps(const struct hw_module_t* module,
- char const* __unused name,
- struct hw_device_t** device)
-{
- struct gps_device_t *dev = (struct gps_device_t *)malloc(sizeof(struct gps_device_t));
- memset(dev, 0, sizeof(*dev));
-
- dev->common.tag = HARDWARE_DEVICE_TAG;
- dev->common.version = 0;
- dev->common.module = (struct hw_module_t*)module;
- dev->get_gps_interface = gps__get_gps_interface;
-
- *device = (struct hw_device_t*)dev;
- return 0;
-}
-
-static struct hw_module_methods_t gps_module_methods = {
- .open = open_gps
-};
-
-struct hw_module_t HAL_MODULE_INFO_SYM = {
- .tag = HARDWARE_MODULE_TAG,
- .version_major = 1,
- .version_minor = 0,
- .id = GPS_HARDWARE_MODULE_ID,
- .name = "Dummy GPS Module",
- .author = "The Android Open Source Project",
- .methods = &gps_module_methods,
-};