Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ba717d1 authored by Yu Shan's avatar Yu Shan Committed by Android (Google) Code Review
Browse files

Merge "Backport LocCharacterization." into main

parents d947966a d448cb63
Loading
Loading
Loading
Loading
+106 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2023 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 file contains backported system property definitions and backported enums.

#pragma once

namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_0 {
namespace backportedproperty {

/**
 * Characterization of inputs used for computing location.
 *
 * This property must indicate what (if any) data and sensor inputs are considered by the system
 * when computing the vehicle's location that is shared with Android through the GNSS HAL.
 *
 * The value must return a collection of bit flags. The bit flags are defined in
 * LocationCharacterization. The value must also include exactly one of DEAD_RECKONED or
 * RAW_GNSS_ONLY among its collection of bit flags.
 *
 * When this property is not supported, it is assumed that no additional sensor inputs are fused
 * into the GNSS updates provided through the GNSS HAL. That is unless otherwise specified
 * through the GNSS HAL interfaces.
 *
 * @change_mode VehiclePropertyChangeMode.STATIC
 * @access VehiclePropertyAccess.READ
 */
constexpr int32_t LOCATION_CHARACTERIZATION = 0x31400C10;

/**
 * Used by LOCATION_CHARACTERIZATION to enumerate the supported bit flags.
 *
 * These flags are used to indicate to what transformations are performed on the
 * GNSS data before the location data is sent, so that location processing
 * algorithms can take into account prior fusion.
 *
 * This enum can be extended in future releases to include additional bit flags.
 */
enum class LocationCharacterization : int32_t {
    /**
     * Prior location samples have been used to refine the raw GNSS data (e.g. a
     * Kalman Filter).
     */
    PRIOR_LOCATIONS = 0x1,
    /**
     * Gyroscope data has been used to refine the raw GNSS data.
     */
    GYROSCOPE_FUSION = 0x2,
    /**
     * Accelerometer data has been used to refine the raw GNSS data.
     */
    ACCELEROMETER_FUSION = 0x4,
    /**
     * Compass data has been used to refine the raw GNSS data.
     */
    COMPASS_FUSION = 0x8,
    /**
     * Wheel speed has been used to refine the raw GNSS data.
     */
    WHEEL_SPEED_FUSION = 0x10,
    /**
     * Steering angle has been used to refine the raw GNSS data.
     */
    STEERING_ANGLE_FUSION = 0x20,
    /**
     * Car speed has been used to refine the raw GNSS data.
     */
    CAR_SPEED_FUSION = 0x40,
    /**
     * Some effort is made to dead-reckon location. In particular, this means that
     * relative changes in location have meaning when no GNSS satellite is
     * available.
     */
    DEAD_RECKONED = 0x80,
    /**
     * Location is based on GNSS satellite signals without sufficient fusion of
     * other sensors for complete dead reckoning. This flag should be set when
     * relative changes to location cannot be relied on when no GNSS satellite is
     * available.
     */
    RAW_GNSS_ONLY = 0x100,
};

}  // namespace backportedproperty
}  // namespace V2_0
}  // namespace vehicle
}  // namespace automotive
}  // namespace hardware
}  // namespace android
+142 −24
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
#ifndef android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_
#ifndef android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_
#define android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_
#define android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_


#include "BackportedPropertyHelper.h"
#include "PropertyUtils.h"
#include "PropertyUtils.h"


#include <map>
#include <map>
@@ -29,6 +30,9 @@ namespace V2_0 {


namespace impl {
namespace impl {


using ::android::hardware::automotive::vehicle::V2_0::backportedproperty::LOCATION_CHARACTERIZATION;
using ::android::hardware::automotive::vehicle::V2_0::backportedproperty::LocationCharacterization;

struct ConfigDeclaration {
struct ConfigDeclaration {
    VehiclePropConfig config;
    VehiclePropConfig config;


@@ -938,7 +942,10 @@ const ConfigDeclaration kVehicleProperties[]{
                                  (int)VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE,
                                  (int)VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE,
                                  VENDOR_EXTENSION_FLOAT_PROPERTY,
                                  VENDOR_EXTENSION_FLOAT_PROPERTY,
                                  (int)VehicleVendorPermission::PERMISSION_DEFAULT,
                                  (int)VehicleVendorPermission::PERMISSION_DEFAULT,
                                  (int)VehicleVendorPermission::PERMISSION_DEFAULT},
                                  (int)VehicleVendorPermission::PERMISSION_DEFAULT,
                                  LOCATION_CHARACTERIZATION,
                                  (int)VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO,
                                  (int)VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE},
                 },
                 },
         .initialValue = {.int32Values = {1}}},
         .initialValue = {.int32Values = {1}}},


@@ -1131,6 +1138,15 @@ const ConfigDeclaration kVehicleProperties[]{
                // GsrComplianceRequirementType::GSR_COMPLIANCE_REQUIRED_V1
                // GsrComplianceRequirementType::GSR_COMPLIANCE_REQUIRED_V1
                .initialValue = {.int32Values = {1}},
                .initialValue = {.int32Values = {1}},
        },
        },
        {
                .config =
                        {
                                .prop = LOCATION_CHARACTERIZATION,
                                .access = VehiclePropertyAccess::READ,
                                .changeMode = VehiclePropertyChangeMode::STATIC,
                        },
                .initialValue = {.int32Values = {toInt(LocationCharacterization::RAW_GNSS_ONLY)}},
        },
