diff --git a/device.mk b/device.mk
index 2e6c9e7e..74a05a82 100644
--- a/device.mk
+++ b/device.mk
@@ -791,11 +791,21 @@ PRODUCT_PACKAGES += \
libopenvx-opencl
endif
-# GPS HAL
+# Location
ifeq (,$(filter tangor citron,$(subst _, ,$(TARGET_PRODUCT))))
-include device/google/gs101/gnss/device-gnss.mk
+include device/google/gs-common/gps/brcm/device.mk
+PRODUCT_COPY_FILES += \
+ device/google/gs101/location/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+ PRODUCT_COPY_FILES += \
+ device/google/gs101/location/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
+ device/google/gs101/location/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
+else
+ PRODUCT_COPY_FILES += \
+ device/google/gs101/location/lhd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
+ device/google/gs101/location/scd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
+endif
endif
-
# Trusty (KM, GK, Storage)
$(call inherit-product, system/core/trusty/trusty-storage.mk)
$(call inherit-product, system/core/trusty/trusty-base.mk)
diff --git a/gnss/47765/Android.bp b/gnss/47765/Android.bp
deleted file mode 100644
index 47ac1685..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/gs101:device_google_gs101_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: [
- "//device/google/gs101:device_google_gs101_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/config/gps.xml b/gnss/47765/config/gps.xml
deleted file mode 100644
index 8fb7c66e..00000000
--- a/gnss/47765/config/gps.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/gnss/47765/config/gps.xml.oriole b/gnss/47765/config/gps.xml.oriole
deleted file mode 100644
index d85fd169..00000000
--- a/gnss/47765/config/gps.xml.oriole
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/gnss/47765/config/gps.xml.raven b/gnss/47765/config/gps.xml.raven
deleted file mode 100644
index a095dbd1..00000000
--- a/gnss/47765/config/gps.xml.raven
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/gnss/47765/config/gps_user.xml b/gnss/47765/config/gps_user.xml
deleted file mode 100644
index 5efd5421..00000000
--- a/gnss/47765/config/gps_user.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/gnss/47765/config/gps_user.xml.oriole b/gnss/47765/config/gps_user.xml.oriole
deleted file mode 100644
index 2d503725..00000000
--- a/gnss/47765/config/gps_user.xml.oriole
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/gnss/47765/config/gps_user.xml.raven b/gnss/47765/config/gps_user.xml.raven
deleted file mode 100644
index b2fb2bd2..00000000
--- a/gnss/47765/config/gps_user.xml.raven
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
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/device-gnss.mk b/gnss/device-gnss.mk
deleted file mode 100644
index ee3a394e..00000000
--- a/gnss/device-gnss.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-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/gs101/gnss/47765/config/gps.cer:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.cer \
- device/google/gs101/gnss/47765/firmware/SensorHub.patch:$(TARGET_COPY_OUT_VENDOR)/firmware/SensorHub.patch
-
-ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
- PRODUCT_COPY_FILES += \
- device/google/gs101/gnss/47765/config/lhd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
- device/google/gs101/gnss/47765/config/scd.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
-else
- PRODUCT_COPY_FILES += \
- device/google/gs101/gnss/47765/config/lhd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/lhd.conf \
- device/google/gs101/gnss/47765/config/scd_user.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/scd.conf
-endif
-
-ifneq (,$(filter raven, $(subst _, ,$(TARGET_PRODUCT))))
- ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
- PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
- else
- PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps_user.xml.raven:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
- endif
-else ifneq (,$(filter oriole, $(subst _, ,$(TARGET_PRODUCT))))
- ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
- PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps.xml.oriole:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
- else
- PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps_user.xml.oriole:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
- endif
-else ifneq (,$(filter slider whitefin, $(subst _, ,$(TARGET_PRODUCT))))
- ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
- PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
- else
- PRODUCT_COPY_FILES += device/google/gs101/gnss/47765/config/gps_user.xml:$(TARGET_COPY_OUT_VENDOR)/etc/gnss/gps.xml
- endif
-endif
-
-PRODUCT_SOONG_NAMESPACES += \
- device/google/gs101/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,
-};
diff --git a/gnss/47765/config/gps.cer b/location/gps.cer
similarity index 100%
rename from gnss/47765/config/gps.cer
rename to location/gps.cer
diff --git a/gnss/47765/config/lhd.conf b/location/lhd.conf
similarity index 100%
rename from gnss/47765/config/lhd.conf
rename to location/lhd.conf
diff --git a/gnss/47765/config/lhd_user.conf b/location/lhd_user.conf
similarity index 100%
rename from gnss/47765/config/lhd_user.conf
rename to location/lhd_user.conf
diff --git a/gnss/47765/config/scd.conf b/location/scd.conf
similarity index 100%
rename from gnss/47765/config/scd.conf
rename to location/scd.conf
diff --git a/gnss/47765/config/scd_user.conf b/location/scd_user.conf
similarity index 100%
rename from gnss/47765/config/scd_user.conf
rename to location/scd_user.conf