#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING
#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING
        // Vendor propetry for E2E ClusterHomeService testing.
        // Vendor propetry for E2E ClusterHomeService testing.
        {
        {
@@ -1195,29 +1211,131 @@ const ConfigDeclaration kVehicleProperties[]{
                        },
                        },
                // All supported property IDs. This list is checked by
                // All supported property IDs. This list is checked by
                // DefaultConfigSupportedPropertyIds_test.
                // DefaultConfigSupportedPropertyIds_test.
                .initialValue =
                .initialValue = {.int32Values = {291504388,
                        {.int32Values =
                                                 289472773,
                                 {291504388, 289472773, 291504390, 289472775, 289407240, 289407241,
                                                 291504390,
                                  289472780, 286261505, 286261506, 289407235, 289472779, 291504647,
                                                 289472775,
                                  289408517, 356518832, 356516106, 291504644, 291504649, 291504656,
                                                 289407240,
                                  291504901, 291504903, 287310600, 291504905, 287310602, 287310603,
                                                 289407241,
                                  291504908, 291504904, 392168201, 392168202, 289408514, 289408001,
                                                 289472780,
                                  287310850, 287310851, 287310853, 289408513, 289475088, 289475104,
                                                 286261505,
                                  289475120, 354419984, 320865540, 320865556, 354419975, 354419976,
                                                 286261506,
                                  354419986, 354419973, 354419974, 354419978, 354419977, 356517120,
                                                 289407235,
                                  356517121, 356582673, 356517139, 289408269, 356517131, 358614275,
                                                 289472779,
                                  291570965, 291505923, 289408270, 289408512, 287310855, 289408000,
                                                 291504647,
                                  289408008, 289408009, 289407747, 291504900, 568332561, 371198722,
                                                 289408517,
                                  373295872, 320867268, 322964416, 290521862, 287310858, 287310859,
                                                 356518832,
                                  289475072, 289475073, 289409539, 299896064, 299896065, 299896066,
                                                 356516106,
                                  299896067, 289410560, 289410561, 289410562, 289410563, 289410576,
                                                 291504644,
                                  289410577, 289410578, 289410579, 289476368, 299895808, 639631617,
                                                 291504649,
                                  627048706, 591397123, 554696964, 289410873, 289410874, 287313669,
                                                 291504656,
                                  299896583, 299896584, 299896585, 299896586, 299896587, 286265121,
                                                 291504901,
                                  286265122, 286265123, 290457094, 290459441, 299896626, 290459443,
                                                 291504903,
                                  289410868, 289476405, 299896630, 289410871, 292556600, 557853201,
                                                 287310600,
                                  559950353, 555756049, 554707473, 289410887, 557846324, 557911861,
                                                 291504905,
                                  568332086, 557846327, 560992056, 289476424}},
                                                 287310602,
                                                 287310603,
                                                 291504908,
                                                 291504904,
                                                 392168201,
                                                 392168202,
                                                 289408514,
                                                 289408001,
                                                 287310850,
                                                 287310851,
                                                 287310853,
                                                 289408513,
                                                 289475088,
                                                 289475104,
                                                 289475120,
                                                 354419984,
                                                 320865540,
                                                 320865556,
                                                 354419975,
                                                 354419976,
                                                 354419986,
                                                 354419973,
                                                 354419974,
                                                 354419978,
                                                 354419977,
                                                 356517120,
                                                 356517121,
                                                 356582673,
                                                 356517139,
                                                 289408269,
                                                 356517131,
                                                 358614275,
                                                 291570965,
                                                 291505923,
                                                 289408270,
                                                 289408512,
                                                 287310855,
                                                 289408000,
                                                 289408008,
                                                 289408009,
                                                 289407747,
                                                 291504900,
                                                 568332561,
                                                 371198722,
                                                 373295872,
                                                 320867268,
                                                 322964416,
                                                 290521862,
                                                 287310858,
                                                 287310859,
                                                 289475072,
                                                 289475073,
                                                 289409539,
                                                 299896064,
                                                 299896065,
                                                 299896066,
                                                 299896067,
                                                 289410560,
                                                 289410561,
                                                 289410562,
                                                 289410563,
                                                 289410576,
                                                 289410577,
                                                 289410578,
                                                 289410579,
                                                 289476368,
                                                 299895808,
                                                 639631617,
                                                 627048706,
                                                 591397123,
                                                 554696964,
                                                 289410873,
                                                 289410874,
                                                 287313669,
                                                 299896583,
                                                 299896584,
                                                 299896585,
                                                 299896586,
                                                 299896587,
                                                 286265121,
                                                 286265122,
                                                 286265123,
                                                 290457094,
                                                 290459441,
                                                 299896626,
                                                 290459443,
                                                 289410868,
                                                 289476405,
                                                 299896630,
                                                 289410871,
                                                 292556600,
                                                 557853201,
                                                 559950353,
                                                 555756049,
                                                 554707473,
                                                 289410887,
                                                 557846324,
                                                 557911861,
                                                 568332086,
                                                 557846327,
                                                 560992056,
                                                 289476424,
                                                 LOCATION_CHARACTERIZATION}},
        },
        },
#endif  // ENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS
#endif  // ENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS
};
};