Merge "Implement Context Hub HAL v4 for Cuttlefish" into main
diff --git a/audio/aidl/default/apex/com.android.hardware.audio/Android.bp b/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
index ee92512..8fa429a 100644
--- a/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
+++ b/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
@@ -48,4 +48,11 @@
"android.hardware.audio.service-aidl.xml",
"android.hardware.bluetooth.audio.xml",
],
+ required: [
+ "aidl_audio_set_configurations_bfbs",
+ "aidl_default_audio_set_configurations_json",
+ "aidl_audio_set_scenarios_bfbs",
+ "aidl_default_audio_set_scenarios_json",
+ "hfp_codec_capabilities_xml",
+ ],
}
diff --git a/automotive/TEST_MAPPING b/automotive/TEST_MAPPING
index 483a85f..2b2f6b0 100644
--- a/automotive/TEST_MAPPING
+++ b/automotive/TEST_MAPPING
@@ -64,7 +64,82 @@
"name": "CarServiceTelemetryTest"
},
{
- "name": "CarServiceUnitTest"
+ "name": "CarServiceCarUnitTest"
+ },
+ {
+ "name": "CarServiceWifiUnitTest"
+ },
+ {
+ "name": "CarServiceWatchdogUnitTest"
+ },
+ {
+ "name": "CarServiceVmsUnitTest"
+ },
+ {
+ "name": "CarServiceUtilUnitTest"
+ },
+ {
+ "name": "CarServiceUserUnitTest"
+ },
+ {
+ "name": "CarServiceTelemetryUnitTest"
+ },
+ {
+ "name": "CarServiceSystemUiUnitTest"
+ },
+ {
+ "name": "CarServiceSystemInterfaceUnitTest"
+ },
+ {
+ "name": "CarServiceStorageMonitoringUnitTest"
+ },
+ {
+ "name": "CarServiceStatsUnitTest"
+ },
+ {
+ "name": "CarServiceRemoteAccessUnitTest"
+ },
+ {
+ "name": "CarServicePropertyUnitTest"
+ },
+ {
+ "name": "CarServicePowerUnitTest"
+ },
+ {
+ "name": "CarServicePmUnitTest"
+ },
+ {
+ "name": "CarServiceOsUnitTest"
+ },
+ {
+ "name": "CarServiceOemUnitTest"
+ },
+ {
+ "name": "CarServiceOccupantConnectionUnitTest"
+ },
+ {
+ "name": "CarServiceHalUnitTest"
+ },
+ {
+ "name": "CarServiceGarageModeUnitTest"
+ },
+ {
+ "name": "CarServiceEvsUnitTest"
+ },
+ {
+ "name": "CarServiceClusterUnitTest"
+ },
+ {
+ "name": "CarServiceBluetoothUnitTest"
+ },
+ {
+ "name": "CarServiceAudioUnitTest"
+ },
+ {
+ "name": "CarServiceAmUnitTest"
+ },
+ {
+ "name": "CarServiceAdminUnitTest"
},
{
"name": "CarServiceVmsTest"
diff --git a/automotive/can/1.0/default/libnetdevice/Android.bp b/automotive/can/1.0/default/libnetdevice/Android.bp
index affbeee..4131a65 100644
--- a/automotive/can/1.0/default/libnetdevice/Android.bp
+++ b/automotive/can/1.0/default/libnetdevice/Android.bp
@@ -23,11 +23,20 @@
default_applicable_licenses: ["hardware_interfaces_license"],
}
-cc_library_static {
- name: "android.hardware.automotive.can@libnetdevice",
- defaults: ["android.hardware.automotive.can@defaults"],
+cc_defaults {
+ name: "libnetdevice-common",
host_supported: true,
vendor_available: true,
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION",
+ ],
+ shared_libs: [
+ "libbase",
+ "libutils",
+ ],
srcs: [
"can.cpp",
"common.cpp",
@@ -41,3 +50,14 @@
"libnl++",
],
}
+
+// TODO: migrate to "libnetdevice" and remove
+cc_library_static {
+ name: "android.hardware.automotive.can@libnetdevice",
+ defaults: ["libnetdevice-common"],
+}
+
+cc_library_static {
+ name: "libnetdevice",
+ defaults: ["libnetdevice-common"],
+}
diff --git a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h
index 75655d5..15ff491 100644
--- a/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h
+++ b/automotive/can/1.0/default/libnetdevice/include/libnetdevice/libnetdevice.h
@@ -128,7 +128,8 @@
* \param addr IPv4 address to set
* \return true in case of success, false otherwise
*/
-bool setAddr4(std::string_view ifname, std::string_view addr);
+bool setAddr4(std::string_view ifname, std::string_view addr,
+ std::optional<uint8_t> prefixlen = std::nullopt);
/**
* Add new IPv4 address to a given interface.
diff --git a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
index 1830633..9bb1a57 100644
--- a/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
+++ b/automotive/can/1.0/default/libnetdevice/libnetdevice.cpp
@@ -93,14 +93,31 @@
return addrn;
}
-bool setAddr4(std::string_view ifname, std::string_view addr) {
- auto ifr = ifreqs::fromName(ifname);
+static in_addr_t prefixLengthToIpv4Netmask(uint8_t prefixlen) {
+ in_addr_t zero = 0;
+ return htonl(~zero << (32 - prefixlen));
+}
- struct sockaddr_in* ifrAddr = reinterpret_cast<sockaddr_in*>(&ifr.ifr_addr);
+bool setAddr4(std::string_view ifname, std::string_view addr, std::optional<uint8_t> prefixlen) {
+ auto ifr = ifreqs::fromName(ifname);
+ auto ifrAddr = reinterpret_cast<sockaddr_in*>(&ifr.ifr_addr);
ifrAddr->sin_family = AF_INET;
ifrAddr->sin_addr.s_addr = inetAddr(addr);
+ if (!ifreqs::send(SIOCSIFADDR, ifr)) return false;
- return ifreqs::send(SIOCSIFADDR, ifr);
+ if (prefixlen.has_value()) {
+ if (*prefixlen < 0 || *prefixlen > 32) {
+ LOG(ERROR) << "Invalid prefix length: " << *prefixlen;
+ return false;
+ }
+ ifr = ifreqs::fromName(ifname);
+ auto ifrNetmask = reinterpret_cast<sockaddr_in*>(&ifr.ifr_netmask);
+ ifrNetmask->sin_family = AF_INET;
+ ifrNetmask->sin_addr.s_addr = prefixLengthToIpv4Netmask(*prefixlen);
+ if (!ifreqs::send(SIOCSIFNETMASK, ifr)) return false;
+ }
+
+ return true;
}
bool addAddr4(std::string_view ifname, std::string_view addr, uint8_t prefixlen) {
diff --git a/automotive/can/1.0/default/libnl++/Android.bp b/automotive/can/1.0/default/libnl++/Android.bp
index 5e3168a..ade4ae0 100644
--- a/automotive/can/1.0/default/libnl++/Android.bp
+++ b/automotive/can/1.0/default/libnl++/Android.bp
@@ -25,9 +25,18 @@
cc_library_static {
name: "libnl++",
- defaults: ["android.hardware.automotive.can@defaults"],
host_supported: true,
vendor_available: true,
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION",
+ ],
+ shared_libs: [
+ "libbase",
+ "libutils",
+ ],
srcs: [
"protocols/common/Empty.cpp",
"protocols/common/Error.cpp",
diff --git a/automotive/evs/aidl/Android.bp b/automotive/evs/aidl/Android.bp
index 75eb924..8983ae4 100644
--- a/automotive/evs/aidl/Android.bp
+++ b/automotive/evs/aidl/Android.bp
@@ -55,14 +55,14 @@
version: "1",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING
index d848774..56bc047 100644
--- a/automotive/vehicle/TEST_MAPPING
+++ b/automotive/vehicle/TEST_MAPPING
@@ -48,12 +48,7 @@
"name": "GRPCVehicleHardwareUnitTest"
},
{
- "name": "CarServiceUnitTest",
- "options" : [
- {
- "include-filter": "com.android.car.hal.fakevhal.FakeVehicleStubUnitTest"
- }
- ]
+ "name": "CarServiceHalUnitTest"
},
{
"name": "VehicleHalProtoMessageConverterTest"
diff --git a/bluetooth/ranging/OWNERS b/bluetooth/ranging/OWNERS
index 3d95624..88a91ea 100644
--- a/bluetooth/ranging/OWNERS
+++ b/bluetooth/ranging/OWNERS
@@ -3,3 +3,4 @@
include platform/packages/modules/Bluetooth:/OWNERS
chienyuanhuang@google.com
+steveliu@google.com
diff --git a/bluetooth/ranging/aidl/Android.bp b/bluetooth/ranging/aidl/Android.bp
index d0d1b90..4096669 100644
--- a/bluetooth/ranging/aidl/Android.bp
+++ b/bluetooth/ranging/aidl/Android.bp
@@ -42,6 +42,6 @@
imports: [],
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
index e8fefbe..03a7d24 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
@@ -38,6 +38,9 @@
int aclHandle;
int l2capCid;
int realTimeProcedureDataAttHandle;
+ /**
+ * @deprecated use the role in Config.aidl
+ */
android.hardware.bluetooth.ranging.Role role;
boolean localSupportsSoundingPhaseBasedRanging;
boolean remoteSupportsSoundingPhaseBaseRanging;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
new file mode 100644
index 0000000..70bed88
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@Backing(type="byte") @VintfStability
+enum Ch3cShapeType {
+ HAT_SHAPE = 0x00,
+ X_SHAPE = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
new file mode 100644
index 0000000..78bbbc1
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@Backing(type="byte") @VintfStability
+enum ChannelSelectionType {
+ ALOGRITHM_3B = 0x00,
+ ALOGRITHM_3C = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
index 8fc77ae..64aabec 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use ChannelSoundingProcedureData
+ */
@VintfStability
parcelable ChannelSoudingRawData {
int procedureCounter;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
new file mode 100644
index 0000000..ef4facc
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable ChannelSoundingProcedureData {
+ int procedureCounter;
+ int procedureSequence;
+ byte initiatorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE /* 127 */;
+ byte reflectorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE /* 127 */;
+ android.hardware.bluetooth.ranging.SubeventResultData[] initiatorSubeventResultData;
+ android.hardware.bluetooth.ranging.ProcedureAbortReason initiatorProcedureAbortReason;
+ android.hardware.bluetooth.ranging.SubeventResultData[] reflectorSubeventResultData;
+ android.hardware.bluetooth.ranging.ProcedureAbortReason reflectorProcedureAbortReason;
+ const byte SELECTED_TX_POWER_UNAVAILABLE = 0x7Fu8;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
index 172ac5e..b86994e 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use ChannelSoundingProcedureData
+ */
@VintfStability
parcelable ChannelSoundingSingleSideData {
@nullable android.hardware.bluetooth.ranging.StepTonePct[] stepTonePcts;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl
index 4d5ac21..c3d5d91 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use PctIQSample instead for V2 and above.
+ */
@VintfStability
parcelable ComplexNumber {
double real;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl
index c9ac991..bd07cd0 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl
@@ -38,4 +38,22 @@
android.hardware.bluetooth.ranging.SubModeType subModeType;
android.hardware.bluetooth.ranging.RttType rttType;
byte[10] channelMap;
+ int minMainModeSteps;
+ int maxMainModeSteps;
+ byte mainModeRepetition;
+ byte mode0Steps;
+ android.hardware.bluetooth.ranging.Role role;
+ android.hardware.bluetooth.ranging.CsSyncPhyType csSyncPhyType;
+ android.hardware.bluetooth.ranging.ChannelSelectionType channelSelectionType;
+ android.hardware.bluetooth.ranging.Ch3cShapeType ch3cShapeType;
+ byte ch3cJump;
+ int channelMapRepetition;
+ int tIp1TimeUs;
+ int tIp2TimeUs;
+ int tFcsTimeUs;
+ byte tPmTimeUs;
+ byte tSwTimeUsSupportedByLocal;
+ byte tSwTimeUsSupportedByRemote;
+ int bleConnInterval = BLE_CONN_INTERVAL_UNAVAILABLE /* 0 */;
+ const int BLE_CONN_INTERVAL_UNAVAILABLE = 0;
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
new file mode 100644
index 0000000..9611f13
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@Backing(type="byte") @VintfStability
+enum CsSyncPhyType {
+ NOT_VALID_PHY = 0x00,
+ LE_1M_PHY = 0x01,
+ LE_2M_PHY = 0x02,
+ LE_2M_2BT_PHY = 0x03,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
index 004a482..19b949f 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
@@ -36,6 +36,10 @@
interface IBluetoothChannelSounding {
@nullable android.hardware.bluetooth.ranging.VendorSpecificData[] getVendorSpecificData();
@nullable android.hardware.bluetooth.ranging.SessionType[] getSupportedSessionTypes();
+ /**
+ * @deprecated use getSupportedCsSecurityLevels() instead
+ */
android.hardware.bluetooth.ranging.CsSecurityLevel getMaxSupportedCsSecurityLevel();
@nullable android.hardware.bluetooth.ranging.IBluetoothChannelSoundingSession openSession(in android.hardware.bluetooth.ranging.BluetoothChannelSoundingParameters params, in android.hardware.bluetooth.ranging.IBluetoothChannelSoundingSessionCallback callback);
+ android.hardware.bluetooth.ranging.CsSecurityLevel[] getSupportedCsSecurityLevels();
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
index 9f691b4..99418bc 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
@@ -39,4 +39,8 @@
boolean isAbortedProcedureRequired();
void writeRawData(in android.hardware.bluetooth.ranging.ChannelSoudingRawData rawData);
void close(android.hardware.bluetooth.ranging.Reason reason);
+ void writeProcedureData(in android.hardware.bluetooth.ranging.ChannelSoundingProcedureData procedureData);
+ void updateChannelSoundingConfig(in android.hardware.bluetooth.ranging.Config conifg);
+ void updateProcedureEnableConfig(in android.hardware.bluetooth.ranging.ProcedureEnableConfig procedureEnableConfig);
+ void updateBleConnInterval(in int bleConnInterval);
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeData.aidl
new file mode 100644
index 0000000..6fdfffe
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeData.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+union ModeData {
+ android.hardware.bluetooth.ranging.ModeZeroData modeZeroData;
+ android.hardware.bluetooth.ranging.ModeOneData modeOneData;
+ android.hardware.bluetooth.ranging.ModeTwoData modeTwoData;
+ android.hardware.bluetooth.ranging.ModeThreeData modeThreeData;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeOneData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeOneData.aidl
new file mode 100644
index 0000000..698dd63
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeOneData.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable ModeOneData {
+ byte packetQuality;
+ android.hardware.bluetooth.ranging.Nadm packetNadm;
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE /* 127 */;
+ android.hardware.bluetooth.ranging.RttToaTodData rttToaTodData;
+ byte packetAntenna;
+ @nullable android.hardware.bluetooth.ranging.PctIQSample packetPct1;
+ @nullable android.hardware.bluetooth.ranging.PctIQSample packetPct2;
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF;
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeThreeData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeThreeData.aidl
new file mode 100644
index 0000000..1aa928b
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeThreeData.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable ModeThreeData {
+ android.hardware.bluetooth.ranging.ModeOneData modeOneData;
+ android.hardware.bluetooth.ranging.ModeTwoData modeTwoData;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeTwoData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeTwoData.aidl
new file mode 100644
index 0000000..c07b0c0
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeTwoData.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable ModeTwoData {
+ byte antennaPermutationIndex;
+ android.hardware.bluetooth.ranging.PctIQSample[] tonePctIQSamples;
+ byte[] toneQualityIndicators;
+ const int TONE_QUALITY_HIGH = 0x0;
+ const int TONE_QUALITY_MEDIUM = 0x1;
+ const int TONE_QUALITY_LOW = 0x2;
+ const int TONE_QUALITY_UNAVAILABLE = 0x3;
+ const int EXTENSION_SLOT_NONE = 0x0;
+ const int EXTENSION_SLOT_TONE_NOT_EXPECTED_TO_BE_PRESENT = 0x1;
+ const int EXTENSION_SLOT_TONE_EXPECTED_TO_BE_PRESENT = 0x2;
+ const int EXTENSION_SLOT_SHIFT = 4;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeZeroData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeZeroData.aidl
new file mode 100644
index 0000000..f94f3d1
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeZeroData.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable ModeZeroData {
+ byte packetQuality;
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE /* 127 */;
+ byte packetAntenna;
+ int initiatorMeasuredFreqOffset = MEASURED_FREQ_OFFSET_UNAVAILABLE /* -16384 */;
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF;
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+ const int MEASURED_FREQ_OFFSET_UNAVAILABLE = 0xFFFFC000;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/PctIQSample.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/PctIQSample.aidl
new file mode 100644
index 0000000..a15b579
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/PctIQSample.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable PctIQSample {
+ int iSample = SAMPLE_UNAVAILABLE /* -1 */;
+ int qSample = SAMPLE_UNAVAILABLE /* -1 */;
+ const int SAMPLE_UNAVAILABLE = 0xFFFFFFFF;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
new file mode 100644
index 0000000..ead7ceb
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@Backing(type="byte") @VintfStability
+enum ProcedureAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ FILTERED_CHANNEL_MAP_LESS_THAN_15 = 0x02,
+ CHANNEL_MAP_UPDATE_INSTANT_PASSED = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
new file mode 100644
index 0000000..11030bb
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable ProcedureEnableConfig {
+ byte toneAntennaConfigSelection;
+ int subeventLenUs;
+ byte subeventsPerEvent;
+ int subeventInterval;
+ int eventInterval;
+ int procedureInterval;
+ int procedureCount;
+ int maxProcedureLen;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl
index d092b80..ccac70b 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl
@@ -45,4 +45,6 @@
android.hardware.bluetooth.ranging.Nadm detectedAttackLevel;
double velocityMetersPerSecond;
@nullable byte[] vendorSpecificCsRangingResultsData;
+ android.hardware.bluetooth.ranging.RangingResultStatus rangingResultStatus;
+ long timestampNanos;
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResultStatus.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
new file mode 100644
index 0000000..cdf8ed2
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@Backing(type="byte") @VintfStability
+enum RangingResultStatus {
+ SUCCESS = 0x00,
+ FAIL_INITIATOR_ABORT = 0x01,
+ FAIL_REFLECTOR_ABORT = 0x02,
+ FAIL_BOTH_ABORT = 0x03,
+ FAIL_UNSPECIFIED = 0xFFu8,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RttToaTodData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RttToaTodData.aidl
new file mode 100644
index 0000000..496ccb2
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RttToaTodData.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+union RttToaTodData {
+ int toaTodInitiator = TOA_TOD_UNAVAILABLE /* -32768 */;
+ int todToaReflector = TOA_TOD_UNAVAILABLE /* -32768 */;
+ const int TOA_TOD_UNAVAILABLE = 0xFFFF8000;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepData.aidl
new file mode 100644
index 0000000..cdebc8e
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepData.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable StepData {
+ byte stepChannel;
+ android.hardware.bluetooth.ranging.ModeType stepMode;
+ android.hardware.bluetooth.ranging.ModeData stepModeData;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl
index 4125748..02d5413 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use ModeTwoData
+ */
@VintfStability
parcelable StepTonePct {
List<android.hardware.bluetooth.ranging.ComplexNumber> tonePcts;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
new file mode 100644
index 0000000..a3bb366
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@Backing(type="byte") @VintfStability
+enum SubeventAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ NO_CS_SYNC_RECEIVED = 0x02,
+ SCHEDULING_CONFLICTS_OR_LIMITED_RESOURCES = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventResultData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventResultData.aidl
new file mode 100644
index 0000000..3a7c393
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventResultData.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.bluetooth.ranging;
+@VintfStability
+parcelable SubeventResultData {
+ int startAclConnEventCounter;
+ int frequencyCompensation = FREQ_COMPENSATION_UNAVAILABLE /* -16384 */;
+ byte referencePowerLevelDbm;
+ byte numAntennaPaths;
+ android.hardware.bluetooth.ranging.SubeventAbortReason subeventAbortReason;
+ android.hardware.bluetooth.ranging.StepData[] stepData;
+ long timestampNanos;
+ const int FREQ_COMPENSATION_UNAVAILABLE = 0xFFFFC000;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
index 0cda847..fbc0165 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
@@ -44,6 +44,7 @@
int realTimeProcedureDataAttHandle;
/**
* Role of the local device.
+ * @deprecated use the role in Config.aidl
*/
Role role;
/**
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
new file mode 100644
index 0000000..558f68b
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * The selected shape to be rendered when Channel Selection Algorithm #3c is used
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum Ch3cShapeType {
+ /**
+ * Use Hat shape for user-specified channel sequence
+ */
+ HAT_SHAPE = 0x00,
+ /**
+ * Use X shape for user-specified channel sequence
+ */
+ X_SHAPE = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
new file mode 100644
index 0000000..6fd71aa
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * The channel selection algorithm for non-mode-0 steps
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum ChannelSelectionType {
+ /**
+ * Use Channel Selection Algorithm #3b for non-mode-0 CS steps
+ */
+ ALOGRITHM_3B = 0x00,
+ /**
+ * Use Channel Selection Algorithm #3c for non-mode-0 CS steps
+ */
+ ALOGRITHM_3C = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
index 78ce4f4..f06af0f 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
@@ -24,6 +24,7 @@
* See Channel Sounding CR_PR 3.1.10 and Channel Sounding HCI Updates CR_PR 3.1.23 for details.
*
* Specification: https://www.bluetooth.com/specifications/specs/channel-sounding-cr-pr/
+ * @deprecated use ChannelSoundingProcedureData
*/
@VintfStability
parcelable ChannelSoudingRawData {
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
new file mode 100644
index 0000000..2c51abe
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+import android.hardware.bluetooth.ranging.ProcedureAbortReason;
+import android.hardware.bluetooth.ranging.SubeventResultData;
+
+/**
+ * The measured data for a whole procedure, it includes all local and remote related data.
+ */
+@VintfStability
+parcelable ChannelSoundingProcedureData {
+ /**
+ * CS procedure count since completion of the Channel Sounding Security Start procedure
+ */
+ int procedureCounter;
+ /**
+ * The procequre sequence since completion of the Channel Sounding Procecedure Enable procedure,
+ * this is not defined by spec, BT
+ */
+ int procedureSequence;
+ const byte SELECTED_TX_POWER_UNAVAILABLE = 0x7Fu8;
+ /**
+ * Transmit power level used for CS procedure of initiator.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.43
+ * ** HCI_LE_CS_Procedure_Enable_Complete#selected_tx_power
+ * See BLUETOOTH Ranging Service Version 1.0 3.2.1.2
+ * ** Ranging Header#Selected TX power
+ * Range: -127 to 20
+ * Unit: dBm
+ * value: 0x7F - Transmit power level is unavailable
+ */
+ byte initiatorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE;
+ /**
+ * Transmit power level used for CS procedure of reflector.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.43
+ * ** HCI_LE_CS_Procedure_Enable_Complete#selected_tx_power
+ * See BLUETOOTH Ranging Service Version 1.0 3.2.1.2
+ * ** Ranging Header#Selected TX power
+ * Range: -127 to 20
+ * Unit: dBm
+ * value: 0x7F - Transmit power level is unavailable
+ */
+ byte reflectorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE;
+ /**
+ * The subevent result data of initiator
+ */
+ SubeventResultData[] initiatorSubeventResultData;
+ /**
+ * Indicates the procedure abort reason of the initiator
+ */
+ ProcedureAbortReason initiatorProcedureAbortReason;
+ /**
+ * The subevent result data of reflector
+ */
+ SubeventResultData[] reflectorSubeventResultData;
+ /**
+ * Indicates the procedure abort reason of the initiator
+ */
+ ProcedureAbortReason reflectorProcedureAbortReason;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
index 9c4b472..75f0b67 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
@@ -25,6 +25,7 @@
* See Channel Sounding CR_PR 3.1.10 and Channel Sounding HCI Updates CR_PR 3.1.23 for details.
*
* Specification: https://www.bluetooth.com/specifications/specs/channel-sounding-cr-pr/
+ * @deprecated use ChannelSoundingProcedureData
*/
@VintfStability
parcelable ChannelSoundingSingleSideData {
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl
index 5253d9f..8d59934 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl
@@ -16,6 +16,9 @@
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use PctIQSample instead for V2 and above.
+ */
@VintfStability
parcelable ComplexNumber {
double real;
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl
index 85ae4c1..95817b5 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl
@@ -16,10 +16,20 @@
package android.hardware.bluetooth.ranging;
+import android.hardware.bluetooth.ranging.Ch3cShapeType;
+import android.hardware.bluetooth.ranging.ChannelSelectionType;
+import android.hardware.bluetooth.ranging.CsSyncPhyType;
import android.hardware.bluetooth.ranging.ModeType;
+import android.hardware.bluetooth.ranging.Role;
import android.hardware.bluetooth.ranging.RttType;
import android.hardware.bluetooth.ranging.SubModeType;
+/**
+ * LE CS Config Complete data of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.8.137 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
@VintfStability
parcelable Config {
/**
@@ -42,4 +52,96 @@
* Channel n is disabled for CS procedure = 0
*/
byte[10] channelMap;
+ /**
+ * Minimum number of CS main mode steps to be executed before a submode step is executed
+ * Value: 0x02 to 0xFF
+ */
+ int minMainModeSteps;
+ /**
+ * Maximum number of CS main mode steps to be executed before a submode step is executed
+ * Value: 0x02 to 0xFF
+ */
+ int maxMainModeSteps;
+ /**
+ * Number of main mode steps taken from the end of the last CS subevent to be repeated at
+ * the beginning of the current CS subevent directly after the last mode-0 step of that event
+ * Value: 0x00 to 0x03
+ */
+ byte mainModeRepetition;
+ /**
+ * Number of CS mode-0 steps to be included at the beginning of each CS subevent
+ * Value: 0x00 to 0x03
+ */
+ byte mode0Steps;
+ /**
+ * The Channel Sounding role of the local device
+ */
+ Role role;
+ /**
+ * Indicates the PHY to be used for CS_SYNC exchanges during the CS procedure
+ */
+ CsSyncPhyType csSyncPhyType;
+ /**
+ * Indicates the Channel Selection Algorithm to be used during the CS procedure for non-mode-0
+ * steps
+ */
+ ChannelSelectionType channelSelectionType;
+ /**
+ * Indicates the selected shape
+ */
+ Ch3cShapeType ch3cShapeType;
+ /**
+ * Number of channels skipped in each rising and falling sequence
+ * Value: 0x02 to 0x08
+ */
+ byte ch3cJump;
+ /**
+ * The number of times the map represented by the Channel_Map field is to be cycled through
+ * for non-mode-0 steps within a CS procedure
+ * Value: 0x01 to 0xFF
+ */
+ int channelMapRepetition;
+ /**
+ * Interlude time in microseconds between the RTT packets
+ * Value: 0x0A, 0x14, 0x1E, 0x28, 0x32, 0x3C, 0x50, or 0x91
+ * unit: us
+ */
+ int tIp1TimeUs;
+ /**
+ * Interlude time in microseconds between the CS tones
+ * Value: 0x0A, 0x14, 0x1E, 0x28, 0x32, 0x3C, 0x50, or 0x91
+ * unit: us
+ */
+ int tIp2TimeUs;
+ /**
+ * Time in microseconds for frequency changes
+ * Value: 0x0F, 0x14, 0x1E, 0x28, 0x32, 0x3C, 0x50, 0x64, 0x78, or 0x96
+ * unit: us
+ */
+ int tFcsTimeUs;
+ /**
+ * Time in microseconds for the phase measurement period of the CS tones
+ * Value: 0x0A, 0x14, or 0x28
+ * unit: us
+ */
+ byte tPmTimeUs;
+ /**
+ * Time in microseconds for the antenna switch period of the CS tones supported by local device
+ * Value: 0, 1, 2, 4, 10 us
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.8.130
+ */
+ byte tSwTimeUsSupportedByLocal;
+ /**
+ * Time in microseconds for the antenna switch period of the CS tones supported by remote device
+ * Value: 0, 1, 2, 4, 10 us
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.39
+ */
+ byte tSwTimeUsSupportedByRemote;
+ const int BLE_CONN_INTERVAL_UNAVAILABLE = 0;
+ /**
+ * BLE event connection interval, a multiple of 1.25 ms in the range 7.5 ms to 4.0 s
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 6, Part B 4.5.1
+ * Unit: 1.25ms
+ */
+ int bleConnInterval = BLE_CONN_INTERVAL_UNAVAILABLE;
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
new file mode 100644
index 0000000..c7fe8a6
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * The PHY to be used for CS_SYNC exchanges during the CS procedure
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum CsSyncPhyType {
+ NOT_VALID_PHY = 0x00,
+ LE_1M_PHY = 0x01,
+ LE_2M_PHY = 0x02,
+ LE_2M_2BT_PHY = 0x03,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
index 45ec79f..283f588 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
@@ -52,6 +52,7 @@
*
* @return CsSecurityLevel that indicates max supported security level of CS for ranging
* algorithms.
+ * @deprecated use getSupportedCsSecurityLevels() instead
*/
CsSecurityLevel getMaxSupportedCsSecurityLevel();
@@ -63,4 +64,13 @@
@nullable IBluetoothChannelSoundingSession openSession(
in BluetoothChannelSoundingParameters params,
in IBluetoothChannelSoundingSessionCallback callback);
+
+ /**
+ * API to get all supported security level (0 to 4) of CS for ranging algorithms.
+ *
+ * See: BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 3, Part C 10.11.1
+ *
+ * @return All supported security level of CS for ranging algorithms.
+ */
+ CsSecurityLevel[] getSupportedCsSecurityLevels();
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
index 97b147e..b87024e 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
@@ -17,6 +17,9 @@
package android.hardware.bluetooth.ranging;
import android.hardware.bluetooth.ranging.ChannelSoudingRawData;
+import android.hardware.bluetooth.ranging.ChannelSoundingProcedureData;
+import android.hardware.bluetooth.ranging.Config;
+import android.hardware.bluetooth.ranging.ProcedureEnableConfig;
import android.hardware.bluetooth.ranging.Reason;
import android.hardware.bluetooth.ranging.ResultType;
import android.hardware.bluetooth.ranging.VendorSpecificData;
@@ -63,4 +66,28 @@
* Close the current session. Object is no longer useful after this method.
*/
void close(Reason reason);
+
+ /**
+ * API to provide raw ranging procedure data to the HAL. The HAL converts this data into
+ * meaningful ranging results using a proprietary algorithm and then calls back to the
+ * Bluetooth stack via BluetoothChannelSoundingSessionCallback.onResult().
+ */
+ void writeProcedureData(in ChannelSoundingProcedureData procedureData);
+
+ /**
+ * API to provide the latest CS config to the HAL.
+ */
+ void updateChannelSoundingConfig(in Config conifg);
+
+ /**
+ * API to provide the latest CS procedure enable complete information.
+ */
+ void updateProcedureEnableConfig(in ProcedureEnableConfig procedureEnableConfig);
+
+ /**
+ * API to provide the latest BLE event connection interval.
+ * BLE event connection interval, a multiple of 1.25 ms in the range 7.5 ms to 4.0 s
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 6, Part B 4.5.1
+ */
+ void updateBleConnInterval(in int bleConnInterval);
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeData.aidl
new file mode 100644
index 0000000..99199d2
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeData.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+import android.hardware.bluetooth.ranging.ModeOneData;
+import android.hardware.bluetooth.ranging.ModeThreeData;
+import android.hardware.bluetooth.ranging.ModeTwoData;
+import android.hardware.bluetooth.ranging.ModeZeroData;
+
+/**
+ * Mode specific data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+union ModeData {
+ ModeZeroData modeZeroData;
+ ModeOneData modeOneData;
+ ModeTwoData modeTwoData;
+ ModeThreeData modeThreeData;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeOneData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeOneData.aidl
new file mode 100644
index 0000000..51e8c70
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeOneData.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+import android.hardware.bluetooth.ranging.Nadm;
+import android.hardware.bluetooth.ranging.PctIQSample;
+import android.hardware.bluetooth.ranging.RttToaTodData;
+
+/**
+ * Mode 1 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeOneData {
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF; // bit 3 is reserved
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ /**
+ * bits 0 to 3:
+ * ** 0x0 = CS Access Address check is successful, and all bits match the expected sequence
+ * ** 0x1 = CS Access Address check contains one or more bit errors
+ * ** 0x2 = CS Access Address not found
+ * bits 4 to 7: Number of bit errors being reported on the payload with a random or sounding
+ * sequence. Value 0 may indicate zero bit errors or no report available.
+ * Value 15 may indicate 15 or more bit errors.
+ */
+ byte packetQuality;
+ /**
+ * Normalized Attack Detector Metric.
+ */
+ Nadm packetNadm;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+ /**
+ * Range: -127 to +20
+ * Unit: dBm
+ * Value: 0x7F - RSSI is not available
+ */
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE;
+ /**
+ * Time difference of the time of arrival and the time of depature of the CS packets.
+ * see RttToaTodData for details.
+ */
+ RttToaTodData rttToaTodData;
+ /**
+ * Antenna identifier used for the RTT packet
+ * Value: 0x01 to 0x04
+ */
+ byte packetAntenna;
+ /**
+ * Phase Correction Term 1 of the sounding sequence.
+ */
+ @nullable PctIQSample packetPct1;
+ /**
+ * Phase Correction Term 2 of the sounding sequence.
+ */
+ @nullable PctIQSample packetPct2;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeThreeData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeThreeData.aidl
new file mode 100644
index 0000000..a70d371
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeThreeData.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+import android.hardware.bluetooth.ranging.ModeOneData;
+import android.hardware.bluetooth.ranging.ModeTwoData;
+
+/**
+ * Mode 3 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeThreeData {
+ ModeOneData modeOneData;
+ ModeTwoData modeTwoData;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeTwoData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeTwoData.aidl
new file mode 100644
index 0000000..b360c90
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeTwoData.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+import android.hardware.bluetooth.ranging.PctIQSample;
+
+/**
+ * Mode 2 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeTwoData {
+ /**
+ * Antenna Permutation Index for the chosen Num_Antenna_Paths parameter used during the
+ * phase measurement stage of the CS step
+ */
+ byte antennaPermutationIndex;
+ /**
+ * The I and Q sample of Phase Correction Term for (Num_Antenna_Paths + 1) CS tone
+ * The order is the same as the BT core defined
+ */
+ PctIQSample[] tonePctIQSamples;
+
+ const int TONE_QUALITY_HIGH = 0x0;
+ const int TONE_QUALITY_MEDIUM = 0x1;
+ const int TONE_QUALITY_LOW = 0x2;
+ const int TONE_QUALITY_UNAVAILABLE = 0x3;
+ const int EXTENSION_SLOT_NONE = 0x0;
+ const int EXTENSION_SLOT_TONE_NOT_EXPECTED_TO_BE_PRESENT = 0x1;
+ const int EXTENSION_SLOT_TONE_EXPECTED_TO_BE_PRESENT = 0x2;
+ /**
+ * Shift amount for extension slot (bits 4 to 7).
+ */
+ const int EXTENSION_SLOT_SHIFT = 4;
+ /**
+ * Tone quality indicator for (Num_Antenna_Paths + 1) CS tone
+ * bits 0 to 3:
+ * ** 0x0 = Tone quality is high
+ * ** 0x1 = Tone quality is medium
+ * ** 0x2 = Tone quality is low
+ * ** 0x3 = Tone quality is unavailable
+ * bits 4 to 7:
+ * ** 0x0 = Not tone extension slot
+ * ** 0x1 = Tone extension slot; tone not expected to be present
+ * ** 0x2 = Tone extension slot; tone expected to be present
+ */
+ byte[] toneQualityIndicators;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeZeroData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeZeroData.aidl
new file mode 100644
index 0000000..6f326d1
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeZeroData.aidl
@@ -0,0 +1,63 @@
+/*
+ * Copyright 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * Mode 0 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeZeroData {
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF; // bit 3 is reserved
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ /**
+ * bits 0 to 3:
+ * ** 0x0 = CS Access Address check is successful, and all bits match the expected sequence
+ * ** 0x1 = CS Access Address check contains one or more bit errors
+ * ** 0x2 = CS Access Address not found
+ * bits 4 to 7: Number of bit errors being reported on the payload with a random or sounding
+ * sequence. Value 0 may indicate zero bit errors or no report available.
+ * Value 15 may indicate 15 or more bit errors.
+ */
+ byte packetQuality;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+ /**
+ * Range: -127 to +20
+ * Unit: dBm
+ * Value: 0x7F - RSSI is not available
+ */
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE;
+ /**
+ * Antenna identifier used for the RTT packet
+ * Value: 0x01 to 0x04
+ */
+ byte packetAntenna;
+ const int MEASURED_FREQ_OFFSET_UNAVAILABLE = 0xFFFFC000;
+ /**
+ * Measured frequency offset in units of 0.01 ppm (15-bit signed integer, it had been converted
+ * as int here.) for initiator, this should be ignored for relector.
+ * Range: -100 ppm (0x58F0) to +100 ppm (0x2710)
+ * Unit: 0.01 ppm
+ * Value: 0xFFFFC000 - Frequency offset is not available
+ */
+ int initiatorMeasuredFreqOffset = MEASURED_FREQ_OFFSET_UNAVAILABLE;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/PctIQSample.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/PctIQSample.aidl
new file mode 100644
index 0000000..81da870
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/PctIQSample.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * I and Q sample data of PCT.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ *
+ * BT core defines the I and Q sample as following, they were converted to 2 integers here.
+ * ** bits 0 to 11 are the I sample with type sint12
+ * ** bits 12 to 23 are the Q sample with type sint12
+ */
+@VintfStability
+parcelable PctIQSample {
+ const int SAMPLE_UNAVAILABLE = 0xFFFFFFFF;
+
+ int iSample = SAMPLE_UNAVAILABLE;
+ int qSample = SAMPLE_UNAVAILABLE;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
new file mode 100644
index 0000000..e8b520a
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * Procedure abort reason of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum ProcedureAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ FILTERED_CHANNEL_MAP_LESS_THAN_15 = 0x02,
+ CHANNEL_MAP_UPDATE_INSTANT_PASSED = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
new file mode 100644
index 0000000..b97f394
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * LE CS Procedure Enable Complete data
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.43 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ProcedureEnableConfig {
+ /**
+ * Antenna Configuration Index as described in [Vol 6] Part A, Section 5.3
+ * Value: 0x00 to 0x07
+ */
+ byte toneAntennaConfigSelection;
+ /**
+ * Duration for each CS subevent in microseconds
+ * Value: 1250 μs to 4 s
+ */
+ int subeventLenUs;
+ /**
+ * Number of CS subevents anchored off the same ACL connection event
+ * Value: 0x01 to 0x20
+ */
+ byte subeventsPerEvent;
+ /**
+ * Time between consecutive CS subevents anchored off the same ACL connection event.
+ * Unit: 0.625 ms
+ */
+ int subeventInterval;
+ /**
+ * Number of ACL connection events between consecutive CS event anchor points
+ */
+ int eventInterval;
+ /**
+ * Number of ACL connection events between consecutive CS procedure anchor points
+ */
+ int procedureInterval;
+ /**
+ * Number of CS procedures to be scheduled.
+ * Value: 0x0000 to 0xFFFF
+ * Value 0: CS procedures to continue until disabled
+ */
+ int procedureCount;
+ /**
+ * Maximum duration for each CS procedure
+ * Range: 0x0001 to 0xFFFF
+ * unit: 0.625 ms
+ * Time range: 0.625 ms to 40.959375 s
+ */
+ int maxProcedureLen;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl
index 65907dd..0962527 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl
@@ -17,6 +17,7 @@
package android.hardware.bluetooth.ranging;
import android.hardware.bluetooth.ranging.Nadm;
+import android.hardware.bluetooth.ranging.RangingResultStatus;
/**
* Generic structure to return the ranging result
@@ -90,4 +91,13 @@
* Parameter for vendors to place vendor-specific ranging results data.
*/
@nullable byte[] vendorSpecificCsRangingResultsData;
+ /**
+ * If the result is valid, for e.g. the result was gotten from an aborted procedure.
+ */
+ RangingResultStatus rangingResultStatus;
+ /**
+ * The timestamp of the first subevent with the measured procedure.
+ * see SubeventResultData#timestampNanos
+ */
+ long timestampNanos;
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResultStatus.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
new file mode 100644
index 0000000..b877af8
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+@VintfStability
+@Backing(type="byte")
+enum RangingResultStatus {
+ SUCCESS = 0x00,
+ /**
+ * The procedure of the initiator was aborted
+ */
+ FAIL_INITIATOR_ABORT = 0x01,
+ /**
+ * The procedure of the reflector was aborted
+ */
+ FAIL_REFLECTOR_ABORT = 0x02,
+ /**
+ * The procedure of both the initiator and the reflector were aborted
+ */
+ FAIL_BOTH_ABORT = 0x03,
+ FAIL_UNSPECIFIED = 0xFFu8,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RttToaTodData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RttToaTodData.aidl
new file mode 100644
index 0000000..c2a48e4
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RttToaTodData.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * The ToA/ToD data for the initator or reflector.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+union RttToaTodData {
+ const int TOA_TOD_UNAVAILABLE = 0xFFFF8000;
+ /**
+ * Time difference in units of 0.5 nanoseconds between the time of arrival and
+ * the time of departure of the CS packets at the initiator during a CS step
+ * (16-bit signed integer, it had been converted to 'int' here), where the known
+ * nominal offsets are excluded.
+ * value: 0xFFFF8000 (0x8000 as signed 16-bit) - Time difference is not available
+ */
+ int toaTodInitiator = TOA_TOD_UNAVAILABLE;
+ /**
+ * Time difference in units of 0.5 nanoseconds between the time of departure
+ * and the time of arrival of the CS packets at the reflector during a CS step
+ * (16-bit signed integer, it had been converted to 'int' here), where the known
+ * nominal offsets are excluded.
+ * value: 0xFFFF8000 (0x8000 as signed 16-bit) - Time difference is not available
+ */
+ int todToaReflector = TOA_TOD_UNAVAILABLE;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepData.aidl
new file mode 100644
index 0000000..4006415
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepData.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+import android.hardware.bluetooth.ranging.ModeData;
+import android.hardware.bluetooth.ranging.ModeType;
+
+/**
+ * The data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable StepData {
+ /**
+ * CS channel index
+ * Value: 0x00 to 0x4E
+ */
+ byte stepChannel;
+ ModeType stepMode;
+ ModeData stepModeData;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl
index 4650861..af25a11 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl
@@ -20,6 +20,7 @@
/**
* Tone PCT data with quality indicator from a mode-2 or mode-3 step.
+ * @deprecated use ModeTwoData
*/
@VintfStability
parcelable StepTonePct {
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
new file mode 100644
index 0000000..bef87e8
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+/**
+ * The subevent abort reason of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum SubeventAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ NO_CS_SYNC_RECEIVED = 0x02,
+ SCHEDULING_CONFLICTS_OR_LIMITED_RESOURCES = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventResultData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventResultData.aidl
new file mode 100644
index 0000000..102d217
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventResultData.aidl
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2024 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.
+ */
+
+package android.hardware.bluetooth.ranging;
+
+import android.hardware.bluetooth.ranging.StepData;
+import android.hardware.bluetooth.ranging.SubeventAbortReason;
+
+/**
+ * The subevent data within a CS procedure of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable SubeventResultData {
+ /**
+ * Starting ACL connection event counter for the results reported in the event
+ */
+ int startAclConnEventCounter;
+ const int FREQ_COMPENSATION_UNAVAILABLE = 0xFFFFC000;
+ /**
+ * Frequency compensation value in units of 0.01 ppm (15-bit signed integer, it had been
+ * converted as int here.)
+ * Unit: 0.01 ppm
+ * 0xFFFFC000 - Frequency compensation value is not available, or the role is not initiator
+ */
+ int frequencyCompensation = FREQ_COMPENSATION_UNAVAILABLE;
+ /**
+ * Reference power level
+ * Range: -127 to 20
+ * Unit: dBm
+ */
+ byte referencePowerLevelDbm;
+ /**
+ * 0x00 Ignored because phase measurement does not occur during the CS step
+ * 0x01 to 0x04 Number of antenna paths used during the phase measurement stage of the CS step
+ */
+ byte numAntennaPaths;
+ /**
+ * Indicates the abort reason
+ */
+ SubeventAbortReason subeventAbortReason;
+ /**
+ * The measured data for all steps
+ */
+ StepData[] stepData;
+ /**
+ * Timestamp when all subevent data are received by the host; Not defined by the spec.
+ * Using epoch time in nano seconds (e.g., 1697673127175).
+ */
+ long timestampNanos;
+}
diff --git a/bluetooth/ranging/aidl/default/Android.bp b/bluetooth/ranging/aidl/default/Android.bp
index 5072a43..0912a4f 100644
--- a/bluetooth/ranging/aidl/default/Android.bp
+++ b/bluetooth/ranging/aidl/default/Android.bp
@@ -14,7 +14,7 @@
"service.cpp",
],
shared_libs: [
- "android.hardware.bluetooth.ranging-V1-ndk",
+ "android.hardware.bluetooth.ranging-V2-ndk",
"libbase",
"libbinder_ndk",
"libhidlbase",
diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp
index 3807d4f..e2a8693 100644
--- a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp
+++ b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp
@@ -55,4 +55,11 @@
*_aidl_return = session;
return ::ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus BluetoothChannelSounding::getSupportedCsSecurityLevels(
+ std::vector<CsSecurityLevel>* _aidl_return) {
+ std::vector<CsSecurityLevel> supported_security_levels = {};
+ *_aidl_return = supported_security_levels;
+ return ::ndk::ScopedAStatus::ok();
+}
} // namespace aidl::android::hardware::bluetooth::ranging::impl
diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h
index d6b5c03..43232fa 100644
--- a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h
+++ b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h
@@ -47,6 +47,8 @@
const std::shared_ptr<IBluetoothChannelSoundingSessionCallback>&
in_callback,
std::shared_ptr<IBluetoothChannelSoundingSession>* _aidl_return) override;
+ ndk::ScopedAStatus getSupportedCsSecurityLevels(
+ std::vector<CsSecurityLevel>* _aidl_return) override;
};
} // namespace aidl::android::hardware::bluetooth::ranging::impl
diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp
index 6c58a07..bfdd5b6 100644
--- a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp
+++ b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp
@@ -52,4 +52,20 @@
callback_->onClose(in_reason);
return ::ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus BluetoothChannelSoundingSession::writeProcedureData(
+ const ChannelSoundingProcedureData& /*in_procedureData*/) {
+ return ::ndk::ScopedAStatus::ok();
+}
+ndk::ScopedAStatus BluetoothChannelSoundingSession::updateChannelSoundingConfig(
+ const Config& /*in_config*/) {
+ return ::ndk::ScopedAStatus::ok();
+}
+ndk::ScopedAStatus BluetoothChannelSoundingSession::updateProcedureEnableConfig(
+ const ProcedureEnableConfig& /*in_procedureEnableConfig*/) {
+ return ::ndk::ScopedAStatus::ok();
+}
+ndk::ScopedAStatus BluetoothChannelSoundingSession::updateBleConnInterval(
+ int /*in_bleConnInterval*/) {
+ return ::ndk::ScopedAStatus::ok();
+}
} // namespace aidl::android::hardware::bluetooth::ranging::impl
diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h
index 6703f7f..ae66c7c 100644
--- a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h
+++ b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h
@@ -22,6 +22,10 @@
namespace aidl::android::hardware::bluetooth::ranging::impl {
using ::aidl::android::hardware::bluetooth::ranging::ChannelSoudingRawData;
+using ::aidl::android::hardware::bluetooth::ranging::
+ ChannelSoundingProcedureData;
+using ::aidl::android::hardware::bluetooth::ranging::Config;
+using ::aidl::android::hardware::bluetooth::ranging::ProcedureEnableConfig;
using ::aidl::android::hardware::bluetooth::ranging::Reason;
using ::aidl::android::hardware::bluetooth::ranging::ResultType;
using ::aidl::android::hardware::bluetooth::ranging::VendorSpecificData;
@@ -42,6 +46,13 @@
ndk::ScopedAStatus writeRawData(
const ChannelSoudingRawData& in_rawData) override;
ndk::ScopedAStatus close(Reason in_reason) override;
+ ndk::ScopedAStatus writeProcedureData(
+ const ChannelSoundingProcedureData& in_procedureData) override;
+ ndk::ScopedAStatus updateChannelSoundingConfig(
+ const Config& in_config) override;
+ ndk::ScopedAStatus updateProcedureEnableConfig(
+ const ProcedureEnableConfig& in_procedureEnableConfig) override;
+ ndk::ScopedAStatus updateBleConnInterval(int in_bleConnInterval) override;
private:
std::shared_ptr<IBluetoothChannelSoundingSessionCallback> callback_;
diff --git a/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml b/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml
index fe3613d..87adf2c 100644
--- a/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml
+++ b/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.bluetooth.ranging</name>
- <version>1</version>
+ <version>2</version>
<fqname>IBluetoothChannelSounding/default</fqname>
</hal>
</manifest>
diff --git a/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h b/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h
index 184c16e..d92a409 100644
--- a/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h
+++ b/camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraDeviceSession.h
@@ -109,7 +109,7 @@
static const int kMaxProcessedStream = 2;
static const int kMaxStallStream = 1;
- static const uint32_t kMaxBytesPerPixel = 2;
+ static const uint32_t kMaxBytesPerPixel = 3;
class OutputThread : public android::Thread {
public:
diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp
index 48ae34e..291ed0d 100644
--- a/camera/device/aidl/Android.bp
+++ b/camera/device/aidl/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V1",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
@@ -54,7 +54,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
@@ -64,7 +64,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V3",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h
index 1c6ed06..ed84931 100644
--- a/camera/device/default/ExternalCameraDeviceSession.h
+++ b/camera/device/default/ExternalCameraDeviceSession.h
@@ -122,7 +122,7 @@
static const int kMaxProcessedStream = 2;
static const int kMaxStallStream = 1;
- static const uint32_t kMaxBytesPerPixel = 2;
+ static const uint32_t kMaxBytesPerPixel = 3;
class BufferRequestThread : public SimpleThread {
public:
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
index 138101b..5a35915 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSection.aidl
@@ -72,5 +72,6 @@
ANDROID_AUTOMOTIVE_LENS,
ANDROID_EXTENSION,
ANDROID_JPEGR,
+ ANDROID_SHARED_SESSION,
VENDOR_SECTION = 0x8000,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
index 85eee08..4cdca62 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
@@ -72,5 +72,6 @@
ANDROID_AUTOMOTIVE_LENS_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_AUTOMOTIVE_LENS << 16) /* 2031616 */,
ANDROID_EXTENSION_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_EXTENSION << 16) /* 2097152 */,
ANDROID_JPEGR_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_JPEGR << 16) /* 2162688 */,
+ ANDROID_SHARED_SESSION_START = (android.hardware.camera.metadata.CameraMetadataSection.ANDROID_SHARED_SESSION << 16) /* 2228224 */,
VENDOR_SECTION_START = (android.hardware.camera.metadata.CameraMetadataSection.VENDOR_SECTION << 16) /* -2147483648 */,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
index 73bcc12..2268dfd 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSection.aidl
@@ -63,5 +63,6 @@
ANDROID_AUTOMOTIVE_LENS,
ANDROID_EXTENSION,
ANDROID_JPEGR,
+ ANDROID_SHARED_SESSION,
VENDOR_SECTION = 0x8000,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
index 75e7915..3ec54d4 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataSectionStart.aidl
@@ -65,5 +65,6 @@
ANDROID_AUTOMOTIVE_LENS_START = CameraMetadataSection.ANDROID_AUTOMOTIVE_LENS << 16,
ANDROID_EXTENSION_START = CameraMetadataSection.ANDROID_EXTENSION << 16,
ANDROID_JPEGR_START = CameraMetadataSection.ANDROID_JPEGR << 16,
+ ANDROID_SHARED_SESSION_START = CameraMetadataSection.ANDROID_SHARED_SESSION << 16,
VENDOR_SECTION_START = CameraMetadataSection.VENDOR_SECTION << 16,
}
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index 9fa4df2..ec61eec 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -118,7 +118,8 @@
ScopedAStatus ret = mProvider->setCallback(cb);
ASSERT_TRUE(ret.isOk());
ret = mProvider->setCallback(nullptr);
- ASSERT_EQ(static_cast<int32_t>(Status::ILLEGAL_ARGUMENT), ret.getServiceSpecificError());
+ ASSERT_TRUE(static_cast<int32_t>(Status::ILLEGAL_ARGUMENT) == ret.getServiceSpecificError() ||
+ EX_NULL_POINTER == ret.getExceptionCode());
}
// Test if ICameraProvider::getCameraDeviceInterface returns Status::OK and non-null device
diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml
index c92557a..b3a3778 100644
--- a/compatibility_matrices/compatibility_matrix.202504.xml
+++ b/compatibility_matrices/compatibility_matrix.202504.xml
@@ -132,7 +132,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.bluetooth.ranging</name>
- <version>1</version>
+ <version>1-2</version>
<interface>
<name>IBluetoothChannelSounding</name>
<instance>default</instance>
@@ -225,7 +225,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.gnss</name>
- <version>2-4</version>
+ <version>2-5</version>
<interface>
<name>IGnss</name>
<instance>default</instance>
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index e7a31e6..eabb603 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -140,6 +140,7 @@
"android.hardware.camera.common@",
"android.hardware.common@",
"android.hardware.common.fmq@",
+ "android.hardware.gnss.gnss_assistance@",
"android.hardware.gnss.measurement_corrections@",
"android.hardware.gnss.visibility_control@",
"android.hardware.graphics.common@",
diff --git a/gnss/1.1/default/Android.bp b/gnss/1.1/default/Android.bp
index 697cb91..6c338bd 100644
--- a/gnss/1.1/default/Android.bp
+++ b/gnss/1.1/default/Android.bp
@@ -27,7 +27,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@1.0",
- "android.hardware.gnss-V4-ndk",
+ "android.hardware.gnss-V5-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/1.1/vts/functional/Android.bp b/gnss/1.1/vts/functional/Android.bp
index 65c752c..13984629 100644
--- a/gnss/1.1/vts/functional/Android.bp
+++ b/gnss/1.1/vts/functional/Android.bp
@@ -37,7 +37,7 @@
"android.hardware.gnss@1.1",
"android.hardware.gnss@2.0",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V4-cpp",
+ "android.hardware.gnss-V5-cpp",
],
shared_libs: [
"android.hardware.gnss.measurement_corrections@1.0",
diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp
index 35c2e37..6a4965b 100644
--- a/gnss/2.0/default/Android.bp
+++ b/gnss/2.0/default/Android.bp
@@ -50,7 +50,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@1.0",
- "android.hardware.gnss-V4-ndk",
+ "android.hardware.gnss-V5-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/2.0/vts/functional/Android.bp b/gnss/2.0/vts/functional/Android.bp
index 4ca3063..08d4cb3 100644
--- a/gnss/2.0/vts/functional/Android.bp
+++ b/gnss/2.0/vts/functional/Android.bp
@@ -40,7 +40,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@2.1",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V4-cpp",
+ "android.hardware.gnss-V5-cpp",
],
test_suites: [
"general-tests",
diff --git a/gnss/2.1/default/Android.bp b/gnss/2.1/default/Android.bp
index 1bb7512..a2e652e 100644
--- a/gnss/2.1/default/Android.bp
+++ b/gnss/2.1/default/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.gnss@1.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@2.0",
- "android.hardware.gnss-V4-ndk",
+ "android.hardware.gnss-V5-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/2.1/vts/functional/Android.bp b/gnss/2.1/vts/functional/Android.bp
index af66037..8a8fa93 100644
--- a/gnss/2.1/vts/functional/Android.bp
+++ b/gnss/2.1/vts/functional/Android.bp
@@ -41,7 +41,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@2.1",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V4-cpp",
+ "android.hardware.gnss-V5-cpp",
],
shared_libs: [
"libvintf",
diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp
index 47fc3af..6e159a1 100644
--- a/gnss/aidl/Android.bp
+++ b/gnss/aidl/Android.bp
@@ -30,6 +30,7 @@
"android/hardware/gnss/*.aidl",
"android/hardware/gnss/measurement_corrections/*.aidl",
"android/hardware/gnss/visibility_control/*.aidl",
+ "android/hardware/gnss/gnss_assistance/*.aidl",
],
stability: "vintf",
backend: {
@@ -56,6 +57,6 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
index d1aaf2c..fc74612 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
@@ -61,6 +61,7 @@
void stopSvStatus();
void startNmea();
void stopNmea();
+ android.hardware.gnss.gnss_assistance.IGnssAssistanceInterface getExtensionGnssAssistanceInterface();
const int ERROR_INVALID_ARGUMENT = 1;
const int ERROR_ALREADY_INIT = 2;
const int ERROR_GENERIC = 3;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
new file mode 100644
index 0000000..f42e1d0
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable BeidouAlmanac {
+ int beidouWeekNumber;
+ android.hardware.gnss.gnss_assistance.BeidouAlmanac.BeidouSatelliteAlmanac[] satelliteAlmanac;
+ @VintfStability
+ parcelable BeidouSatelliteAlmanac {
+ int prn;
+ int svHealth;
+ int toaSeconds;
+ double eccentricity;
+ double deltaI;
+ double omega;
+ double omega0;
+ double omegaDot;
+ double rootA;
+ double m0;
+ double af0;
+ double af1;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
new file mode 100644
index 0000000..91735a0
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable BeidouSatelliteEphemeris {
+ int prn;
+ android.hardware.gnss.gnss_assistance.BeidouSatelliteEphemeris.BeidouSatelliteClockModel satelliteClockModel;
+ android.hardware.gnss.gnss_assistance.KeplerianOrbitModel satelliteOrbitModel;
+ android.hardware.gnss.gnss_assistance.BeidouSatelliteEphemeris.BeidouSatelliteHealth satelliteHealth;
+ android.hardware.gnss.gnss_assistance.BeidouSatelliteEphemeris.BeidouSatelliteEphemerisTime satelliteEphemerisTime;
+ @VintfStability
+ parcelable BeidouSatelliteClockModel {
+ android.hardware.gnss.gnss_assistance.TimeOfClock timeOfClock;
+ double af0;
+ double af1;
+ double af2;
+ double tgd1;
+ double tgd2;
+ int aodc;
+ }
+ parcelable BeidouSatelliteHealth {
+ int satH1;
+ double svAccur;
+ }
+ parcelable BeidouSatelliteEphemerisTime {
+ int aode;
+ int weekNumber;
+ int toeSeconds;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
new file mode 100644
index 0000000..ffe2c3f
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GalileoAlmanac {
+ long issueDate;
+ int weekNumber;
+ int toa;
+ int iod;
+ android.hardware.gnss.gnss_assistance.GalileoAlmanac.GalileoSatelliteAlmanac[] satelliteAlmanac;
+ @VintfStability
+ parcelable GalileoSatelliteAlmanac {
+ int svId;
+ android.hardware.gnss.gnss_assistance.GalileoAlmanac.GalileoAlmanacSvHealth svHealth;
+ double eccentricity;
+ double deltaI;
+ double omega;
+ double omega0;
+ double omegaDot;
+ double rootA;
+ double m0;
+ double af0;
+ double af1;
+ int weekNumber;
+ int toa;
+ int iod;
+ }
+ @VintfStability
+ parcelable GalileoAlmanacSvHealth {
+ int fNavE5a;
+ int iNavE5b;
+ int iNavE1b;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl
new file mode 100644
index 0000000..6d8040b
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GalileoIonosphericModel {
+ double ai0;
+ double ai1;
+ double ai2;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
new file mode 100644
index 0000000..17d48b1
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GalileoSatelliteEphemeris {
+ int satelliteCodeNumber;
+ android.hardware.gnss.gnss_assistance.GalileoSatelliteEphemeris.GalileoSatelliteClockModel[] satelliteClockModel;
+ android.hardware.gnss.gnss_assistance.KeplerianOrbitModel satelliteOrbitModel;
+ android.hardware.gnss.gnss_assistance.GalileoSatelliteEphemeris.GalileoSvHealth svHealth;
+ android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime satelliteEphemerisTime;
+ @VintfStability
+ parcelable GalileoSatelliteClockModel {
+ android.hardware.gnss.gnss_assistance.TimeOfClock toc;
+ double af0;
+ double af1;
+ double af2;
+ double bgdSeconds;
+ double sisaMeters;
+ android.hardware.gnss.gnss_assistance.GalileoSatelliteEphemeris.GalileoSatelliteClockModel.SatelliteClockType satelliteClockType;
+ @Backing(type="int") @VintfStability
+ enum SatelliteClockType {
+ UNDEFINED = 0,
+ GALILEO_FNAV_CLOCK = 1,
+ GALILEO_INAV_CLOCK = 2,
+ }
+ }
+ @VintfStability
+ parcelable GalileoSvHealth {
+ int dataValidityStatusE1b;
+ int signalHealthStatusE1b;
+ int dataValidityStatusE5a;
+ int signalHealthStatusE5a;
+ int dataValidityStatusE5b;
+ int signalHealthStatusE5b;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
new file mode 100644
index 0000000..a545166
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
@@ -0,0 +1,39 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GlonassAlmanac {
+ long issueDate;
+ android.hardware.gnss.gnss_assistance.GlonassAlmanac.GlonassSatelliteAlmanac[] satelliteAlmanac;
+ @VintfStability
+ parcelable GlonassSatelliteAlmanac {
+ int slotNumber;
+ int svHealth;
+ int frequencyChannel;
+ double tau;
+ double tLambda;
+ double lambda;
+ double deltaI;
+ double deltaT;
+ double deltaTDot;
+ double eccentricity;
+ double omega;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
new file mode 100644
index 0000000..fbab59c
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GlonassSatelliteEphemeris {
+ int slotNumber;
+ int svHealth;
+ double frameTimeSeconds;
+ int ageInDays;
+ android.hardware.gnss.gnss_assistance.GlonassSatelliteEphemeris.GlonassSatelliteClockModel satelliteClockModel;
+ android.hardware.gnss.gnss_assistance.GlonassSatelliteEphemeris.GlonassSatelliteOrbitModel satelliteOrbitModel;
+ @VintfStability
+ parcelable GlonassSatelliteClockModel {
+ android.hardware.gnss.gnss_assistance.TimeOfClock timeOfClock;
+ double clockBias;
+ double freqBias;
+ int freqNumber;
+ }
+ @VintfStability
+ parcelable GlonassSatelliteOrbitModel {
+ double x;
+ double xDot;
+ double xAccel;
+ double y;
+ double yDot;
+ double yAccel;
+ double z;
+ double zDot;
+ double zAccel;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
new file mode 100644
index 0000000..98383ac
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GnssAssistance {
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GpsAssistance gpsAssistance;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GlonassAssistance gloAssistance;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GalileoAssistance galAssistance;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.BeidouAssistance bdsAssistance;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.QzssAssistance qzsAssistance;
+ @VintfStability
+ parcelable GnssSatelliteCorrections {
+ int svid;
+ android.hardware.gnss.gnss_assistance.IonosphericCorrection[] inonosphericCorrections;
+ }
+ @VintfStability
+ parcelable GpsAssistance {
+ android.hardware.gnss.gnss_assistance.GpsAlmanac almanac;
+ android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel ionosphericModel;
+ android.hardware.gnss.gnss_assistance.UtcModel utcModel;
+ android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
+ android.hardware.gnss.gnss_assistance.TimeModel[] timeModels;
+ android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris[] satelliteEphemeris;
+ android.hardware.gnss.gnss_assistance.RealTimeIntegrityModel[] realTimeIntegrityModels;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GnssSatelliteCorrections[] satelliteCorrections;
+ }
+ @VintfStability
+ parcelable GalileoAssistance {
+ android.hardware.gnss.gnss_assistance.GalileoAlmanac almanac;
+ android.hardware.gnss.gnss_assistance.GalileoIonosphericModel ionosphericModel;
+ android.hardware.gnss.gnss_assistance.UtcModel utcModel;
+ android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
+ android.hardware.gnss.gnss_assistance.TimeModel[] timeModels;
+ android.hardware.gnss.gnss_assistance.GalileoSatelliteEphemeris[] satelliteEphemeris;
+ android.hardware.gnss.gnss_assistance.RealTimeIntegrityModel[] realTimeIntegrityModels;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GnssSatelliteCorrections[] satelliteCorrections;
+ }
+ @VintfStability
+ parcelable GlonassAssistance {
+ android.hardware.gnss.gnss_assistance.GlonassAlmanac almanac;
+ android.hardware.gnss.gnss_assistance.UtcModel utcModel;
+ android.hardware.gnss.gnss_assistance.TimeModel[] timeModels;
+ android.hardware.gnss.gnss_assistance.GlonassSatelliteEphemeris[] satelliteEphemeris;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GnssSatelliteCorrections[] satelliteCorrections;
+ }
+ @VintfStability
+ parcelable QzssAssistance {
+ android.hardware.gnss.gnss_assistance.QzssAlmanac almanac;
+ android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel ionosphericModel;
+ android.hardware.gnss.gnss_assistance.UtcModel utcModel;
+ android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
+ android.hardware.gnss.gnss_assistance.TimeModel[] timeModels;
+ android.hardware.gnss.gnss_assistance.QzssSatelliteEphemeris[] satelliteEphemeris;
+ android.hardware.gnss.gnss_assistance.RealTimeIntegrityModel[] realTimeIntegrityModels;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GnssSatelliteCorrections[] satelliteCorrections;
+ }
+ @VintfStability
+ parcelable BeidouAssistance {
+ android.hardware.gnss.gnss_assistance.BeidouAlmanac almanac;
+ android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel ionosphericModel;
+ android.hardware.gnss.gnss_assistance.UtcModel utcModel;
+ android.hardware.gnss.gnss_assistance.LeapSecondsModel leapSecondsModel;
+ android.hardware.gnss.gnss_assistance.TimeModel[] timeModels;
+ android.hardware.gnss.gnss_assistance.BeidouSatelliteEphemeris[] satelliteEphemeris;
+ android.hardware.gnss.gnss_assistance.RealTimeIntegrityModel[] realTimeIntegrityModels;
+ android.hardware.gnss.gnss_assistance.GnssAssistance.GnssSatelliteCorrections[] satelliteCorrections;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssCorrectionComponent.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssCorrectionComponent.aidl
new file mode 100644
index 0000000..2d43bb3
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GnssCorrectionComponent.aidl
@@ -0,0 +1,37 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GnssCorrectionComponent {
+ String sourceKey;
+ android.hardware.gnss.gnss_assistance.GnssCorrectionComponent.GnssInterval validityInterval;
+ android.hardware.gnss.gnss_assistance.GnssCorrectionComponent.PseudorangeCorrection pseudorangeCorrection;
+ @VintfStability
+ parcelable GnssInterval {
+ long startMillisSinceGpsEpoch;
+ long endMillisSinceGpsEpoch;
+ }
+ @VintfStability
+ parcelable PseudorangeCorrection {
+ double correctionMeters;
+ double correctionUncertaintyMeters;
+ double correctionRateMetersPerSecond;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
new file mode 100644
index 0000000..60e0b96
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GpsAlmanac {
+ int gpsWeekNumber;
+ int secondsOfGpsWeek;
+ android.hardware.gnss.gnss_assistance.GpsAlmanac.GpsSatelliteAlmanac[] satelliteAlmanac;
+ @VintfStability
+ parcelable GpsSatelliteAlmanac {
+ int prn;
+ int svHealth;
+ double eccentricity;
+ double inclination;
+ double omega;
+ double omega0;
+ double omegaDot;
+ double rootA;
+ double m0;
+ double af0;
+ double af1;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
new file mode 100644
index 0000000..1e80516
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable GpsSatelliteEphemeris {
+ int prn;
+ android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsL2Params gpsL2Params;
+ android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsSatelliteClockModel satelliteClockModel;
+ android.hardware.gnss.gnss_assistance.KeplerianOrbitModel satelliteOrbitModel;
+ android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsSatelliteHealth satelliteHealth;
+ android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime satelliteEphemerisTime;
+ @VintfStability
+ parcelable GpsL2Params {
+ int l2Code;
+ int l2Flag;
+ }
+ @VintfStability
+ parcelable GpsSatelliteClockModel {
+ android.hardware.gnss.gnss_assistance.TimeOfClock timeOfClock;
+ double af0;
+ double af1;
+ double af2;
+ double tgd;
+ int iodc;
+ }
+ @VintfStability
+ parcelable GpsSatelliteHealth {
+ int svHealth;
+ double svAccur;
+ double fitInt;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IGnssAssistanceCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IGnssAssistanceCallback.aidl
new file mode 100644
index 0000000..602a249
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IGnssAssistanceCallback.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+interface IGnssAssistanceCallback {
+ void injectRequestCb();
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IGnssAssistanceInterface.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IGnssAssistanceInterface.aidl
new file mode 100644
index 0000000..4dd5cf6
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IGnssAssistanceInterface.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+interface IGnssAssistanceInterface {
+ void injectGnssAssistance(in android.hardware.gnss.gnss_assistance.GnssAssistance gnssAssistance);
+ void setCallback(in android.hardware.gnss.gnss_assistance.IGnssAssistanceCallback callback);
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IonosphericCorrection.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IonosphericCorrection.aidl
new file mode 100644
index 0000000..e02d97f
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/IonosphericCorrection.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable IonosphericCorrection {
+ long carrierFrequencyHz;
+ android.hardware.gnss.gnss_assistance.GnssCorrectionComponent ionosphericCorrection;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl
new file mode 100644
index 0000000..835c6ec
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable KeplerianOrbitModel {
+ double rootA;
+ double eccentricity;
+ double i0;
+ double iDot;
+ double omega;
+ double omega0;
+ double omegaDot;
+ double m0;
+ double deltaN;
+ android.hardware.gnss.gnss_assistance.KeplerianOrbitModel.SecondOrderHarmonicPerturbation secondOrderHarmonicPerturbation;
+ @VintfStability
+ parcelable SecondOrderHarmonicPerturbation {
+ double cic;
+ double cis;
+ double crc;
+ double crs;
+ double cuc;
+ double cus;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl
new file mode 100644
index 0000000..5a0caa5
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable KlobucharIonosphericModel {
+ double alpha0;
+ double alpha1;
+ double alpha2;
+ double alpha3;
+ double beta0;
+ double beta1;
+ double beta2;
+ double beta3;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl
new file mode 100644
index 0000000..bc38b9b
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable LeapSecondsModel {
+ int leapSeconds;
+ int leapSecondsFuture;
+ int weekNumberLeapSecondsFuture;
+ int dayNumberLeapSecondsFuture;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
new file mode 100644
index 0000000..6c645a6
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable QzssAlmanac {
+ int qzssWeekNumber;
+ int secondsOfQzssWeek;
+ android.hardware.gnss.gnss_assistance.QzssAlmanac.QzssSatelliteAlmanac[] satelliteAlmanac;
+ @VintfStability
+ parcelable QzssSatelliteAlmanac {
+ int prn;
+ int svHealth;
+ double eccentricity;
+ double inclination;
+ double omega;
+ double omega0;
+ double omegaDot;
+ double rootA;
+ double m0;
+ double af0;
+ double af1;
+ }
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl
new file mode 100644
index 0000000..5bb1c97
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable QzssSatelliteEphemeris {
+ int prn;
+ android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsL2Params gpsL2Params;
+ android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsSatelliteClockModel satelliteClockModel;
+ android.hardware.gnss.gnss_assistance.KeplerianOrbitModel satelliteOrbitModel;
+ android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsSatelliteHealth satelliteHealth;
+ android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime satelliteEphemerisTime;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/RealTimeIntegrityModel.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/RealTimeIntegrityModel.aidl
new file mode 100644
index 0000000..c7379e1
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/RealTimeIntegrityModel.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable RealTimeIntegrityModel {
+ int svid;
+ boolean usable;
+ long publishDateSeconds;
+ long startDateSeconds;
+ long endDateSeconds;
+ String advisoryType;
+ String advisoryNumber;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl
new file mode 100644
index 0000000..1e5cd02
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable SatelliteEphemerisTime {
+ int iode;
+ int weekNumber;
+ int toeSeconds;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeModel.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeModel.aidl
new file mode 100644
index 0000000..e1ce890
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeModel.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable TimeModel {
+ android.hardware.gnss.GnssConstellationType toGnss;
+ double a0;
+ double a1;
+ int timeOfWeek;
+ int weekNumber;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
new file mode 100644
index 0000000..ae709d4
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable TimeOfClock {
+ int year;
+ int month;
+ int day;
+ int hour;
+ int minute;
+ int seconds;
+}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/UtcModel.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/UtcModel.aidl
new file mode 100644
index 0000000..df754bc
--- /dev/null
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/gnss_assistance/UtcModel.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.gnss.gnss_assistance;
+/* @hide */
+@VintfStability
+parcelable UtcModel {
+ double a0;
+ double a1;
+ int timeOfWeek;
+ int weekNumber;
+}
diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl
index aaafe7f..5fc8a48 100644
--- a/gnss/aidl/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl
@@ -29,6 +29,7 @@
import android.hardware.gnss.IGnssNavigationMessageInterface;
import android.hardware.gnss.IGnssPowerIndication;
import android.hardware.gnss.IGnssPsds;
+import android.hardware.gnss.gnss_assistance.IGnssAssistanceInterface;
import android.hardware.gnss.measurement_corrections.IMeasurementCorrectionsInterface;
import android.hardware.gnss.visibility_control.IGnssVisibilityControl;
@@ -343,4 +344,11 @@
* Stops the NMEA output stream.
*/
void stopNmea();
+
+ /**
+ * This method returns the IGnssAssistanceInterface.
+ *
+ * @return Handle to the IGnssAssistanceInterface.
+ */
+ IGnssAssistanceInterface getExtensionGnssAssistanceInterface();
}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
new file mode 100644
index 0000000..1df485e
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouAlmanac.aidl
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains Beidou almanac data.
+ * This is defined in BDS-SIS-ICD-B1I-3.0, section 5.2.4.15.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable BeidouAlmanac {
+ /**
+ * Contains Beidou satellite almanac data.
+ * This is defined in BDS-SIS-ICD-B1I-3.0, section 5.2.4.15.
+ */
+ @VintfStability
+ parcelable BeidouSatelliteAlmanac {
+ /** The PRN number of the Beidou satellite. */
+ int prn;
+
+ /** Satellite health (0=healthy, 1=unhealthy). */
+ int svHealth;
+
+ /** Almanac reference time in seconds. */
+ int toaSeconds;
+
+ /** Eccentricity. */
+ double eccentricity;
+
+ /**
+ * Correction of inclination angle relative to reference value at reference time
+ * in semi-circles.
+ */
+ double deltaI;
+
+ /** Argument of perigee in semi-circles. */
+ double omega;
+
+ /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
+ double omega0;
+
+ /** Rate of right ascension in semi-circles per second. */
+ double omegaDot;
+
+ /** Square root of semi-major axis in square root of meters. */
+ double rootA;
+
+ /** Mean anomaly at reference time in semi-circles. */
+ double m0;
+
+ /** Satellite clock time bias correction coefficient in seconds. */
+ double af0;
+
+ /** Satellite clock time drift correction coefficient in seconds per second. */
+ double af1;
+ }
+
+ /** Beidou week number. */
+ int beidouWeekNumber;
+
+ /** Array of BeidouSatelliteAlmanac. */
+ BeidouSatelliteAlmanac[] satelliteAlmanac;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
new file mode 100644
index 0000000..025f402
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/BeidouSatelliteEphemeris.aidl
@@ -0,0 +1,94 @@
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
+import android.hardware.gnss.gnss_assistance.TimeOfClock;
+
+/**
+ * Contains ephemeris parameters specific to Beidou satellites.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable BeidouSatelliteEphemeris {
+ /*
+ * Contains the set of parameters needed for Beidou satellite clock
+ * correction.
+ * This is defined in BDS-SIS-ICD-B1I-3.0, section 5.2.4.9, 5.2.4.10.
+ */
+ @VintfStability
+ parcelable BeidouSatelliteClockModel {
+ /** Time of the clock. */
+ TimeOfClock timeOfClock;
+
+ /** SV clock bias in seconds. */
+ double af0;
+
+ /** SV clock drift in seconds per second. */
+ double af1;
+
+ /** Clock drift rate in seconds per second squared. */
+ double af2;
+
+ /** Group delay differential 1 B1/B3 in seconds. */
+ double tgd1;
+
+ /** Group delay differential 2 B2/B3 in seconds. */
+ double tgd2;
+
+ /**
+ * Age of Data Clock and field range is: 0-31.
+ * This is defined in BDS-SIS-ICD-B1I-3.0 Section 5.2.4.8 Table 5-6.
+ */
+ int aodc;
+ }
+
+ /** Contains information about Beidou health. */
+ parcelable BeidouSatelliteHealth {
+ /**
+ * The autonomous satellite health flag (SatH1) occupies 1 bit. “0” means
+ * broadcasting satellite is good and “1” means not.
+ * This is defined in BDS-SIS-ICD-B1I-3.0 section 5.2.4.6.
+ */
+ int satH1;
+
+ /**
+ * SV accuracy in meters.
+ * This is defined in the "BROADCAST ORBIT - 6" record of RINEX 3.05
+ * Table A14, pp.78.
+ */
+ double svAccur;
+ }
+
+ /** Contains information about time of ephemeris */
+ parcelable BeidouSatelliteEphemerisTime {
+ /**
+ * AODE Age of Data, Ephemeris.
+ * This is as defined in BDS-SIS-ICD-B1I-3.0 section 5.2.4.11 Table 5-8.
+ */
+ int aode;
+
+ /** Beidou week number. */
+ int weekNumber;
+
+ /**
+ * Time of ephemeris in seconds.
+ * This is defined in BDS-SIS-ICD-B1I-3.0 section 5.2.4.12.
+ */
+ int toeSeconds;
+ }
+
+ /** The PRN number of the Beidou satellite. */
+ int prn;
+
+ /** Satellite clock model. */
+ BeidouSatelliteClockModel satelliteClockModel;
+
+ /** Satellite orbit model. */
+ KeplerianOrbitModel satelliteOrbitModel;
+
+ /** Satellite health. */
+ BeidouSatelliteHealth satelliteHealth;
+
+ /** Satellite ephemeris time. */
+ BeidouSatelliteEphemerisTime satelliteEphemerisTime;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
new file mode 100644
index 0000000..db5dd04
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoAlmanac.aidl
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains Galileo almanac data.
+ * This is defined in Galileo-OS-SIS-ICD-v2.1, 5.1.10.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GalileoAlmanac {
+ /**
+ * Contains Galileo satellite almanac data.
+ * This is defined in Galileo-OS-SIS-ICD-v2.1, 5.1.10.
+ */
+ @VintfStability
+ parcelable GalileoSatelliteAlmanac {
+ /** Satellite ID. */
+ int svId;
+
+ /** Satellite health status. */
+ GalileoAlmanacSvHealth svHealth;
+
+ /** Eccentricity. */
+ double eccentricity;
+
+ /**
+ * Difference between the inclination angle at reference time and the
+ * nominal inclination, in semi-circles.
+ */
+ double deltaI;
+
+ /** Argument of perigee in semi-circles. */
+ double omega;
+
+ /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
+ double omega0;
+
+ /** Rate of right ascension in semi-circles per second. */
+ double omegaDot;
+
+ /**
+ * Difference with respect to the square root of the nominal semi-major axis
+ * in square root of meters.
+ */
+ double rootA;
+
+ /** Satellite mean anomaly at reference time in semi-circles. */
+ double m0;
+
+ /** Satellite clock correction bias in seconds. */
+ double af0;
+
+ /** Satellite clock correction linear in seconds per second. */
+ double af1;
+
+ /**
+ * Almanac reference week number.
+ * Modulo 4 representation of the Galileo system time week number.
+ */
+ int weekNumber;
+
+ /** Almanac reference time in seconds. */
+ int toa;
+
+ /** Almanac issue of data. */
+ int iod;
+ }
+
+ /**
+ * Contains Galileo satellite health status.
+ */
+ @VintfStability
+ parcelable GalileoAlmanacSvHealth {
+ /** Satellite E5a signal health status. */
+ int fNavE5a;
+
+ /** Satellite E5b signal health status. */
+ int iNavE5b;
+
+ /** Satellite E1b signal health status. */
+ int iNavE1b;
+ }
+
+ /** Almanac reference UTC time in milliseconds */
+ long issueDate;
+
+ /**
+ * Almanac reference week number.
+ * Modulo 4 representation of the Galileo system time week number.
+ */
+ int weekNumber;
+
+ /** Almanac reference time in seconds. */
+ int toa;
+
+ /** Almanac issue of data. */
+ int iod;
+
+ /** Array of GalileoSatelliteAlmanac. */
+ GalileoSatelliteAlmanac[] satelliteAlmanac;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl
new file mode 100644
index 0000000..ced8917
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoIonosphericModel.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains Galileo ionospheric model.
+ * This is Defined in Galileo-OS-SIS-ICD-v2.1, 5.1.6.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GalileoIonosphericModel {
+ /** Effective ionisation level 1st order parameter in sfu. */
+ double ai0;
+
+ /** Effective ionisation level 2nd order parameter in sfu per degree. */
+ double ai1;
+
+ /** Effective ionisation level 3nd order parameter in sfu per degree squared. */
+ double ai2;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
new file mode 100644
index 0000000..1562934
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GalileoSatelliteEphemeris.aidl
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
+import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
+import android.hardware.gnss.gnss_assistance.TimeOfClock;
+
+/**
+ * Contains ephemeris parameters specific to Galileo satellites.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GalileoSatelliteEphemeris {
+ /**
+ * Contains the set of parameters needed for Galileo satellite clock correction.
+ * This is defined in Galileo-OS-SIS-ICD 5.1.3.
+ */
+ @VintfStability
+ parcelable GalileoSatelliteClockModel {
+ /*
+ * States the type of satellite clock.
+ */
+ @VintfStability
+ @Backing(type="int")
+ enum SatelliteClockType {
+ UNDEFINED = 0,
+ GALILEO_FNAV_CLOCK = 1,
+ GALILEO_INAV_CLOCK = 2
+ }
+
+ /** Time of the clock. */
+ TimeOfClock toc;
+
+ /** SV clock bias correction coefficient in seconds. */
+ double af0;
+
+ /** SV clock drift correction coefficient in seconds per second. */
+ double af1;
+
+ /** SV clock drift rate correction coefficient in seconds per second squared. */
+ double af2;
+
+ /**
+ * Broadcast group delay in seconds.
+ * This is defined in Galileo-OS-SIS-ICD 5.1.5.
+ */
+ double bgdSeconds;
+
+ /**
+ * Signal in space accuracy in meters.
+ * This is defined in Galileo-OS-SIS-ICD 5.1.12.
+ */
+ double sisaMeters;
+
+ /** Type of satellite clock .*/
+ SatelliteClockType satelliteClockType;
+ }
+
+ /**
+ * Contains satellite health.
+ * This is defined in Galileo-OS-SIS-ICD 5.1.9.3.
+ */
+ @VintfStability
+ parcelable GalileoSvHealth {
+ /** E1-B data validity status. */
+ int dataValidityStatusE1b;
+
+ /** E1-B/C signal health status. */
+ int signalHealthStatusE1b;
+
+ /** E5a data validity status. */
+ int dataValidityStatusE5a;
+
+ /** E5a signal health status. */
+ int signalHealthStatusE5a;
+
+ /** E5b data validity status. */
+ int dataValidityStatusE5b;
+
+ /** E5b signal health status. */
+ int signalHealthStatusE5b;
+ }
+
+ /** Satellite code number. */
+ int satelliteCodeNumber;
+
+ /** Array of satellite clock model. */
+ GalileoSatelliteClockModel[] satelliteClockModel;
+
+ /** Satellite orbit model. */
+ KeplerianOrbitModel satelliteOrbitModel;
+
+ /** Satellite health. */
+ GalileoSvHealth svHealth;
+
+ /** Satellite ephemeris time. */
+ SatelliteEphemerisTime satelliteEphemerisTime;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
new file mode 100644
index 0000000..2662717
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassAlmanac.aidl
@@ -0,0 +1,56 @@
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains Glonass almanac data.
+ * This is defined in Glonass ICD v5.1, Section 4.5.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GlonassAlmanac {
+ /**
+ * Contains Glonass satellite almanac data.
+ * This is defined in Glonass ICD v5.1, Section 4.5.
+ */
+ @VintfStability
+ parcelable GlonassSatelliteAlmanac {
+ /** Slot number. */
+ int slotNumber;
+
+ /** Satellite health (0=healthy, 1=unhealthy). */
+ int svHealth;
+
+ /** Frequency channel number. */
+ int frequencyChannel;
+
+ /** Coarse value of satellite time correction to GLONASS time in seconds. */
+ double tau;
+
+ /** Time of first ascending node passage of satellite in seconds. */
+ double tLambda;
+
+ /** Longitude of the first ascending node in semi-circles. */
+ double lambda;
+
+ /** Correction to the mean value of inclination in semi-circles. */
+ double deltaI;
+
+ /** Correction to the mean value of the draconian period in seconds per orbital period. */
+ double deltaT;
+
+ /** Rate of change of draconian period in seconds per orbital period squared. */
+ double deltaTDot;
+
+ /** Eccentricity. */
+ double eccentricity;
+
+ /** Argument of perigee in radians. */
+ double omega;
+ }
+
+ /** Almanac reference UTC time in milliseconds. */
+ long issueDate;
+
+ /** Array of GlonassSatelliteAlmanac. */
+ GlonassSatelliteAlmanac[] satelliteAlmanac;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
new file mode 100644
index 0000000..383aed1
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GlonassSatelliteEphemeris.aidl
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
+import android.hardware.gnss.gnss_assistance.TimeOfClock;
+
+/**
+ * Contains ephemeris parameters specific to Glonass satellites.
+ * This is defined in RINEX 3.05 APPENDIX 10 and Glonass ICD v5.1, section 4.4.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GlonassSatelliteEphemeris {
+ /** Contains the set of parameters needed for Glonass satellite clock correction. */
+ @VintfStability
+ parcelable GlonassSatelliteClockModel {
+ /** Time of Clock. */
+ TimeOfClock timeOfClock;
+
+ /** Clock bias in seconds (-TauN). */
+ double clockBias;
+
+ /** Frequency bias (+GammaN). */
+ double freqBias;
+
+ /** Frequency number. */
+ int freqNumber;
+ }
+
+ /** Contains Glonass orbit model parameters in PZ-90 coordinate system. */
+ @VintfStability
+ parcelable GlonassSatelliteOrbitModel {
+ /** X position in kilometers. */
+ double x;
+
+ /** X velocity in kilometers per second. */
+ double xDot;
+
+ /** X acceleration in kilometers per second squared. */
+ double xAccel;
+
+ /** Y position in kilometers. */
+ double y;
+
+ /** Y velocity in kilometers per second. */
+ double yDot;
+
+ /** Y acceleration in kilometers per second squared. */
+ double yAccel;
+
+ /** Z position in kilometers. */
+ double z;
+
+ /** Z velocity in kilometers per second. */
+ double zDot;
+
+ /** Z acceleration in kilometers per second squared. */
+ double zAccel;
+ }
+
+ /**
+ * L1/Satellite system (R), satellite number (slot number in sat.
+ * constellation).
+ */
+ int slotNumber;
+
+ /** Satellite health (0=healthy, 1=unhealthy). */
+ int svHealth;
+
+ /** Message frame time in seconds of the UTC week (tk+nd*86400). */
+ double frameTimeSeconds;
+
+ /** Age of current information in days (E). */
+ int ageInDays;
+
+ /** Satellite clock model. */
+ GlonassSatelliteClockModel satelliteClockModel;
+
+ /** Satellite orbit model. */
+ GlonassSatelliteOrbitModel satelliteOrbitModel;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
new file mode 100644
index 0000000..dad0764
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssAssistance.aidl
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.BeidouAlmanac;
+import android.hardware.gnss.gnss_assistance.BeidouSatelliteEphemeris;
+import android.hardware.gnss.gnss_assistance.GalileoAlmanac;
+import android.hardware.gnss.gnss_assistance.GalileoIonosphericModel;
+import android.hardware.gnss.gnss_assistance.GalileoSatelliteEphemeris;
+import android.hardware.gnss.gnss_assistance.GlonassAlmanac;
+import android.hardware.gnss.gnss_assistance.GlonassSatelliteEphemeris;
+import android.hardware.gnss.gnss_assistance.GpsAlmanac;
+import android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris;
+import android.hardware.gnss.gnss_assistance.IonosphericCorrection;
+import android.hardware.gnss.gnss_assistance.KlobucharIonosphericModel;
+import android.hardware.gnss.gnss_assistance.LeapSecondsModel;
+import android.hardware.gnss.gnss_assistance.QzssAlmanac;
+import android.hardware.gnss.gnss_assistance.QzssSatelliteEphemeris;
+import android.hardware.gnss.gnss_assistance.RealTimeIntegrityModel;
+import android.hardware.gnss.gnss_assistance.TimeModel;
+import android.hardware.gnss.gnss_assistance.UtcModel;
+
+/**
+ * Contains GNSS assistance.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GnssAssistance {
+ /** GNSS corrections for satellites. */
+ @VintfStability
+ parcelable GnssSatelliteCorrections {
+ /**
+ * Pseudo-random or satellite ID number for the satellite, a.k.a. Space Vehicle (SV), or
+ * OSN number for Glonass. The distinction is made by looking at the constellation field.
+ * Values must be in the range of:
+ *
+ * - GNSS: 1-32
+ * - GLONASS: 1-25
+ * - QZSS: 183-206
+ * - Galileo: 1-36
+ * - Beidou: 1-63
+ */
+ int svid;
+
+ /** Ionospheric corrections */
+ IonosphericCorrection[] inonosphericCorrections;
+ }
+
+ /** Contains GPS assistance. */
+ @VintfStability
+ parcelable GpsAssistance {
+ /** The GPS almanac. */
+ GpsAlmanac almanac;
+
+ /** The Klobuchar ionospheric model. */
+ KlobucharIonosphericModel ionosphericModel;
+
+ /** The UTC model. */
+ UtcModel utcModel;
+
+ /** The leap seconds model. */
+ LeapSecondsModel leapSecondsModel;
+
+ /** The array of time models. */
+ TimeModel[] timeModels;
+
+ /** The array of GPS ephemeris. */
+ GpsSatelliteEphemeris[] satelliteEphemeris;
+
+ /** The array of real time integrity models. */
+ RealTimeIntegrityModel[] realTimeIntegrityModels;
+
+ /** The array of GPS satellite corrections. */
+ GnssSatelliteCorrections[] satelliteCorrections;
+ }
+
+ /** Contains Galileo assistance. */
+ @VintfStability
+ parcelable GalileoAssistance {
+ /** The Galileo almanac. */
+ GalileoAlmanac almanac;
+
+ /** The Galileo ionospheric model. */
+ GalileoIonosphericModel ionosphericModel;
+
+ /** The UTC model. */
+ UtcModel utcModel;
+
+ /** The leap seconds model. */
+ LeapSecondsModel leapSecondsModel;
+
+ /** The array of time models. */
+ TimeModel[] timeModels;
+
+ /** The array of Galileo ephemeris. */
+ GalileoSatelliteEphemeris[] satelliteEphemeris;
+
+ /** The array of real time integrity models. */
+ RealTimeIntegrityModel[] realTimeIntegrityModels;
+
+ /** The array of Galileo satellite corrections. */
+ GnssSatelliteCorrections[] satelliteCorrections;
+ }
+
+ /** Contains Glonass assistance. */
+ @VintfStability
+ parcelable GlonassAssistance {
+ /** The Glonass almanac. */
+ GlonassAlmanac almanac;
+
+ /** The UTC model. */
+ UtcModel utcModel;
+
+ /** The array of time models. */
+ TimeModel[] timeModels;
+
+ /** The array of Glonass ephemeris. */
+ GlonassSatelliteEphemeris[] satelliteEphemeris;
+
+ /** The array of Glonass satellite corrections. */
+ GnssSatelliteCorrections[] satelliteCorrections;
+ }
+
+ /** Contains QZSS assistance. */
+ @VintfStability
+ parcelable QzssAssistance {
+ /** The QZSS almanac. */
+ QzssAlmanac almanac;
+
+ /** The Klobuchar ionospheric model. */
+ KlobucharIonosphericModel ionosphericModel;
+
+ /** The UTC model. */
+ UtcModel utcModel;
+
+ /** The leap seconds model. */
+ LeapSecondsModel leapSecondsModel;
+
+ /** The array of time models. */
+ TimeModel[] timeModels;
+
+ /** The array of QZSS ephemeris. */
+ QzssSatelliteEphemeris[] satelliteEphemeris;
+
+ /** The array of real time integrity models. */
+ RealTimeIntegrityModel[] realTimeIntegrityModels;
+
+ /** The array of QZSS satellite corrections. */
+ GnssSatelliteCorrections[] satelliteCorrections;
+ }
+
+ /** Contains Beidou assistance. */
+ @VintfStability
+ parcelable BeidouAssistance {
+ /** The Beidou almanac. */
+ BeidouAlmanac almanac;
+
+ /** The Klobuchar ionospheric model. */
+ KlobucharIonosphericModel ionosphericModel;
+
+ /** The UTC model. */
+ UtcModel utcModel;
+
+ /** The leap seconds model. */
+ LeapSecondsModel leapSecondsModel;
+
+ /** The array of time models. */
+ TimeModel[] timeModels;
+
+ /** The array of Beidou ephemeris. */
+ BeidouSatelliteEphemeris[] satelliteEphemeris;
+
+ /** The array of real time integrity models. */
+ RealTimeIntegrityModel[] realTimeIntegrityModels;
+
+ /** The array of Beidou satellite corrections. */
+ GnssSatelliteCorrections[] satelliteCorrections;
+ }
+
+ /** GPS assistance. */
+ GpsAssistance gpsAssistance;
+
+ /** Glonass assistance. */
+ GlonassAssistance gloAssistance;
+
+ /** Galileo assistance. */
+ GalileoAssistance galAssistance;
+
+ /** Beidou assistance. */
+ BeidouAssistance bdsAssistance;
+
+ /** QZSS assistance. */
+ QzssAssistance qzsAssistance;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssCorrectionComponent.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssCorrectionComponent.aidl
new file mode 100644
index 0000000..445727f
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GnssCorrectionComponent.aidl
@@ -0,0 +1,64 @@
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Gnss correction associated with a component (e.g. the Ionospheric error).
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GnssCorrectionComponent {
+ /**
+ * Uniquely identifies the source of correction (e.g. "Klobuchar" for
+ * ionospheric corrections).
+ * Clients should not depend on the value of the source key but, rather,
+ * can compare before/after to detect changes.
+ */
+ String sourceKey;
+
+ /**
+ * Time interval referenced against the GPS epoch. The start must be less than
+ * or equal to the end. When the start equals the end, the interval is empty.
+ */
+ @VintfStability
+ parcelable GnssInterval {
+ /**
+ * Inclusive start of the interval in milliseconds since the GPS epoch.
+ * A timestamp matching this interval will have to be the same or after the
+ * start. Required as a reference time for the initial correction value and
+ * its rate of change over time.
+ */
+ long startMillisSinceGpsEpoch;
+
+ /**
+ * Exclusive end of the interval in milliseconds since the GPS epoch. If
+ * specified, a timestamp matching this interval will have to be before the
+ * end.
+ */
+ long endMillisSinceGpsEpoch;
+ }
+
+ /** The correction is only applicable during this time interval. */
+ GnssInterval validityInterval;
+
+ /** Pseudorange correction. */
+ @VintfStability
+ parcelable PseudorangeCorrection {
+ /* Correction to be added to the measured pseudorange, in meters. */
+ double correctionMeters;
+
+ /* Uncertainty of the correction, in meters. */
+ double correctionUncertaintyMeters;
+
+ /**
+ * Linear approximation of the change in correction over time. Intended
+ * usage is to adjust the correction using the formula:
+ * correctionMeters + correctionRateMetersPerSecond * delta_seconds
+ * Where `delta_seconds` is the number of elapsed seconds since the beginning
+ * of the correction validity interval.
+ */
+ double correctionRateMetersPerSecond;
+ }
+
+ /* Pseudorange correction. */
+ PseudorangeCorrection pseudorangeCorrection;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
new file mode 100644
index 0000000..9cc37f9
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsAlmanac.aidl
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains GPS almanac data.
+ * This is defined in IS-GPS-200, section 20.3.3.5.1.2.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GpsAlmanac {
+ /** GPS week number. */
+ int gpsWeekNumber;
+
+ /** GPS time of week in seconds. */
+ int secondsOfGpsWeek;
+
+ /**
+ * Contains GPS satellite almanac data.
+ * This is defined in IS-GPS-200, section 20.3.3.5.1.2.
+ */
+ @VintfStability
+ parcelable GpsSatelliteAlmanac {
+ /** The PRN number of the GPS satellite. */
+ int prn;
+
+ /**
+ * Satellite health information.
+ * The satellite subframe 4 and 5, page 25 six-bit health code as defined
+ * in IS-GPS-200 Table 20-VIII expressed in integer form.
+ */
+ int svHealth;
+
+ /** Eccentricity. */
+ double eccentricity;
+
+ /**
+ * Correction of inclination angle relative to reference value at
+ * reference time in semi-circles.
+ */
+ double inclination;
+
+ /** Argument of perigee in semi-circles. */
+ double omega;
+
+ /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
+ double omega0;
+
+ /** Rate of right ascension in semi-circles per second. */
+ double omegaDot;
+
+ /** Square root of semi-major axis in square root of meters. */
+ double rootA;
+
+ /** Mean anomaly at reference time in semi-circles. */
+ double m0;
+
+ /** Satellite clock time bias correction coefficient in seconds. */
+ double af0;
+
+ /** Satellite clock time drift correction coefficient in seconds per second. */
+ double af1;
+ }
+
+ /** Array of GpsSatelliteAlmanac. */
+ GpsSatelliteAlmanac[] satelliteAlmanac;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
new file mode 100644
index 0000000..b24c593
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/GpsSatelliteEphemeris.aidl
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
+import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
+import android.hardware.gnss.gnss_assistance.TimeOfClock;
+
+/**
+ * Contains ephemeris parameters specific to GPS satellites.
+ * This is defined in IS-GPS-200, section 20.3.3.3.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable GpsSatelliteEphemeris {
+ /** Satellite PRN */
+ int prn;
+
+ /* Contains information about L2 params. */
+ @VintfStability
+ parcelable GpsL2Params {
+ /** Code(s) on L2 Channel. */
+ int l2Code;
+
+ /** Data Flag for L2 P-Code. */
+ int l2Flag;
+ }
+
+ /** L2 parameters. */
+ GpsL2Params gpsL2Params;
+
+ /** Contains the set of parameters needed for GPS satellite clock correction. */
+ @VintfStability
+ parcelable GpsSatelliteClockModel {
+ /** Time of the clock. */
+ TimeOfClock timeOfClock;
+
+ /** SV clock bias in seconds. */
+ double af0;
+
+ /** SV clock drift in seconds per second. */
+ double af1;
+
+ /** Clock drift rate in seconds per second squared. */
+ double af2;
+
+ /** Group delay differential in seconds. */
+ double tgd;
+
+ /** Issue of data, clock. */
+ int iodc;
+ }
+
+ /** Clock model. */
+ GpsSatelliteClockModel satelliteClockModel;
+
+ /** Orbit model. */
+ KeplerianOrbitModel satelliteOrbitModel;
+
+ /**
+ * Contains information about GPS health. The information is tied to
+ * Legacy Navigation (LNAV) data, not Civil Navigation (CNAV) data.
+ */
+ @VintfStability
+ parcelable GpsSatelliteHealth {
+ /**
+ * Represents "SV health" in the "BROADCAST ORBIT - 6"
+ * record of RINEX 3.05. Table A6, pp.68.
+ */
+ int svHealth;
+
+ /**
+ * Represents "SV accuracy" in meters in the "BROADCAST ORBIT - 6"
+ * record of RINEX 3.05. Table A6, pp.68.
+ */
+ double svAccur;
+
+ /**
+ * Represents the "Fit Interval" in hours in the "BROADCAST ORBIT - 7"
+ * record of RINEX 3.05. Table A6, pp.69.
+ */
+ double fitInt;
+ }
+
+ /** Satellite health. */
+ GpsSatelliteHealth satelliteHealth;
+
+ /** Ephemeris time. */
+ SatelliteEphemerisTime satelliteEphemerisTime;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/IGnssAssistanceCallback.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/IGnssAssistanceCallback.aidl
new file mode 100644
index 0000000..883189c
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/IGnssAssistanceCallback.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * The callback interface for GNSS HAL to request GNSS assistance data
+ * (ephemeris and ionospheric corrections) from the framework.
+ *
+ * @hide
+ */
+@VintfStability
+interface IGnssAssistanceCallback {
+ /**
+ * Callback to request the framework to inject GNSS assistance data via
+ * IGnssAssistanceInterface.
+ */
+ void injectRequestCb();
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/IGnssAssistanceInterface.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/IGnssAssistanceInterface.aidl
new file mode 100644
index 0000000..2097e1e
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/IGnssAssistanceInterface.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.GnssAssistance;
+import android.hardware.gnss.gnss_assistance.IGnssAssistanceCallback;
+
+/**
+ * Interface used by the GNSS HAL to request the GNSS assistance data
+ * (ephemeris and ionospheric corrections) from the framework.
+ *
+ * The GNSS chipset uses the injected assistance data in the process of computing
+ * the user position for satellite position computation and error corrections.
+ *
+ * The framework ensures the assistance data is valid. GNSS HAL should request the
+ * data when it's engine lacks valid assistance data.
+ *
+ * @hide
+ */
+@VintfStability
+interface IGnssAssistanceInterface {
+ /**
+ * Inject the GNSS assistance into the GNSS receiver.
+ *
+ * @param gnssAssistance GNSS assistance.
+ */
+ void injectGnssAssistance(in GnssAssistance gnssAssistance);
+
+ /**
+ * Provides the callback routines to request the GNSS assistance.
+ *
+ * @param callback Handle to the IGnssAssistanceCallback interface.
+ */
+ void setCallback(in IGnssAssistanceCallback callback);
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/IonosphericCorrection.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/IonosphericCorrection.aidl
new file mode 100644
index 0000000..e8e50bd
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/IonosphericCorrection.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.GnssCorrectionComponent;
+
+/**
+ * Contains Ionospheric correction.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable IonosphericCorrection {
+ /**
+ * Carrier frequency in Hz to differentiate signals from the same satellite.
+ * e.g. GPS L1/L5
+ */
+ long carrierFrequencyHz;
+
+ /** Ionospheric correction. */
+ GnssCorrectionComponent ionosphericCorrection;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl
new file mode 100644
index 0000000..15003e7
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/KeplerianOrbitModel.aidl
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains Keplerian orbit model parameters for GPS/Galileo/QZSS/Beidou.
+ * For GPS, this is defined in IS-GPS-200 Table 20-II.
+ * For Galileo, this is defined in Galileo-OS-SIS-ICD-v2.1 5.1.1.
+ * For QZSS, this is defined in IS-QZSS-PNT section 4.1.2.
+ * For Baidou, this is defined in BDS-SIS-ICD-B1I-3.0 section 5.2.4.12.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable KeplerianOrbitModel {
+ /** Square root of the semi-major axis in square root of meters. */
+ double rootA;
+
+ /** Eccentricity. */
+ double eccentricity;
+
+ /** Inclination angle at reference time in semi-circles. */
+ double i0;
+
+ /** Rate of change of inclination angle in semi-circles per second. */
+ double iDot;
+
+ /** Argument of perigee in semi-circles. */
+ double omega;
+
+ /** Longitude of ascending node of orbit plane at beginning of week in semi-circles. */
+ double omega0;
+
+ /** Rate of right ascension in semi-circles per second. */
+ double omegaDot;
+
+ /** Mean anomaly at reference time in semi-circles. */
+ double m0;
+
+ /** Mean motion difference from computed value in semi-circles per second. */
+ double deltaN;
+
+ /**
+ * Contains second-order harmonic perturbations.
+ */
+ @VintfStability
+ parcelable SecondOrderHarmonicPerturbation {
+ /** Amplitude of cosine harmonic correction term to angle of inclination in radians. */
+ double cic;
+
+ /** Amplitude of sine harmonic correction term to angle of inclination in radians. */
+ double cis;
+
+ /** Amplitude of cosine harmonic correction term to the orbit in meters. */
+ double crc;
+
+ /** Amplitude of sine harmonic correction term to the orbit in meters. */
+ double crs;
+
+ /** Amplitude of cosine harmonic correction term to the argument of latitude in radians. */
+ double cuc;
+
+ /** Amplitude of sine harmonic correction term to the argument of latitude in radians. */
+ double cus;
+ }
+
+ /** Second-order harmonic perturbations. */
+ SecondOrderHarmonicPerturbation secondOrderHarmonicPerturbation;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl
new file mode 100644
index 0000000..e261e97
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/KlobucharIonosphericModel.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains Klobuchar ionospheric model coefficients used by GPS, BDS, QZSS.
+ * This is defined in IS-GPS-200 20.3.3.5.1.7.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable KlobucharIonosphericModel {
+ /** Alpha0 coefficient in seconds. */
+ double alpha0;
+
+ /** Alpha1 coefficient in seconds per semi-circle. */
+ double alpha1;
+
+ /** Alpha2 coefficient in seconds per semi-circle squared. */
+ double alpha2;
+
+ /** Alpha3 coefficient in seconds per semi-circle cubed. */
+ double alpha3;
+
+ /** Beta0 coefficient in seconds. */
+ double beta0;
+
+ /** Beta1 coefficient in seconds per semi-circle. */
+ double beta1;
+
+ /** Beta2 coefficient in seconds per semi-circle squared. */
+ double beta2;
+
+ /** Beta3 coefficient in seconds per semi-circle cubed. */
+ double beta3;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl
new file mode 100644
index 0000000..0ebd46d
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/LeapSecondsModel.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains the leap seconds set of parameters needed for GNSS time.
+ * This is defined in RINEX 3.05 "LEAP SECONDS" in table A2.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable LeapSecondsModel {
+ /** Time difference due to leap seconds before the event in seconds. */
+ int leapSeconds;
+
+ /** Time difference due to leap seconds after the event in seconds. */
+ int leapSecondsFuture;
+
+ /** GNSS week number in which the leap second event will occur. */
+ int weekNumberLeapSecondsFuture;
+
+ /** Day number when the next leap second will occur. */
+ int dayNumberLeapSecondsFuture;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
new file mode 100644
index 0000000..80ace39
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssAlmanac.aidl
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains QZSS almanac data.
+ * This is defined in IS-QZSS-PNT, section 4.1.2.6.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable QzssAlmanac {
+ /** QZSS week number. */
+ int qzssWeekNumber;
+
+ /** QZSS time of week in seconds. */
+ int secondsOfQzssWeek;
+
+ /**
+ * Contains QZSS satellite almanac data.
+ * This is defined in IS-QZSS-PNT, section 4.1.2.6.
+ */
+ @VintfStability
+ parcelable QzssSatelliteAlmanac {
+ /** The PRN number of the QZSS satellite. */
+ int prn;
+
+ /**
+ * Satellite health information.
+ * This is the 5-bit health code as defined in IS-QZSS-PNT, Table 4.1.2-5-2
+ * expressed in integer form.
+ */
+ int svHealth;
+
+ /** Eccentricity. */
+ double eccentricity;
+
+ /**
+ * Correction of inclination angle relative to reference value at
+ * reference time in semi-circles.
+ */
+ double inclination;
+
+ /** Argument of perigee in semi-circles. */
+ double omega;
+
+ /** Longitude of ascending node of orbital plane at weekly epoch in semi-circles. */
+ double omega0;
+
+ /** Rate of right ascension in semi-circles per second. */
+ double omegaDot;
+
+ /** Square root of semi-major axis in square root of meters. */
+ double rootA;
+
+ /** Mean anomaly at reference time in semi-circles. */
+ double m0;
+
+ /** Satellite clock time bias correction coefficient in seconds. */
+ double af0;
+
+ /** Satellite clock time drift correction coefficient in seconds per second. */
+ double af1;
+ }
+
+ /** Array of QzssSatelliteAlmanac. */
+ QzssSatelliteAlmanac[] satelliteAlmanac;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl
new file mode 100644
index 0000000..7efa4d9
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/QzssSatelliteEphemeris.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsL2Params;
+import android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsSatelliteClockModel;
+import android.hardware.gnss.gnss_assistance.GpsSatelliteEphemeris.GpsSatelliteHealth;
+import android.hardware.gnss.gnss_assistance.KeplerianOrbitModel;
+import android.hardware.gnss.gnss_assistance.SatelliteEphemerisTime;
+import android.hardware.gnss.gnss_assistance.TimeOfClock;
+
+/**
+ * Contains ephemeris parameters specific to QZSS satellites.
+ * This is defined in IS-QZSS-PNT, section 4.1.2.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable QzssSatelliteEphemeris {
+ /** Satellite PRN. */
+ int prn;
+
+ /** L2 parameters. */
+ GpsL2Params gpsL2Params;
+
+ /** Clock model. */
+ GpsSatelliteClockModel satelliteClockModel;
+
+ /** Orbit model. */
+ KeplerianOrbitModel satelliteOrbitModel;
+
+ /** Satellite health. */
+ GpsSatelliteHealth satelliteHealth;
+
+ /** Ephemeris time. */
+ SatelliteEphemerisTime satelliteEphemerisTime;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/RealTimeIntegrityModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/RealTimeIntegrityModel.aidl
new file mode 100644
index 0000000..4a4122c
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/RealTimeIntegrityModel.aidl
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains the real time integrity status of a GNSS satellite based on
+ * notice advisory.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable RealTimeIntegrityModel {
+ /**
+ * Pseudo-random or satellite ID number for the satellite, a.k.a. Space Vehicle (SV), or
+ * OSN number for Glonass. The distinction is made by looking at the constellation field.
+ * Values must be in the range of:
+ *
+ * - GNSS: 1-32
+ * - GLONASS: 1-25
+ * - QZSS: 183-206
+ * - Galileo: 1-36
+ * - Beidou: 1-63
+ */
+ int svid;
+
+ /** Indicates whether the satellite is currently usable for navigation. */
+ boolean usable;
+
+ /** UTC timestamp (in seconds) when the advisory was published. */
+ long publishDateSeconds;
+
+ /** UTC timestamp (in seconds) for the start of the event. */
+ long startDateSeconds;
+
+ /** UTC timestamp (in seconds) for the end of the event. */
+ long endDateSeconds;
+
+ /**
+ * Abbreviated type of the advisory, providing a concise summary of the event.
+ * This field follows different definitions depending on the GNSS constellation:
+ * - GPS: See NANU type definitions
+ * (https://www.navcen.uscg.gov/nanu-abbreviations-and-descriptions)
+ * - Galileo: See NAGU type definitions
+ * (https://www.gsc-europa.eu/system-service-status/nagu-information)
+ * - QZSS: See NAQU type definitions (https://sys.qzss.go.jp/dod/en/naqu/type.html)
+ * - BeiDou: Not used; set to an empty string.
+ */
+ String advisoryType;
+
+ /**
+ * Unique identifier for the advisory within its constellation's system.
+ * For BeiDou, this is not used and should be an empty string.
+ */
+ String advisoryNumber;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl
new file mode 100644
index 0000000..2d9b3e6
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/SatelliteEphemerisTime.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains time of ephemeris.
+ *
+ * For GPS, this is defined in IS-GPS-200, section 20.3.3.4.1.
+ * For QZSS, this is defined in IS-QZSS-200, section 4.1.2.4.
+ * @hide
+ */
+@VintfStability
+parcelable SatelliteEphemerisTime {
+ /** The issue of ephemeris data. */
+ int iode;
+
+ /** The satellite week number. */
+ int weekNumber;
+
+ /** The broadcast time of ephemeris in GNSS time of week in seconds. */
+ int toeSeconds;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeModel.aidl
new file mode 100644
index 0000000..8804f02
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeModel.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+import android.hardware.gnss.GnssConstellationType;
+
+/*
+ * Contains the GNSS-GNSS system time offset between the GNSS system time.
+ * This is defined in RINEX 3.05 "TIME SYSTEM CORR" in table A5.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable TimeModel {
+ /*
+ * Model represents parameters to convert from current GNSS to GNSS system
+ * time indicated by toGnss.
+ */
+ GnssConstellationType toGnss;
+
+ /** Bias coefficient of GNSS time scale relative to GNSS time scale in seconds. */
+ double a0;
+
+ /** Drift coefficient of GNSS time scale relative to GNSS time scale in seconds per second. */
+ double a1;
+
+ /** Reference GNSS time of week in seconds. */
+ int timeOfWeek;
+
+ /** Reference GNSS week number. */
+ int weekNumber;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
new file mode 100644
index 0000000..7b9cc9f
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/TimeOfClock.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/*
+ * Contains the reference time of the GNSS clock.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable TimeOfClock {
+ /** Year of the clock. */
+ int year;
+
+ /** Month of the clock. */
+ int month;
+
+ /** Day of the clock. */
+ int day;
+
+ /** Hour of the clock. */
+ int hour;
+
+ /** Minute of the clock. */
+ int minute;
+
+ /** Second of the clock. */
+ int seconds;
+}
diff --git a/gnss/aidl/android/hardware/gnss/gnss_assistance/UtcModel.aidl b/gnss/aidl/android/hardware/gnss/gnss_assistance/UtcModel.aidl
new file mode 100644
index 0000000..c16a711
--- /dev/null
+++ b/gnss/aidl/android/hardware/gnss/gnss_assistance/UtcModel.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.gnss.gnss_assistance;
+
+/**
+ * Contains parameters to convert from current GNSS time to UTC time.
+ * This is defined in RINEX 3.05 "TIME SYSTEM CORR" in table A5.
+ *
+ * @hide
+ */
+@VintfStability
+parcelable UtcModel {
+ /** Bias coefficient of GNSS time scale relative to UTC time scale in seconds. */
+ double a0;
+
+ /** Drift coefficient of GNSS time scale relative to UTC time scale in seconds per second. */
+ double a1;
+
+ /** Reference GNSS time of week in seconds. */
+ int timeOfWeek;
+
+ /** Reference GNSS week number. */
+ int weekNumber;
+}
diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp
index 822e8fc..efe2953 100644
--- a/gnss/aidl/default/Android.bp
+++ b/gnss/aidl/default/Android.bp
@@ -45,13 +45,14 @@
"android.hardware.gnss.measurement_corrections@1.1",
"android.hardware.gnss.measurement_corrections@1.0",
"android.hardware.gnss.visibility_control@1.0",
- "android.hardware.gnss-V4-ndk",
+ "android.hardware.gnss-V5-ndk",
],
srcs: [
"AGnssRil.cpp",
"AGnss.cpp",
"Gnss.cpp",
"GnssAntennaInfo.cpp",
+ "GnssAssistanceInterface.cpp",
"GnssBatching.cpp",
"GnssDebug.cpp",
"GnssGeofence.cpp",
diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp
index 94d4d00..4978281 100644
--- a/gnss/aidl/default/Gnss.cpp
+++ b/gnss/aidl/default/Gnss.cpp
@@ -25,6 +25,7 @@
#include "DeviceFileReader.h"
#include "FixLocationParser.h"
#include "GnssAntennaInfo.h"
+#include "GnssAssistanceInterface.h"
#include "GnssBatching.h"
#include "GnssConfiguration.h"
#include "GnssDebug.h"
@@ -390,6 +391,14 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus Gnss::getExtensionGnssAssistanceInterface(
+ std::shared_ptr<gnss_assistance::IGnssAssistanceInterface>* iGnssAssistanceInterface) {
+ ALOGD("Gnss::getExtensionGnssAssistanceInterface");
+
+ *iGnssAssistanceInterface = SharedRefBase::make<gnss_assistance::GnssAssistanceInterface>();
+ return ndk::ScopedAStatus::ok();
+}
+
void Gnss::setGnssMeasurementEnabled(const bool enabled) {
mGnssMeasurementEnabled = enabled;
}
diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h
index 73085ef..56fe399 100644
--- a/gnss/aidl/default/Gnss.h
+++ b/gnss/aidl/default/Gnss.h
@@ -26,6 +26,7 @@
#include <aidl/android/hardware/gnss/BnGnssMeasurementInterface.h>
#include <aidl/android/hardware/gnss/BnGnssPowerIndication.h>
#include <aidl/android/hardware/gnss/BnGnssPsds.h>
+#include <aidl/android/hardware/gnss/gnss_assistance/BnGnssAssistanceInterface.h>
#include <aidl/android/hardware/gnss/measurement_corrections/BnMeasurementCorrectionsInterface.h>
#include <aidl/android/hardware/gnss/visibility_control/BnGnssVisibilityControl.h>
#include <atomic>
@@ -83,6 +84,9 @@
std::shared_ptr<android::hardware::gnss::measurement_corrections::
IMeasurementCorrectionsInterface>* iMeasurementCorrections)
override;
+ ndk::ScopedAStatus getExtensionGnssAssistanceInterface(
+ std::shared_ptr<android::hardware::gnss::gnss_assistance::IGnssAssistanceInterface>*
+ iGnssAssistanceInterface) override;
void reportSvStatus() const;
void setGnssMeasurementEnabled(const bool enabled);
diff --git a/gnss/aidl/default/GnssAssistanceInterface.cpp b/gnss/aidl/default/GnssAssistanceInterface.cpp
new file mode 100644
index 0000000..2ef334c
--- /dev/null
+++ b/gnss/aidl/default/GnssAssistanceInterface.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+#define LOG_TAG "GnssAssistanceInterfaceAidl"
+
+#include "GnssAssistanceInterface.h"
+#include <aidl/android/hardware/gnss/BnGnss.h>
+#include <log/log.h>
+
+namespace aidl::android::hardware::gnss::gnss_assistance {
+
+std::shared_ptr<IGnssAssistanceCallback> GnssAssistanceInterface::sCallback = nullptr;
+
+ndk::ScopedAStatus GnssAssistanceInterface::setCallback(
+ const std::shared_ptr<IGnssAssistanceCallback>& callback) {
+ ALOGD("setCallback");
+ std::unique_lock<std::mutex> lock(mMutex);
+ sCallback = callback;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus GnssAssistanceInterface::injectGnssAssistance(
+ const GnssAssistance& gnssAssistance) {
+ ALOGD("injectGnssAssistance. %s", gnssAssistance.toString().c_str());
+ if (gnssAssistance.gpsAssistance.satelliteEphemeris.size() == 0 &&
+ gnssAssistance.gpsAssistance.satelliteCorrections.size() == 0) {
+ ALOGE("Empty GnssAssistance");
+ return ndk::ScopedAStatus::fromServiceSpecificError(IGnss::ERROR_INVALID_ARGUMENT);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+} // namespace aidl::android::hardware::gnss::gnss_assistance
diff --git a/gnss/aidl/default/GnssAssistanceInterface.h b/gnss/aidl/default/GnssAssistanceInterface.h
new file mode 100644
index 0000000..9d92975
--- /dev/null
+++ b/gnss/aidl/default/GnssAssistanceInterface.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/gnss/gnss_assistance/BnGnssAssistanceInterface.h>
+
+namespace aidl::android::hardware::gnss::gnss_assistance {
+
+struct GnssAssistanceInterface : public BnGnssAssistanceInterface {
+ public:
+ ndk::ScopedAStatus setCallback(
+ const std::shared_ptr<IGnssAssistanceCallback>& callback) override;
+ ndk::ScopedAStatus injectGnssAssistance(const GnssAssistance& gnssAssistance) override;
+
+ private:
+ // Guarded by mMutex
+ static std::shared_ptr<IGnssAssistanceCallback> sCallback;
+
+ // Synchronization lock for sCallback
+ mutable std::mutex mMutex;
+};
+
+} // namespace aidl::android::hardware::gnss::gnss_assistance
diff --git a/gnss/aidl/default/gnss-default.xml b/gnss/aidl/default/gnss-default.xml
index c01069e..700e240 100644
--- a/gnss/aidl/default/gnss-default.xml
+++ b/gnss/aidl/default/gnss-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.gnss</name>
- <version>4</version>
+ <version>5</version>
<interface>
<name>IGnss</name>
<instance>default</instance>
diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp
index 2bd6f07..20cf44f 100644
--- a/gnss/aidl/vts/Android.bp
+++ b/gnss/aidl/vts/Android.bp
@@ -52,7 +52,7 @@
"libbinder",
],
static_libs: [
- "android.hardware.gnss-V4-cpp",
+ "android.hardware.gnss-V5-cpp",
"android.hardware.gnss@common-vts-lib",
],
test_suites: [
diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp
index e4890a7..a2e81d1 100644
--- a/gnss/aidl/vts/gnss_hal_test_cases.cpp
+++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp
@@ -25,6 +25,7 @@
#include <android/hardware/gnss/IGnssMeasurementInterface.h>
#include <android/hardware/gnss/IGnssPowerIndication.h>
#include <android/hardware/gnss/IGnssPsds.h>
+#include <android/hardware/gnss/gnss_assistance/IGnssAssistanceInterface.h>
#include <android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsInterface.h>
#include <android/hardware/gnss/visibility_control/IGnssVisibilityControl.h>
#include <cutils/properties.h>
@@ -73,6 +74,8 @@
using android::hardware::gnss::PsdsType;
using android::hardware::gnss::SatellitePvt;
using android::hardware::gnss::common::Utils;
+using android::hardware::gnss::gnss_assistance::GnssAssistance;
+using android::hardware::gnss::gnss_assistance::IGnssAssistanceInterface;
using android::hardware::gnss::measurement_corrections::IMeasurementCorrectionsInterface;
using android::hardware::gnss::visibility_control::IGnssVisibilityControl;
@@ -1877,3 +1880,22 @@
}
}
}
+
+/*
+ * Test GnssAssistanceExtension:
+ * 1. Gets the GnssAssistanceExtension
+ * 2. Injects empty GnssAssistance data and verifies that it returns an error.
+ */
+TEST_P(GnssHalTest, TestGnssAssistanceExtension) {
+ // Only runs on devices launched in Android 16+
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 4) {
+ return;
+ }
+ sp<IGnssAssistanceInterface> iGnssAssistance;
+ auto status = aidl_gnss_hal_->getExtensionGnssAssistanceInterface(&iGnssAssistance);
+ if (status.isOk() && iGnssAssistance != nullptr) {
+ GnssAssistance gnssAssistance = {};
+ status = iGnssAssistance->injectGnssAssistance(gnssAssistance);
+ ASSERT_FALSE(status.isOk());
+ }
+}
diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp
index 208bc59..e8c370a 100644
--- a/gnss/common/utils/default/Android.bp
+++ b/gnss/common/utils/default/Android.bp
@@ -57,6 +57,6 @@
"android.hardware.gnss@2.1",
"android.hardware.gnss.measurement_corrections@1.1",
"android.hardware.gnss.measurement_corrections@1.0",
- "android.hardware.gnss-V4-ndk",
+ "android.hardware.gnss-V5-ndk",
],
}
diff --git a/gnss/common/utils/vts/Android.bp b/gnss/common/utils/vts/Android.bp
index ed5674c..b8b048a 100644
--- a/gnss/common/utils/vts/Android.bp
+++ b/gnss/common/utils/vts/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.gnss@2.1",
"android.hardware.gnss.measurement_corrections@1.0",
"android.hardware.gnss.measurement_corrections@1.1",
- "android.hardware.gnss-V4-cpp",
+ "android.hardware.gnss-V5-cpp",
],
static_libs: [
"libgtest",
diff --git a/graphics/Android.bp b/graphics/Android.bp
index d768ecf..2213f15 100644
--- a/graphics/Android.bp
+++ b/graphics/Android.bp
@@ -64,14 +64,14 @@
aidl_interface_defaults {
name: "android.hardware.graphics.common-latest",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
}
rust_defaults {
name: "android.hardware.graphics.common-latest-rust",
rustlibs: [
- "android.hardware.graphics.common-V5-rust",
+ "android.hardware.graphics.common-V6-rust",
],
}
@@ -80,7 +80,7 @@
target: {
linux: {
static_libs: [
- "android.hardware.graphics.common-V5-ndk",
+ "android.hardware.graphics.common-V6-ndk",
],
},
},
@@ -91,7 +91,7 @@
target: {
linux: {
shared_libs: [
- "android.hardware.graphics.common-V5-ndk",
+ "android.hardware.graphics.common-V6-ndk",
],
},
},
diff --git a/graphics/allocator/aidl/Android.bp b/graphics/allocator/aidl/Android.bp
index 30b341c..3f74b23 100644
--- a/graphics/allocator/aidl/Android.bp
+++ b/graphics/allocator/aidl/Android.bp
@@ -45,7 +45,7 @@
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp
index f4264eb..655188d 100644
--- a/graphics/composer/aidl/Android.bp
+++ b/graphics/composer/aidl/Android.bp
@@ -59,21 +59,21 @@
{
version: "1",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
"android.hardware.common-V2",
],
},
{
version: "2",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
"android.hardware.common-V2",
],
},
{
version: "3",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
"android.hardware.common-V2",
],
},
diff --git a/graphics/mapper/4.0/utils/vts/Android.bp b/graphics/mapper/4.0/utils/vts/Android.bp
index c5f124c..1be460e 100644
--- a/graphics/mapper/4.0/utils/vts/Android.bp
+++ b/graphics/mapper/4.0/utils/vts/Android.bp
@@ -48,7 +48,7 @@
],
export_static_lib_headers: [
"android.hardware.graphics.allocator@4.0",
- "android.hardware.graphics.common-V5-ndk",
+ "android.hardware.graphics.common-V6-ndk",
"android.hardware.graphics.mapper@4.0",
],
export_include_dirs: ["include"],
diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp
index 9589750..45b34e6 100644
--- a/neuralnetworks/aidl/Android.bp
+++ b/neuralnetworks/aidl/Android.bp
@@ -43,28 +43,28 @@
version: "1",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "3",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "4",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/ProtocolDiscoveryConfig.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/ProtocolDiscoveryConfig.aidl
index 021dfe2..2df0d35 100644
--- a/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/ProtocolDiscoveryConfig.aidl
+++ b/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/ProtocolDiscoveryConfig.aidl
@@ -43,4 +43,5 @@
byte discoveryPollKovio;
byte discoveryPollBPrime;
byte discoveryListenBPrime;
+ byte protocolChineseId;
}
diff --git a/nfc/aidl/android/hardware/nfc/ProtocolDiscoveryConfig.aidl b/nfc/aidl/android/hardware/nfc/ProtocolDiscoveryConfig.aidl
index f8e3228..021e307 100644
--- a/nfc/aidl/android/hardware/nfc/ProtocolDiscoveryConfig.aidl
+++ b/nfc/aidl/android/hardware/nfc/ProtocolDiscoveryConfig.aidl
@@ -33,4 +33,5 @@
byte discoveryPollKovio;
byte discoveryPollBPrime;
byte discoveryListenBPrime;
+ byte protocolChineseId;
}
diff --git a/power/OWNERS b/power/OWNERS
index 7229b22..95778a4 100644
--- a/power/OWNERS
+++ b/power/OWNERS
@@ -3,3 +3,4 @@
# ADPF virtual team
lpy@google.com
wvw@google.com
+file:platform/frameworks/base:/ADPF_OWNERS
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomParams.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomParams.aidl
new file mode 100644
index 0000000..09a2ace
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/CpuHeadroomParams.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable CpuHeadroomParams {
+ android.hardware.power.CpuHeadroomParams.CalculationType calculationType;
+ android.hardware.power.CpuHeadroomParams.SelectionType selectionType;
+ int pid;
+ enum CalculationType {
+ MIN,
+ AVERAGE,
+ }
+ enum SelectionType {
+ ALL,
+ PER_CORE,
+ }
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomParams.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomParams.aidl
new file mode 100644
index 0000000..64bb4a4
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/GpuHeadroomParams.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable GpuHeadroomParams {
+ android.hardware.power.GpuHeadroomParams.CalculationType calculationType;
+ enum CalculationType {
+ MIN,
+ AVERAGE,
+ }
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
index 8d8fb88..10456cb 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
@@ -44,4 +44,8 @@
android.hardware.power.ChannelConfig getSessionChannel(in int tgid, in int uid);
oneway void closeSessionChannel(in int tgid, in int uid);
android.hardware.power.SupportInfo getSupportInfo();
+ float[] getCpuHeadroom(in android.hardware.power.CpuHeadroomParams params);
+ float getGpuHeadroom(in android.hardware.power.GpuHeadroomParams params);
+ long getCpuHeadroomMinIntervalMillis();
+ long getGpuHeadroomMinIntervalMillis();
}
diff --git a/power/aidl/android/hardware/power/CpuHeadroomParams.aidl b/power/aidl/android/hardware/power/CpuHeadroomParams.aidl
new file mode 100644
index 0000000..cf71b67
--- /dev/null
+++ b/power/aidl/android/hardware/power/CpuHeadroomParams.aidl
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.power;
+
+@VintfStability
+@JavaDerive(equals=true, toString=true)
+parcelable CpuHeadroomParams {
+ /**
+ * Defines how to calculate the headroom.
+ */
+ enum CalculationType {
+ // Default to return the minimum headroom in a window.
+ MIN,
+ // Returns the average headroom in a window.
+ AVERAGE,
+ }
+
+ /**
+ * The calculation type.
+ */
+ CalculationType calculationType;
+
+ /**
+ * Defines how to select the CPU.
+ */
+ enum SelectionType {
+ // Default to return a single value for all cores.
+ ALL,
+ // Returns per-core headroom in a list.
+ PER_CORE,
+ }
+
+ /**
+ * The CPU selection type.
+ */
+ SelectionType selectionType;
+
+ /**
+ * The caller thread's PID.
+ *
+ * If pid is positive, return the headroom only for cores that are available
+ * to the given pid, otherwise return the headroom(s) for all cores.
+ *
+ * This should handle all the cases including but not limited to thread core
+ * affinity and app cpuset that change the available CPU cores for the caller.
+ */
+ int pid;
+}
diff --git a/power/aidl/android/hardware/power/GpuHeadroomParams.aidl b/power/aidl/android/hardware/power/GpuHeadroomParams.aidl
new file mode 100644
index 0000000..972adbc
--- /dev/null
+++ b/power/aidl/android/hardware/power/GpuHeadroomParams.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+package android.hardware.power;
+
+@VintfStability
+@JavaDerive(equals=true, toString=true)
+parcelable GpuHeadroomParams {
+ /**
+ * Defines how to calculate the headroom.
+ */
+ enum CalculationType {
+ // Default to return the minimum headroom in a window.
+ MIN,
+ // Returns the average headroom in a window.
+ AVERAGE,
+ }
+
+ /**
+ * The calculation type.
+ */
+ CalculationType calculationType;
+}
diff --git a/power/aidl/android/hardware/power/IPower.aidl b/power/aidl/android/hardware/power/IPower.aidl
index 2f15648..e2f121c 100644
--- a/power/aidl/android/hardware/power/IPower.aidl
+++ b/power/aidl/android/hardware/power/IPower.aidl
@@ -18,6 +18,8 @@
import android.hardware.power.Boost;
import android.hardware.power.ChannelConfig;
+import android.hardware.power.CpuHeadroomParams;
+import android.hardware.power.GpuHeadroomParams;
import android.hardware.power.IPowerHintSession;
import android.hardware.power.Mode;
import android.hardware.power.SessionConfig;
@@ -155,4 +157,47 @@
* not supported.
*/
SupportInfo getSupportInfo();
+
+ /**
+ * Provides an estimate of available CPU headroom the device based on past history.
+ * <p>
+ * @param params params to customize the CPU headroom calculation
+ * @return a single value or an array of values depending on selection type of params.
+ * Each value is ranged from [0, 100], and 0 indicates no CPU resources were left
+ * during the calculation interval and the app may expect low resources to be granted.
+ * @throws EX_UNSUPPORTED_OPERATION if the API is unsupported or the request params can't be
+ * served.
+ */
+ float[] getCpuHeadroom(in CpuHeadroomParams params);
+
+ /**
+ * Provides an estimate of available GPU headroom the device based on past history.
+ * <p>
+ * @param params params to customize the GPU headroom calculation
+ * @return Value is ranged from [0, 100], and 0 indicates no GPU resources were left
+ * during the calculation interval and the app may expect low resources to be granted.
+ * @throws EX_UNSUPPORTED_OPERATION if the API is unsupported or the request params can't be
+ * served.
+ */
+ float getGpuHeadroom(in GpuHeadroomParams params);
+
+ /**
+ * Minimum polling interval for calling getCpuHeadroom in milliseconds.
+ *
+ * The getCpuHeadroom API may return cached result if called more frequent
+ * than the interval.
+ *
+ * @throws EX_UNSUPPORTED_OPERATION if the API is unsupported.
+ */
+ long getCpuHeadroomMinIntervalMillis();
+
+ /**
+ * Minimum polling interval for calling getGpuHeadroom in milliseconds.
+ *
+ * The getGpuHeadroom API may return cached result if called more frequent
+ * than the interval.
+ *
+ * @throws EX_UNSUPPORTED_OPERATION if the API is unsupported.
+ */
+ long getGpuHeadroomMinIntervalMillis();
}
diff --git a/power/aidl/default/Power.cpp b/power/aidl/default/Power.cpp
index 36d0055..1fc0a0a 100644
--- a/power/aidl/default/Power.cpp
+++ b/power/aidl/default/Power.cpp
@@ -69,6 +69,27 @@
return ScopedAStatus::ok();
}
+ndk::ScopedAStatus Power::getCpuHeadroom(const CpuHeadroomParams& _,
+ std::vector<float>* _aidl_return) {
+ *_aidl_return = {0.5f};
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Power::getGpuHeadroom(const GpuHeadroomParams& _, float* _aidl_return) {
+ *_aidl_return = 0.5f;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Power::getCpuHeadroomMinIntervalMillis(int64_t* _aidl_return) {
+ *_aidl_return = 1000;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Power::getGpuHeadroomMinIntervalMillis(int64_t* _aidl_return) {
+ *_aidl_return = 1000;
+ return ndk::ScopedAStatus::ok();
+}
+
ScopedAStatus Power::createHintSession(int32_t, int32_t, const std::vector<int32_t>& tids, int64_t,
std::shared_ptr<IPowerHintSession>* _aidl_return) {
if (tids.size() == 0) {
diff --git a/power/aidl/default/Power.h b/power/aidl/default/Power.h
index ef524e1..a77a514 100644
--- a/power/aidl/default/Power.h
+++ b/power/aidl/default/Power.h
@@ -45,6 +45,12 @@
ChannelConfig* _aidl_return) override;
ndk::ScopedAStatus closeSessionChannel(int32_t tgid, int32_t uid) override;
ndk::ScopedAStatus getSupportInfo(SupportInfo* _aidl_return) override;
+ ndk::ScopedAStatus getCpuHeadroom(const CpuHeadroomParams& params,
+ std::vector<float>* _aidl_return) override;
+ ndk::ScopedAStatus getGpuHeadroom(const GpuHeadroomParams& params,
+ float* _aidl_return) override;
+ ndk::ScopedAStatus getCpuHeadroomMinIntervalMillis(int64_t* _aidl_return) override;
+ ndk::ScopedAStatus getGpuHeadroomMinIntervalMillis(int64_t* _aidl_return) override;
private:
std::vector<std::shared_ptr<IPowerHintSession>> mPowerHintSessions;
diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp
index 9684c38..5e3ddd5 100644
--- a/power/aidl/vts/VtsHalPowerTargetTest.cpp
+++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp
@@ -30,6 +30,8 @@
#include <unistd.h>
#include <cstdint>
#include "aidl/android/hardware/common/fmq/SynchronizedReadWrite.h"
+#include "aidl/android/hardware/power/CpuHeadroomParams.h"
+#include "aidl/android/hardware/power/GpuHeadroomParams.h"
namespace aidl::android::hardware::power {
namespace {
@@ -40,6 +42,8 @@
using android::hardware::power::Boost;
using android::hardware::power::ChannelConfig;
using android::hardware::power::ChannelMessage;
+using android::hardware::power::CpuHeadroomParams;
+using android::hardware::power::GpuHeadroomParams;
using android::hardware::power::IPower;
using android::hardware::power::IPowerHintSession;
using android::hardware::power::Mode;
@@ -291,6 +295,43 @@
ASSERT_NE(nullptr, session);
}
+TEST_P(PowerAidl, getCpuHeadroom) {
+ if (mServiceVersion < 6) {
+ GTEST_SKIP() << "DEVICE not launching with Power V6 and beyond.";
+ }
+ CpuHeadroomParams params;
+ std::vector<float> headroom;
+ auto ret = power->getCpuHeadroom(params, &headroom);
+ if (ret.getExceptionCode() == EX_UNSUPPORTED_OPERATION) {
+ GTEST_SKIP() << "power->getCpuHeadroom is not supported";
+ }
+ ASSERT_TRUE(ret.isOk());
+ int64_t minIntervalMillis;
+ ASSERT_TRUE(power->getCpuHeadroomMinIntervalMillis(&minIntervalMillis).isOk());
+ ASSERT_GE(minIntervalMillis, 0);
+ ASSERT_GE(headroom.size(), 1);
+ ASSERT_GE(headroom[0], 0.0f);
+ ASSERT_LE(headroom[0], 100.00f);
+}
+
+TEST_P(PowerAidl, getGpuHeadroom) {
+ if (mServiceVersion < 6) {
+ GTEST_SKIP() << "DEVICE not launching with Power V6 and beyond.";
+ }
+ GpuHeadroomParams params;
+ float headroom;
+ auto ret = power->getGpuHeadroom(params, &headroom);
+ if (ret.getExceptionCode() == EX_UNSUPPORTED_OPERATION) {
+ GTEST_SKIP() << "power->getGpuHeadroom is not supported";
+ }
+ ASSERT_TRUE(ret.isOk());
+ int64_t minIntervalMillis;
+ ASSERT_TRUE(power->getGpuHeadroomMinIntervalMillis(&minIntervalMillis).isOk());
+ ASSERT_GE(minIntervalMillis, 0);
+ ASSERT_GE(headroom, 0.0f);
+ ASSERT_LE(headroom, 100.00f);
+}
+
// FIXED_PERFORMANCE mode is required for all devices which ship on Android 11
// or later
TEST_P(PowerAidl, hasFixedPerformance) {
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
index b44ab71..080a877 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
@@ -35,7 +35,7 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ActivityStatsTechSpecificInfo {
- android.hardware.radio.AccessNetwork rat;
+ android.hardware.radio.AccessNetwork rat = android.hardware.radio.AccessNetwork.UNKNOWN;
int frequencyRange;
int[] txmModetimeMs;
int rxModeTimeMs;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
index 1159f93..023658c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
@@ -33,7 +33,7 @@
package android.hardware.radio.modem;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum DeviceStateType {
POWER_SAVE_MODE,
CHARGING_STATE,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl
index d453cb0..7d5537f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl
@@ -36,7 +36,7 @@
@JavaDerive(toString=true) @VintfStability
parcelable HardwareConfigModem {
int rilModel;
- android.hardware.radio.RadioTechnology rat;
+ android.hardware.radio.RadioTechnology rat = android.hardware.radio.RadioTechnology.UNKNOWN;
int maxVoiceCalls;
int maxDataCalls;
int maxStandby;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
index a2df30d..96fb5a8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
@@ -35,11 +35,12 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ImeiInfo {
- android.hardware.radio.modem.ImeiInfo.ImeiType type;
+ android.hardware.radio.modem.ImeiInfo.ImeiType type = android.hardware.radio.modem.ImeiInfo.ImeiType.INVALID;
String imei;
String svn;
@Backing(type="int") @VintfStability
enum ImeiType {
+ INVALID = 0,
PRIMARY = 1,
SECONDARY = 2,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl
index f97b9a2..bafcd19 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl
@@ -32,51 +32,175 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
-/**
- * @hide
- * @deprecated NV APIs are deprecated starting from Android U.
- */
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum NvItem {
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
+ INVALID = 0,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_MEID = 1,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_MIN = 2,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_MDN = 3,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_ACCOLC = 4,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
DEVICE_MSL = 11,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
RTN_RECONDITIONED_STATUS = 12,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
RTN_ACTIVATION_DATE = 13,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
RTN_LIFE_TIMER = 14,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
RTN_LIFE_CALLS = 15,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
RTN_LIFE_DATA_TX = 16,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
RTN_LIFE_DATA_RX = 17,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
OMADM_HFA_LEVEL = 18,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_NAI = 31,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_HOME_ADDRESS = 32,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_AAA_AUTH = 33,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_HA_AUTH = 34,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_PRI_HA_ADDR = 35,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_SEC_HA_ADDR = 36,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_REV_TUN_PREF = 37,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_HA_SPI = 38,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_AAA_SPI = 39,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_MN_HA_SS = 40,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
MIP_PROFILE_MN_AAA_SS = 41,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_PRL_VERSION = 51,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_BC10 = 52,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_BC14 = 53,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_SO68 = 54,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_SO73_COP0 = 55,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_SO73_COP1TO7 = 56,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_1X_ADVANCED_ENABLED = 57,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_EHRPD_ENABLED = 58,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
CDMA_EHRPD_FORCED = 59,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_BAND_ENABLE_25 = 71,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_BAND_ENABLE_26 = 72,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_BAND_ENABLE_41 = 73,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_SCAN_PRIORITY_25 = 74,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_SCAN_PRIORITY_26 = 75,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_SCAN_PRIORITY_41 = 76,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_HIDDEN_BAND_PRIORITY_25 = 77,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_HIDDEN_BAND_PRIORITY_26 = 78,
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
LTE_HIDDEN_BAND_PRIORITY_41 = 79,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl
index c38ceb7..c941246 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl
@@ -32,12 +32,15 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
-/**
- * @hide
- * @deprecated NV APIs are deprecated starting from Android U.
- */
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable NvWriteItem {
- android.hardware.radio.modem.NvItem itemId;
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
+ android.hardware.radio.modem.NvItem itemId = android.hardware.radio.modem.NvItem.INVALID;
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
String value;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
index b4208b7..e9937f0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
@@ -33,7 +33,7 @@
package android.hardware.radio.modem;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum ResetNvType {
RELOAD,
ERASE,
diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
index 7ca4021..6ad47fc 100644
--- a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
@@ -36,7 +36,7 @@
* Radio access technology. Set UNKNOWN if the Activity statistics
* is RAT independent.
*/
- AccessNetwork rat;
+ AccessNetwork rat = AccessNetwork.UNKNOWN;
/**
* Frequency range. Values are FREQUENCY_RANGE_
* Set FREQUENCY_RANGE_UNKNOWN if the Activity statistics when frequency range
diff --git a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl
index c1f4cd6..86df920 100644
--- a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl
+++ b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum DeviceStateType {
/**
* Device power save mode (provided by PowerManager). True indicates the device is in
diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
index 1ba3562..4818c9e 100644
--- a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
@@ -34,7 +34,7 @@
/**
* Bitset value, based on RadioTechnology.
*/
- RadioTechnology rat;
+ RadioTechnology rat = RadioTechnology.UNKNOWN;
/**
* Maximum number of concurrent active voice calls.
*/
diff --git a/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
index 6d33505..82fade5 100644
--- a/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
@@ -29,6 +29,8 @@
* ImeiType enum is used identify the IMEI as primary or secondary as mentioned in GSMA TS.37
*/
enum ImeiType {
+ /** Must not be used. */
+ INVALID = 0,
/**
* This is the primary IMEI of the device as mentioned in the GSMA TS.37. In a multi-SIM
* device the modem must set one IMEI with this type as mentioned in GSMA TS37_2.2_REQ_8.
@@ -40,7 +42,7 @@
}
/** Primary or secondary IMEI as mentioned in GSMA spec TS.37 */
- ImeiType type;
+ ImeiType type = ImeiType.INVALID;
/**
* IMEI value, see 3gpp spec 23.003 section 6. Note: This primary IMEI mapping must be
* permanent throughout the lifetime of the device irrespective of the factory data reset,
diff --git a/radio/aidl/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/android/hardware/radio/modem/NvItem.aidl
index b405137..d646ff7 100644
--- a/radio/aidl/android/hardware/radio/modem/NvItem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/NvItem.aidl
@@ -17,7 +17,6 @@
package android.hardware.radio.modem;
/**
- * @deprecated NV APIs are deprecated starting from Android U.
* @hide
*/
@VintfStability
@@ -25,172 +24,217 @@
@JavaDerive(toString=true)
enum NvItem {
/**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
+ INVALID = 0,
+ /**
* CDMA radio and account information (items 1-10)
* CDMA MEID (hex)
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_MEID = 1,
/**
* CDMA MIN (MSID)
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_MIN = 2,
/**
* CDMA MDN
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_MDN = 3,
/**
* CDMA access overload control
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_ACCOLC = 4,
/**
* Carrier device provisioning (items 11-30)
* Device MSL
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
DEVICE_MSL = 11,
/**
* RTN reconditioned status
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
RTN_RECONDITIONED_STATUS = 12,
/**
* RTN activation date
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
RTN_ACTIVATION_DATE = 13,
/**
* RTN life timer
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
RTN_LIFE_TIMER = 14,
/**
* RTN life calls
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
RTN_LIFE_CALLS = 15,
/**
* RTN life data TX
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
RTN_LIFE_DATA_TX = 16,
/**
* RTN life data RX
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
RTN_LIFE_DATA_RX = 17,
/**
* HFA in progress
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
OMADM_HFA_LEVEL = 18,
/**
* Mobile IP profile information (items 31-50)
* NAI realm
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_NAI = 31,
/**
* MIP home address
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_HOME_ADDRESS = 32,
/**
* AAA auth
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_AAA_AUTH = 33,
/**
* HA auth
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_HA_AUTH = 34,
/**
* Primary HA address
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_PRI_HA_ADDR = 35,
/**
* Secondary HA address
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_SEC_HA_ADDR = 36,
/**
* Reverse TUN preference
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_REV_TUN_PREF = 37,
/**
* HA SPI
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_HA_SPI = 38,
/**
* AAA SPI
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_AAA_SPI = 39,
/**
* HA shared secret
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_MN_HA_SS = 40,
/**
* AAA shared secret
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
MIP_PROFILE_MN_AAA_SS = 41,
/**
* CDMA network and band config (items 51-70)
* CDMA PRL version
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_PRL_VERSION = 51,
/**
* CDMA band class 10
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_BC10 = 52,
/**
* CDMA band class 14
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_BC14 = 53,
/**
* CDMA SO68
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_SO68 = 54,
/**
* CDMA SO73 COP0
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_SO73_COP0 = 55,
/**
* CDMA SO73 COP1-7
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_SO73_COP1TO7 = 56,
/**
* CDMA 1X Advanced enabled
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_1X_ADVANCED_ENABLED = 57,
/**
* CDMA eHRPD enabled
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_EHRPD_ENABLED = 58,
/**
* CDMA eHRPD forced
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
CDMA_EHRPD_FORCED = 59,
/**
* LTE network and band config (items 71-90)
* LTE band 25 enabled
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_BAND_ENABLE_25 = 71,
/**
* LTE band 26 enabled
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_BAND_ENABLE_26 = 72,
/**
* LTE band 41 enabled
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_BAND_ENABLE_41 = 73,
/**
* LTE band 25 scan priority
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_SCAN_PRIORITY_25 = 74,
/**
* LTE band 26 scan priority
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_SCAN_PRIORITY_26 = 75,
/**
* LTE band 41 scan priority
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_SCAN_PRIORITY_41 = 76,
/**
* LTE hidden band 25 priority
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_HIDDEN_BAND_PRIORITY_25 = 77,
/**
* LTE hidden band 26 priority
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_HIDDEN_BAND_PRIORITY_26 = 78,
/**
* LTE hidden band 41 priority
+ * @deprecated NV APIs are deprecated starting from Android U.
*/
LTE_HIDDEN_BAND_PRIORITY_41 = 79,
}
diff --git a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl
index c57253b..482126a 100644
--- a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl
@@ -19,12 +19,17 @@
import android.hardware.radio.modem.NvItem;
/**
- * @deprecated NV APIs are deprecated starting from Android U.
* @hide
*/
@VintfStability
@JavaDerive(toString=true)
parcelable NvWriteItem {
- NvItem itemId;
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
+ NvItem itemId = NvItem.INVALID;
+ /**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ */
String value;
}
diff --git a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
index e290a52..b6be54d 100644
--- a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
@@ -23,6 +23,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum ResetNvType {
/**
* Reload all NV items
diff --git a/security/keymint/aidl/default/Android.bp b/security/keymint/aidl/default/Android.bp
index a7066de..ff2393c 100644
--- a/security/keymint/aidl/default/Android.bp
+++ b/security/keymint/aidl/default/Android.bp
@@ -111,6 +111,13 @@
src: "android.hardware.hardware_keystore.xml",
}
+prebuilt_etc {
+ name: "android.hardware.hardware_keystore_V3.xml",
+ sub_dir: "permissions",
+ vendor: true,
+ src: "android.hardware.hardware_keystore_V3.xml",
+}
+
rust_library {
name: "libkmr_hal_nonsecure",
crate_name: "kmr_hal_nonsecure",
diff --git a/security/keymint/aidl/default/android.hardware.hardware_keystore_V3.xml b/security/keymint/aidl/default/android.hardware.hardware_keystore_V3.xml
new file mode 100644
index 0000000..4c75596
--- /dev/null
+++ b/security/keymint/aidl/default/android.hardware.hardware_keystore_V3.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2021 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.
+-->
+<permissions>
+ <feature name="android.hardware.hardware_keystore" version="300" />
+</permissions>
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index cfe9fa7..51afa12 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -149,7 +149,7 @@
// The multiplier should never be higher than the AIDL version, but can be less
// (for example, if the implementation is from an earlier version but the HAL service
// uses the default libraries and so reports the current AIDL version).
- EXPECT_TRUE((attestation_version / 100) <= aidl_version);
+ EXPECT_LE((attestation_version / 100), aidl_version);
}
bool avb_verification_enabled() {
@@ -160,12 +160,13 @@
char nibble2hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-// Attestations don't contain everything in key authorization lists, so we need to filter the key
-// lists to produce the lists that we expect to match the attestations.
+// Attestations don't completely align with key authorization lists, so we need to filter the lists
+// to include only the tags that are in both.
auto kTagsToFilter = {
Tag::CREATION_DATETIME,
Tag::HARDWARE_TYPE,
Tag::INCLUDE_UNIQUE_ID,
+ Tag::MODULE_HASH,
};
AuthorizationSet filtered_tags(const AuthorizationSet& set) {
@@ -234,6 +235,83 @@
return boot_patch_level(key_characteristics_);
}
+std::optional<vector<uint8_t>> KeyMintAidlTestBase::getModuleHash() {
+ if (AidlVersion() < 4) {
+ // The `MODULE_HASH` tag was introduced in v4 of the HAL; earlier versions should never
+ // expect to encounter it.
+ return std::nullopt;
+ }
+
+ // The KeyMint instance should already have been informed of the `MODULE_HASH` value for the
+ // currently running system. Generate a single attestation so we can find out what the value
+ // is.
+ auto challenge = "hello";
+ auto app_id = "foo";
+ auto params = AuthorizationSetBuilder()
+ .EcdsaSigningKey(EcCurve::P_256)
+ .Digest(Digest::NONE)
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .AttestationChallenge(challenge)
+ .AttestationApplicationId(app_id)
+ .SetDefaultValidity();
+ vector<uint8_t> key_blob;
+ vector<KeyCharacteristics> key_characteristics;
+ vector<Certificate> chain;
+ auto result = GenerateKey(params, &key_blob, &key_characteristics, &chain);
+ if (result != ErrorCode::OK) {
+ ADD_FAILURE() << "Failed to generate attestation:" << result;
+ return std::nullopt;
+ }
+ KeyBlobDeleter deleter(keymint_, key_blob);
+ if (chain.empty()) {
+ ADD_FAILURE() << "No attestation cert";
+ return std::nullopt;
+ }
+
+ // Parse the attestation record in the leaf cert.
+ X509_Ptr cert(parse_cert_blob(chain[0].encodedCertificate));
+ if (cert.get() == nullptr) {
+ ADD_FAILURE() << "Failed to parse attestation cert";
+ return std::nullopt;
+ }
+ ASN1_OCTET_STRING* attest_rec = get_attestation_record(cert.get());
+ if (attest_rec == nullptr) {
+ ADD_FAILURE() << "Failed to find attestation extension";
+ return std::nullopt;
+ }
+ AuthorizationSet att_sw_enforced;
+ AuthorizationSet att_hw_enforced;
+ uint32_t att_attestation_version;
+ uint32_t att_keymint_version;
+ SecurityLevel att_attestation_security_level;
+ SecurityLevel att_keymint_security_level;
+ vector<uint8_t> att_challenge;
+ vector<uint8_t> att_unique_id;
+ vector<uint8_t> att_app_id;
+
+ auto error = parse_attestation_record(attest_rec->data, //
+ attest_rec->length, //
+ &att_attestation_version, //
+ &att_attestation_security_level, //
+ &att_keymint_version, //
+ &att_keymint_security_level, //
+ &att_challenge, //
+ &att_sw_enforced, //
+ &att_hw_enforced, //
+ &att_unique_id);
+ if (error != ErrorCode::OK) {
+ ADD_FAILURE() << "Failed to parse attestation extension";
+ return std::nullopt;
+ }
+
+ // The module hash should be present in the software-enforced list.
+ if (!att_sw_enforced.Contains(TAG_MODULE_HASH)) {
+ ADD_FAILURE() << "No TAG_MODULE_HASH in attestation extension";
+ return std::nullopt;
+ }
+ return att_sw_enforced.GetTagValue(TAG_MODULE_HASH);
+}
+
/**
* An API to determine device IDs attestation is required or not,
* which is mandatory for KeyMint version 2 and first_api_level 33 or greater.
@@ -270,12 +348,7 @@
}
// Curve 25519 was included in version 2 of the KeyMint interface.
- int32_t version = 0;
- auto status = keymint_->getInterfaceVersion(&version);
- if (!status.isOk()) {
- ADD_FAILURE() << "Failed to determine interface version";
- }
- return version >= 2;
+ return AidlVersion() >= 2;
}
void KeyMintAidlTestBase::InitializeKeyMint(std::shared_ptr<IKeyMintDevice> keyMint) {
@@ -293,6 +366,20 @@
os_version_ = getOsVersion();
os_patch_level_ = getOsPatchlevel();
vendor_patch_level_ = getVendorPatchlevel();
+
+ // TODO(b/369375199): temporary code, remove when apexd -> keystore2 -> KeyMint transmission
+ // of module info happens.
+ {
+ GTEST_LOG_(INFO) << "Setting MODULE_HASH to fake value as fallback";
+ // Ensure that a MODULE_HASH value is definitely present in KeyMint (if it's >= v4).
+ vector<uint8_t> fakeModuleHash = {
+ 0xf3, 0xf1, 0x1f, 0xe5, 0x13, 0x05, 0xfe, 0xfa, 0xe9, 0xc3, 0x53,
+ 0xef, 0x69, 0xdf, 0x9f, 0xd7, 0x0c, 0x1e, 0xcc, 0x2c, 0x2c, 0x62,
+ 0x1f, 0x5e, 0x2c, 0x1d, 0x19, 0xa1, 0xfd, 0xac, 0xa1, 0xb4,
+ };
+ vector<KeyParameter> info = {Authorization(TAG_MODULE_HASH, fakeModuleHash)};
+ keymint_->setAdditionalAttestationInfo(info);
+ }
}
int32_t KeyMintAidlTestBase::AidlVersion() const {
@@ -320,6 +407,13 @@
ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
vector<uint8_t>* key_blob,
vector<KeyCharacteristics>* key_characteristics) {
+ return GenerateKey(key_desc, key_blob, key_characteristics, &cert_chain_);
+}
+
+ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
+ vector<uint8_t>* key_blob,
+ vector<KeyCharacteristics>* key_characteristics,
+ vector<Certificate>* cert_chain) {
std::optional<AttestationKey> attest_key = std::nullopt;
vector<Certificate> attest_cert_chain;
// If an attestation is requested, but the system is RKP-only, we need to supply an explicit
@@ -340,11 +434,10 @@
attest_key.value().issuerSubjectName = make_name_from_str("Android Keystore Key");
}
- ErrorCode error =
- GenerateKey(key_desc, attest_key, key_blob, key_characteristics, &cert_chain_);
+ ErrorCode error = GenerateKey(key_desc, attest_key, key_blob, key_characteristics, cert_chain);
if (error == ErrorCode::OK && attest_cert_chain.size() > 0) {
- cert_chain_.push_back(attest_cert_chain[0]);
+ cert_chain->push_back(attest_cert_chain[0]);
}
return error;
@@ -1049,13 +1142,12 @@
int openssl_padding = RSA_NO_PADDING;
switch (padding) {
case PaddingMode::NONE:
- ASSERT_TRUE(data_size <= key_len);
+ ASSERT_LE(data_size, key_len);
ASSERT_EQ(key_len, signature.size());
openssl_padding = RSA_NO_PADDING;
break;
case PaddingMode::RSA_PKCS1_1_5_SIGN:
- ASSERT_TRUE(data_size + kPkcs1UndigestedSignaturePaddingOverhead <=
- key_len);
+ ASSERT_LE(data_size + kPkcs1UndigestedSignaturePaddingOverhead, key_len);
openssl_padding = RSA_PKCS1_PADDING;
break;
default:
@@ -1812,7 +1904,7 @@
}
}
- // Verified boot key should be all 0's if the boot state is not verified or self signed
+ // Verified Boot key should be all zeroes if the boot state is "orange".
std::string empty_boot_key(32, '\0');
std::string verified_boot_key_str((const char*)verified_boot_key.data(),
verified_boot_key.size());
@@ -2271,7 +2363,7 @@
// ATTESTATION_IDS_NOT_PROVISIONED in this case.
ASSERT_TRUE((tag == TAG_ATTESTATION_ID_IMEI || tag == TAG_ATTESTATION_ID_MEID ||
tag == TAG_ATTESTATION_ID_SECOND_IMEI))
- << "incorrect error code on attestation ID mismatch";
+ << "incorrect error code on attestation ID mismatch for " << tag;
} else {
ADD_FAILURE() << "Error code " << result
<< " returned on attestation ID mismatch, should be CANNOT_ATTEST_IDS";
@@ -2353,7 +2445,7 @@
FILE* pipe = popen(command.c_str(), "r");
if (!pipe) {
- LOG(ERROR) << "popen failed.";
+ GTEST_LOG_(ERROR) << "popen failed.";
return result;
}
@@ -2379,7 +2471,7 @@
std::string output = exec_command(cmd);
if (output.empty()) {
- LOG(ERROR) << "Command failed. Cmd: " << cmd;
+ GTEST_LOG_(ERROR) << "Command failed. Cmd: " << cmd;
return "";
}
@@ -2387,13 +2479,14 @@
::android::base::Tokenize(::android::base::Trim(output), "Device IMEI:");
if (out.size() != 1) {
- LOG(ERROR) << "Error in parsing the command output. Cmd: " << cmd;
+ GTEST_LOG_(ERROR) << "Error in parsing the command output. Cmd: " << cmd;
return "";
}
std::string imei = ::android::base::Trim(out[0]);
if (imei.compare("null") == 0) {
- LOG(WARNING) << "Failed to get IMEI from Telephony service: value is null. Cmd: " << cmd;
+ GTEST_LOG_(WARNING) << "Failed to get IMEI from Telephony service: value is null. Cmd: "
+ << cmd;
return "";
}
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
index 85ae93d..1c12136 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
@@ -103,6 +103,7 @@
uint32_t vendor_patch_level() { return vendor_patch_level_; }
uint32_t boot_patch_level(const vector<KeyCharacteristics>& key_characteristics);
uint32_t boot_patch_level();
+ std::optional<vector<uint8_t>> getModuleHash();
bool isDeviceIdAttestationRequired();
bool isSecondImeiIdAttestationRequired();
std::optional<bool> isRkpOnly();
@@ -114,6 +115,10 @@
ErrorCode GenerateKey(const AuthorizationSet& key_desc, vector<uint8_t>* key_blob,
vector<KeyCharacteristics>* key_characteristics);
+ ErrorCode GenerateKey(const AuthorizationSet& key_desc, vector<uint8_t>* key_blob,
+ vector<KeyCharacteristics>* key_characteristics,
+ vector<Certificate>* cert_chain);
+
ErrorCode GenerateKey(const AuthorizationSet& key_desc,
const optional<AttestationKey>& attest_key, vector<uint8_t>* key_blob,
vector<KeyCharacteristics>* key_characteristics,
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index 527b5e0..067db78 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -643,6 +643,7 @@
// Verify that App data, ROT and auth timeout are NOT included.
EXPECT_FALSE(auths.Contains(TAG_ROOT_OF_TRUST));
EXPECT_FALSE(auths.Contains(TAG_APPLICATION_DATA));
+ EXPECT_FALSE(auths.Contains(TAG_MODULE_HASH));
EXPECT_FALSE(auths.Contains(TAG_AUTH_TIMEOUT, 301U));
// None of the tests specify CREATION_DATETIME so check that the KeyMint implementation
@@ -2583,7 +2584,8 @@
auto result = GenerateKey(
AuthorizationSetBuilder().EcdsaKey(256).Digest(Digest::NONE).SetDefaultValidity());
ASSERT_TRUE(result == ErrorCode::UNSUPPORTED_KEY_SIZE ||
- result == ErrorCode::UNSUPPORTED_EC_CURVE);
+ result == ErrorCode::UNSUPPORTED_EC_CURVE)
+ << "unexpected result " << result;
}
/*
@@ -2604,7 +2606,7 @@
.SigningKey()
.Digest(Digest::NONE)
.SetDefaultValidity());
- ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT);
+ ASSERT_EQ(result, ErrorCode::INVALID_ARGUMENT);
}
/*
@@ -3183,7 +3185,8 @@
string result;
ErrorCode finish_error_code = Finish(message, &result);
EXPECT_TRUE(finish_error_code == ErrorCode::INVALID_INPUT_LENGTH ||
- finish_error_code == ErrorCode::INVALID_ARGUMENT);
+ finish_error_code == ErrorCode::INVALID_ARGUMENT)
+ << "unexpected error code " << finish_error_code;
// Very large message that should exceed the transfer buffer size of any reasonable TEE.
message = string(128 * 1024, 'a');
@@ -3193,7 +3196,8 @@
.Padding(PaddingMode::RSA_PKCS1_1_5_SIGN)));
finish_error_code = Finish(message, &result);
EXPECT_TRUE(finish_error_code == ErrorCode::INVALID_INPUT_LENGTH ||
- finish_error_code == ErrorCode::INVALID_ARGUMENT);
+ finish_error_code == ErrorCode::INVALID_ARGUMENT)
+ << "unexpected error code " << finish_error_code;
}
/*
@@ -3247,7 +3251,8 @@
.Digest(Digest::NONE)
.Digest(Digest::SHA1)
.Padding(PaddingMode::RSA_PKCS1_1_5_SIGN));
- ASSERT_TRUE(result == ErrorCode::UNSUPPORTED_DIGEST || result == ErrorCode::INVALID_ARGUMENT);
+ ASSERT_TRUE(result == ErrorCode::UNSUPPORTED_DIGEST || result == ErrorCode::INVALID_ARGUMENT)
+ << "unexpected result " << result;
ASSERT_EQ(ErrorCode::UNSUPPORTED_DIGEST,
Begin(KeyPurpose::SIGN,
@@ -3420,7 +3425,8 @@
}
auto rc = DeleteKey();
- ASSERT_TRUE(rc == ErrorCode::OK || rc == ErrorCode::UNIMPLEMENTED);
+ ASSERT_TRUE(rc == ErrorCode::OK || rc == ErrorCode::UNIMPLEMENTED)
+ << "unexpected result " << rc;
}
}
@@ -5704,7 +5710,8 @@
// is checked against those values, and found absent.
auto result = Begin(KeyPurpose::DECRYPT, params);
EXPECT_TRUE(result == ErrorCode::UNSUPPORTED_MGF_DIGEST ||
- result == ErrorCode::INCOMPATIBLE_MGF_DIGEST);
+ result == ErrorCode::INCOMPATIBLE_MGF_DIGEST)
+ << "unexpected result " << result;
}
/*
@@ -5969,14 +5976,16 @@
.BlockMode(BlockMode::ECB)
.Padding(PaddingMode::NONE));
EXPECT_TRUE(result == ErrorCode::INCOMPATIBLE_BLOCK_MODE ||
- result == ErrorCode::UNSUPPORTED_BLOCK_MODE);
+ result == ErrorCode::UNSUPPORTED_BLOCK_MODE)
+ << "unexpected result " << result;
result = Begin(KeyPurpose::ENCRYPT, AuthorizationSetBuilder()
.BlockMode(BlockMode::ECB)
.Padding(PaddingMode::NONE)
.Padding(PaddingMode::PKCS7));
EXPECT_TRUE(result == ErrorCode::INCOMPATIBLE_PADDING_MODE ||
- result == ErrorCode::UNSUPPORTED_PADDING_MODE);
+ result == ErrorCode::UNSUPPORTED_PADDING_MODE)
+ << "unexpected result " << result;
}
/*
@@ -8759,7 +8768,8 @@
// Re-enable and run at your own risk.
TEST_P(DestroyAttestationIdsTest, DISABLED_DestroyTest) {
auto result = DestroyAttestationIds();
- EXPECT_TRUE(result == ErrorCode::OK || result == ErrorCode::UNIMPLEMENTED);
+ EXPECT_TRUE(result == ErrorCode::OK || result == ErrorCode::UNIMPLEMENTED)
+ << "unexpected result " << result;
}
INSTANTIATE_KEYMINT_AIDL_TEST(DestroyAttestationIdsTest);
@@ -8892,6 +8902,49 @@
INSTANTIATE_KEYMINT_AIDL_TEST(EarlyBootKeyTest);
+using ModuleHashTest = KeyMintAidlTestBase;
+
+TEST_P(ModuleHashTest, SetSameValue) {
+ if (AidlVersion() < 4) {
+ GTEST_SKIP() << "Module hash only available for >= v4, this device is v" << AidlVersion();
+ }
+ auto module_hash = getModuleHash();
+ ASSERT_TRUE(module_hash.has_value());
+
+ // Setting the same value that's already there should work.
+ vector<KeyParameter> info = {Authorization(TAG_MODULE_HASH, module_hash.value())};
+ EXPECT_TRUE(keymint_->setAdditionalAttestationInfo(info).isOk());
+}
+
+TEST_P(ModuleHashTest, SetDifferentValue) {
+ if (AidlVersion() < 4) {
+ GTEST_SKIP() << "Module hash only available for >= v4, this device is v" << AidlVersion();
+ }
+ auto module_hash = getModuleHash();
+ ASSERT_TRUE(module_hash.has_value());
+ vector<uint8_t> wrong_hash = module_hash.value();
+ ASSERT_EQ(wrong_hash.size(), 32);
+
+ // Setting a slightly different value should fail.
+ wrong_hash[0] ^= 0x01;
+ vector<KeyParameter> info = {Authorization(TAG_MODULE_HASH, wrong_hash)};
+ EXPECT_EQ(GetReturnErrorCode(keymint_->setAdditionalAttestationInfo(info)),
+ ErrorCode::MODULE_HASH_ALREADY_SET);
+}
+
+TEST_P(ModuleHashTest, SetUnrelatedTag) {
+ if (AidlVersion() < 4) {
+ GTEST_SKIP() << "Module hash only available for >= v4, this device is v" << AidlVersion();
+ }
+
+ // Trying to set an unexpected tag should be silently ignored..
+ vector<uint8_t> data = {0, 1, 2, 3, 4};
+ vector<KeyParameter> info = {Authorization(TAG_ROOT_OF_TRUST, data)};
+ EXPECT_EQ(GetReturnErrorCode(keymint_->setAdditionalAttestationInfo(info)), ErrorCode::OK);
+}
+
+INSTANTIATE_KEYMINT_AIDL_TEST(ModuleHashTest);
+
using VsrRequirementTest = KeyMintAidlTestBase;
// @VsrTest = VSR-3.10-008
@@ -8912,6 +8965,18 @@
EXPECT_GE(AidlVersion(), 3) << "VSR 14+ requires KeyMint version 3";
}
+// @VsrTest = GMS-VSR-3.10-019
+TEST_P(VsrRequirementTest, Vsr16Test) {
+ int vsr_api_level = get_vsr_api_level();
+ if (vsr_api_level <= __ANDROID_API_V__) {
+ GTEST_SKIP() << "Applies only to VSR API level > 35, this device is: " << vsr_api_level;
+ }
+ if (SecLevel() == SecurityLevel::STRONGBOX) {
+ GTEST_SKIP() << "Applies only to TEE KeyMint, not StrongBox KeyMint";
+ }
+ EXPECT_GE(AidlVersion(), 4) << "VSR 16+ requires KeyMint version 4 in TEE";
+}
+
INSTANTIATE_KEYMINT_AIDL_TEST(VsrRequirementTest);
class InstanceTest : public testing::Test {
diff --git a/security/keymint/support/Android.bp b/security/keymint/support/Android.bp
index f313cf3..7050141 100644
--- a/security/keymint/support/Android.bp
+++ b/security/keymint/support/Android.bp
@@ -30,6 +30,7 @@
"-Wall",
"-Wextra",
"-Werror",
+ "-DKEYMINT_HAL_V4",
],
srcs: [
"attestation_record.cpp",
@@ -114,6 +115,7 @@
cc_test {
name: "libkeymint_remote_prov_support_test",
+ cpp_std: "c++20",
srcs: ["remote_prov_utils_test.cpp"],
static_libs: [
"android.hardware.security.rkp-V3-ndk",
diff --git a/security/keymint/support/attestation_record.cpp b/security/keymint/support/attestation_record.cpp
index 5a26611..d2cbf88 100644
--- a/security/keymint/support/attestation_record.cpp
+++ b/security/keymint/support/attestation_record.cpp
@@ -106,6 +106,7 @@
ASN1_NULL* device_unique_attestation;
ASN1_NULL* identity_credential;
ASN1_OCTET_STRING* attestation_id_second_imei;
+ ASN1_OCTET_STRING* module_hash;
} KM_AUTH_LIST;
ASN1_SEQUENCE(KM_AUTH_LIST) = {
@@ -173,6 +174,7 @@
TAG_IDENTITY_CREDENTIAL_KEY.maskedTag()),
ASN1_EXP_OPT(KM_AUTH_LIST, attestation_id_second_imei, ASN1_OCTET_STRING,
TAG_ATTESTATION_ID_SECOND_IMEI.maskedTag()),
+ ASN1_EXP_OPT(KM_AUTH_LIST, module_hash, ASN1_OCTET_STRING, TAG_MODULE_HASH.maskedTag()),
} ASN1_SEQUENCE_END(KM_AUTH_LIST);
IMPLEMENT_ASN1_FUNCTIONS(KM_AUTH_LIST);
@@ -327,6 +329,7 @@
copyAuthTag(record->device_unique_attestation, TAG_DEVICE_UNIQUE_ATTESTATION, auth_list);
copyAuthTag(record->identity_credential, TAG_IDENTITY_CREDENTIAL_KEY, auth_list);
copyAuthTag(record->attestation_id_second_imei, TAG_ATTESTATION_ID_SECOND_IMEI, auth_list);
+ copyAuthTag(record->module_hash, TAG_MODULE_HASH, auth_list);
return ErrorCode::OK;
}
diff --git a/security/keymint/support/fuzzer/keymint_remote_prov_fuzzer.cpp b/security/keymint/support/fuzzer/keymint_remote_prov_fuzzer.cpp
index 9b74fbb..ebccf25 100644
--- a/security/keymint/support/fuzzer/keymint_remote_prov_fuzzer.cpp
+++ b/security/keymint/support/fuzzer/keymint_remote_prov_fuzzer.cpp
@@ -74,16 +74,20 @@
uint8_t challengeSize = mFdp.ConsumeIntegralInRange<uint8_t>(kMinSize, kChallengeSize);
std::vector<uint8_t> challenge = mFdp.ConsumeBytes<uint8_t>(challengeSize);
+ RpcHardwareInfo rpcHardwareInfo;
+ gRPC->getHardwareInfo(&rpcHardwareInfo);
+
std::vector<uint8_t> csr;
gRPC->generateCertificateRequestV2(keysToSign, challenge, &csr);
while (mFdp.remaining_bytes()) {
auto invokeProvAPI = mFdp.PickValueInArray<const std::function<void()>>({
[&]() {
- verifyFactoryCsr(cborKeysToSign, csr, gRPC.get(), kServiceName, challenge);
+ verifyFactoryCsr(cborKeysToSign, csr, rpcHardwareInfo, kServiceName, challenge);
},
[&]() {
- verifyProductionCsr(cborKeysToSign, csr, gRPC.get(), kServiceName, challenge);
+ verifyProductionCsr(cborKeysToSign, csr, rpcHardwareInfo, kServiceName,
+ challenge);
},
[&]() { isCsrWithProperDiceChain(csr, kServiceName); },
});
diff --git a/security/keymint/support/include/keymint_support/keymint_tags.h b/security/keymint/support/include/keymint_support/keymint_tags.h
index 823899a..89c9c0b 100644
--- a/security/keymint/support/include/keymint_support/keymint_tags.h
+++ b/security/keymint/support/include/keymint_support/keymint_tags.h
@@ -103,6 +103,15 @@
DECLARE_TYPED_TAG(MAX_USES_PER_BOOT);
DECLARE_TYPED_TAG(MIN_MAC_LENGTH);
DECLARE_TYPED_TAG(MIN_SECONDS_BETWEEN_OPS);
+// TODO: remove special case macro once v4 HAL is frozen
+#ifdef KEYMINT_HAL_V4
+DECLARE_TYPED_TAG(MODULE_HASH);
+#else
+// When building for previous frozen HAL, the `Tag::MODULE_NAME` constant is not available.
+static const Tag Tag_MODULE_HASH = static_cast<Tag>(-1879047468);
+typedef typename Tag2TypedTag<Tag_MODULE_HASH>::type TAG_MODULE_HASH_t;
+static TAG_MODULE_HASH_t TAG_MODULE_HASH;
+#endif
DECLARE_TYPED_TAG(NONCE);
DECLARE_TYPED_TAG(NO_AUTH_REQUIRED);
DECLARE_TYPED_TAG(ORIGIN);
diff --git a/security/keymint/support/include/remote_prov/MockIRemotelyProvisionedComponent.h b/security/keymint/support/include/remote_prov/MockIRemotelyProvisionedComponent.h
deleted file mode 100644
index 4fa39c2..0000000
--- a/security/keymint/support/include/remote_prov/MockIRemotelyProvisionedComponent.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2024 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.
- */
-
-#pragma once
-
-#include <aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.h>
-#include <aidl/android/hardware/security/keymint/RpcHardwareInfo.h>
-#include <android-base/properties.h>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-#include <cstdint>
-
-namespace aidl::android::hardware::security::keymint::remote_prov {
-
-using ::ndk::ScopedAStatus;
-
-class MockIRemotelyProvisionedComponent : public IRemotelyProvisionedComponentDefault {
- public:
- MOCK_METHOD(ScopedAStatus, getHardwareInfo, (RpcHardwareInfo * _aidl_return), (override));
- MOCK_METHOD(ScopedAStatus, generateEcdsaP256KeyPair,
- (bool in_testMode, MacedPublicKey* out_macedPublicKey,
- std::vector<uint8_t>* _aidl_return),
- (override));
- MOCK_METHOD(ScopedAStatus, generateCertificateRequest,
- (bool in_testMode, const std::vector<MacedPublicKey>& in_keysToSign,
- const std::vector<uint8_t>& in_endpointEncryptionCertChain,
- const std::vector<uint8_t>& in_challenge, DeviceInfo* out_deviceInfo,
- ProtectedData* out_protectedData, std::vector<uint8_t>* _aidl_return),
- (override));
- MOCK_METHOD(ScopedAStatus, generateCertificateRequestV2,
- (const std::vector<MacedPublicKey>& in_keysToSign,
- const std::vector<uint8_t>& in_challenge, std::vector<uint8_t>* _aidl_return),
- (override));
- MOCK_METHOD(ScopedAStatus, getInterfaceVersion, (int32_t* _aidl_return), (override));
- MOCK_METHOD(ScopedAStatus, getInterfaceHash, (std::string * _aidl_return), (override));
-};
-
-} // namespace aidl::android::hardware::security::keymint::remote_prov
\ No newline at end of file
diff --git a/security/keymint/support/include/remote_prov/remote_prov_utils.h b/security/keymint/support/include/remote_prov/remote_prov_utils.h
index caeb7ff..6cb00f2 100644
--- a/security/keymint/support/include/remote_prov/remote_prov_utils.h
+++ b/security/keymint/support/include/remote_prov/remote_prov_utils.h
@@ -99,7 +99,7 @@
* e.g. for "android.hardware.security.keymint.IRemotelyProvisionedComponent/avf",
* it returns "avf".
*/
-std::string deviceSuffix(const std::string& name);
+std::string_view deviceSuffix(std::string_view name);
struct EekChain {
bytevec chain;
@@ -153,7 +153,7 @@
* is parsed in the manufacturing process.
*/
ErrMsgOr<std::unique_ptr<cppbor::Map>> parseAndValidateFactoryDeviceInfo(
- const std::vector<uint8_t>& deviceInfoBytes, IRemotelyProvisionedComponent* provisionable);
+ const std::vector<uint8_t>& deviceInfoBytes, const RpcHardwareInfo& info);
/**
* Parses a DeviceInfo structure from the given CBOR data. The parsed data is then validated to
@@ -162,7 +162,7 @@
* suitable for the end user.
*/
ErrMsgOr<std::unique_ptr<cppbor::Map>> parseAndValidateProductionDeviceInfo(
- const std::vector<uint8_t>& deviceInfoBytes, IRemotelyProvisionedComponent* provisionable);
+ const std::vector<uint8_t>& deviceInfoBytes, const RpcHardwareInfo& info);
/**
* Verify the protected data as if the device is still early in the factory process and may not
@@ -171,36 +171,39 @@
ErrMsgOr<std::vector<BccEntryData>> verifyFactoryProtectedData(
const DeviceInfo& deviceInfo, const cppbor::Array& keysToSign,
const std::vector<uint8_t>& keysToSignMac, const ProtectedData& protectedData,
- const EekChain& eekChain, const std::vector<uint8_t>& eekId, int32_t supportedEekCurve,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
- const std::vector<uint8_t>& challenge);
+ const EekChain& eekChain, const std::vector<uint8_t>& eekId, const RpcHardwareInfo& info,
+ const std::string& instanceName, const std::vector<uint8_t>& challenge);
/**
* Verify the protected data as if the device is a final production sample.
*/
ErrMsgOr<std::vector<BccEntryData>> verifyProductionProtectedData(
const DeviceInfo& deviceInfo, const cppbor::Array& keysToSign,
const std::vector<uint8_t>& keysToSignMac, const ProtectedData& protectedData,
- const EekChain& eekChain, const std::vector<uint8_t>& eekId, int32_t supportedEekCurve,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
- const std::vector<uint8_t>& challenge, bool allowAnyMode = false);
+ const EekChain& eekChain, const std::vector<uint8_t>& eekId, const RpcHardwareInfo& info,
+ const std::string& instanceName, const std::vector<uint8_t>& challenge,
+ bool allowAnyMode = false);
/**
* Verify the CSR as if the device is still early in the factory process and may not
* have all device identifiers provisioned yet.
*/
-ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyFactoryCsr(
- const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
- const std::vector<uint8_t>& challenge, bool allowDegenerate = true,
- bool requireUdsCerts = false);
+ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyFactoryCsr(const cppbor::Array& keysToSign,
+ const std::vector<uint8_t>& csr,
+ const RpcHardwareInfo& info,
+ const std::string& instanceName,
+ const std::vector<uint8_t>& challenge,
+ bool allowDegenerate = true,
+ bool requireUdsCerts = false);
/**
* Verify the CSR as if the device is a final production sample.
*/
-ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyProductionCsr(
- const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
- const std::vector<uint8_t>& challenge, bool allowAnyMode = false);
+ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyProductionCsr(const cppbor::Array& keysToSign,
+ const std::vector<uint8_t>& csr,
+ const RpcHardwareInfo& info,
+ const std::string& instanceName,
+ const std::vector<uint8_t>& challenge,
+ bool allowAnyMode = false);
/** Checks whether the CSR has a proper DICE chain. */
ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& csr,
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index 464d912..e11f021 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -52,8 +52,8 @@
using X509_Ptr = bssl::UniquePtr<X509>;
using CRYPTO_BUFFER_Ptr = bssl::UniquePtr<CRYPTO_BUFFER>;
-std::string deviceSuffix(const std::string& name) {
- size_t pos = name.rfind('/');
+std::string_view deviceSuffix(std::string_view name) {
+ auto pos = name.rfind('/');
if (pos == std::string::npos) {
return name;
}
@@ -483,7 +483,7 @@
}
ErrMsgOr<std::unique_ptr<cppbor::Map>> parseAndValidateDeviceInfo(
- const std::vector<uint8_t>& deviceInfoBytes, IRemotelyProvisionedComponent* provisionable,
+ const std::vector<uint8_t>& deviceInfoBytes, const RpcHardwareInfo& rpcHardwareInfo,
bool isFactory) {
const cppbor::Array kValidVbStates = {"green", "yellow", "orange"};
const cppbor::Array kValidBootloaderStates = {"locked", "unlocked"};
@@ -530,9 +530,7 @@
return "DeviceInfo ordering is non-canonical.";
}
- RpcHardwareInfo info;
- provisionable->getHardwareInfo(&info);
- if (info.versionNumber < 3) {
+ if (rpcHardwareInfo.versionNumber < 3) {
const std::unique_ptr<cppbor::Item>& version = parsed->get("version");
if (!version) {
return "Device info is missing version";
@@ -540,10 +538,10 @@
if (!version->asUint()) {
return "version must be an unsigned integer";
}
- if (version->asUint()->value() != info.versionNumber) {
+ if (version->asUint()->value() != rpcHardwareInfo.versionNumber) {
return "DeviceInfo version (" + std::to_string(version->asUint()->value()) +
") does not match the remotely provisioned component version (" +
- std::to_string(info.versionNumber) + ").";
+ std::to_string(rpcHardwareInfo.versionNumber) + ").";
}
}
// Bypasses the device info validation since the device info in AVF is currently
@@ -552,14 +550,14 @@
// TODO(b/300911665): This check is temporary and will be replaced once the markers
// on the DICE chain become available. We need to determine if the CSR is from the
// RKP VM using the markers on the DICE chain.
- if (info.uniqueId == "AVF Remote Provisioning 1") {
+ if (rpcHardwareInfo.uniqueId == "AVF Remote Provisioning 1") {
return std::move(parsed);
}
std::string error;
std::string tmp;
std::set<std::string_view> previousKeys;
- switch (info.versionNumber) {
+ switch (rpcHardwareInfo.versionNumber) {
case 3:
if (isTeeDeviceInfo(*parsed) && parsed->size() != kNumTeeDeviceInfoEntries) {
error += fmt::format(
@@ -626,7 +624,7 @@
kValidAttIdStates);
break;
default:
- return "Unrecognized version: " + std::to_string(info.versionNumber);
+ return "Unrecognized version: " + std::to_string(rpcHardwareInfo.versionNumber);
}
if (!error.empty()) {
@@ -637,13 +635,13 @@
}
ErrMsgOr<std::unique_ptr<cppbor::Map>> parseAndValidateFactoryDeviceInfo(
- const std::vector<uint8_t>& deviceInfoBytes, IRemotelyProvisionedComponent* provisionable) {
- return parseAndValidateDeviceInfo(deviceInfoBytes, provisionable, /*isFactory=*/true);
+ const std::vector<uint8_t>& deviceInfoBytes, const RpcHardwareInfo& rpcHardwareInfo) {
+ return parseAndValidateDeviceInfo(deviceInfoBytes, rpcHardwareInfo, /*isFactory=*/true);
}
ErrMsgOr<std::unique_ptr<cppbor::Map>> parseAndValidateProductionDeviceInfo(
- const std::vector<uint8_t>& deviceInfoBytes, IRemotelyProvisionedComponent* provisionable) {
- return parseAndValidateDeviceInfo(deviceInfoBytes, provisionable, /*isFactory=*/false);
+ const std::vector<uint8_t>& deviceInfoBytes, const RpcHardwareInfo& rpcHardwareInfo) {
+ return parseAndValidateDeviceInfo(deviceInfoBytes, rpcHardwareInfo, /*isFactory=*/false);
}
ErrMsgOr<bytevec> getSessionKey(ErrMsgOr<std::pair<bytevec, bytevec>>& senderPubkey,
@@ -661,8 +659,8 @@
ErrMsgOr<std::vector<BccEntryData>> verifyProtectedData(
const DeviceInfo& deviceInfo, const cppbor::Array& keysToSign,
const std::vector<uint8_t>& keysToSignMac, const ProtectedData& protectedData,
- const EekChain& eekChain, const std::vector<uint8_t>& eekId, int32_t supportedEekCurve,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
+ const EekChain& eekChain, const std::vector<uint8_t>& eekId,
+ const RpcHardwareInfo& rpcHardwareInfo, const std::string& instanceName,
const std::vector<uint8_t>& challenge, bool isFactory, bool allowAnyMode = false) {
auto [parsedProtectedData, _, protDataErrMsg] = cppbor::parse(protectedData.protectedData);
if (!parsedProtectedData) {
@@ -685,7 +683,7 @@
return "The COSE_encrypt recipient does not match the expected EEK identifier";
}
- auto sessionKey = getSessionKey(senderPubkey, eekChain, supportedEekCurve);
+ auto sessionKey = getSessionKey(senderPubkey, eekChain, rpcHardwareInfo.supportedEekCurve);
if (!sessionKey) {
return sessionKey.message();
}
@@ -726,7 +724,7 @@
}
auto deviceInfoResult =
- parseAndValidateDeviceInfo(deviceInfo.deviceInfo, provisionable, isFactory);
+ parseAndValidateDeviceInfo(deviceInfo.deviceInfo, rpcHardwareInfo, isFactory);
if (!deviceInfoResult) {
return deviceInfoResult.message();
}
@@ -762,22 +760,22 @@
ErrMsgOr<std::vector<BccEntryData>> verifyFactoryProtectedData(
const DeviceInfo& deviceInfo, const cppbor::Array& keysToSign,
const std::vector<uint8_t>& keysToSignMac, const ProtectedData& protectedData,
- const EekChain& eekChain, const std::vector<uint8_t>& eekId, int32_t supportedEekCurve,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
+ const EekChain& eekChain, const std::vector<uint8_t>& eekId,
+ const RpcHardwareInfo& rpcHardwareInfo, const std::string& instanceName,
const std::vector<uint8_t>& challenge) {
return verifyProtectedData(deviceInfo, keysToSign, keysToSignMac, protectedData, eekChain,
- eekId, supportedEekCurve, provisionable, instanceName, challenge,
+ eekId, rpcHardwareInfo, instanceName, challenge,
/*isFactory=*/true);
}
ErrMsgOr<std::vector<BccEntryData>> verifyProductionProtectedData(
const DeviceInfo& deviceInfo, const cppbor::Array& keysToSign,
const std::vector<uint8_t>& keysToSignMac, const ProtectedData& protectedData,
- const EekChain& eekChain, const std::vector<uint8_t>& eekId, int32_t supportedEekCurve,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
+ const EekChain& eekChain, const std::vector<uint8_t>& eekId,
+ const RpcHardwareInfo& rpcHardwareInfo, const std::string& instanceName,
const std::vector<uint8_t>& challenge, bool allowAnyMode) {
return verifyProtectedData(deviceInfo, keysToSign, keysToSignMac, protectedData, eekChain,
- eekId, supportedEekCurve, provisionable, instanceName, challenge,
+ eekId, rpcHardwareInfo, instanceName, challenge,
/*isFactory=*/false, allowAnyMode);
}
@@ -912,7 +910,7 @@
ErrMsgOr<std::unique_ptr<cppbor::Array>> parseAndValidateCsrPayload(
const cppbor::Array& keysToSign, const std::vector<uint8_t>& csrPayload,
- IRemotelyProvisionedComponent* provisionable, bool isFactory) {
+ const RpcHardwareInfo& rpcHardwareInfo, bool isFactory) {
auto [parsedCsrPayload, _, errMsg] = cppbor::parse(csrPayload);
if (!parsedCsrPayload) {
return errMsg;
@@ -949,7 +947,8 @@
return "Keys must be an Array.";
}
- auto result = parseAndValidateDeviceInfo(signedDeviceInfo->encode(), provisionable, isFactory);
+ auto result =
+ parseAndValidateDeviceInfo(signedDeviceInfo->encode(), rpcHardwareInfo, isFactory);
if (!result) {
return result.message();
}
@@ -1100,13 +1099,12 @@
ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyCsr(
const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
+ const RpcHardwareInfo& rpcHardwareInfo, const std::string& instanceName,
const std::vector<uint8_t>& challenge, bool isFactory, bool allowAnyMode = false,
bool allowDegenerate = true, bool requireUdsCerts = false) {
- RpcHardwareInfo info;
- provisionable->getHardwareInfo(&info);
- if (info.versionNumber != 3) {
- return "Remotely provisioned component version (" + std::to_string(info.versionNumber) +
+ if (rpcHardwareInfo.versionNumber != 3) {
+ return "Remotely provisioned component version (" +
+ std::to_string(rpcHardwareInfo.versionNumber) +
") does not match expected version (3).";
}
@@ -1117,61 +1115,46 @@
return csrPayload.message();
}
- return parseAndValidateCsrPayload(keysToSign, *csrPayload, provisionable, isFactory);
+ return parseAndValidateCsrPayload(keysToSign, *csrPayload, rpcHardwareInfo, isFactory);
}
ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyFactoryCsr(
const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
+ const RpcHardwareInfo& rpcHardwareInfo, const std::string& instanceName,
const std::vector<uint8_t>& challenge, bool allowDegenerate, bool requireUdsCerts) {
- return verifyCsr(keysToSign, csr, provisionable, instanceName, challenge, /*isFactory=*/true,
+ return verifyCsr(keysToSign, csr, rpcHardwareInfo, instanceName, challenge, /*isFactory=*/true,
/*allowAnyMode=*/false, allowDegenerate, requireUdsCerts);
}
-ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyProductionCsr(
- const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
- IRemotelyProvisionedComponent* provisionable, const std::string& instanceName,
- const std::vector<uint8_t>& challenge, bool allowAnyMode) {
- return verifyCsr(keysToSign, csr, provisionable, instanceName, challenge, /*isFactory=*/false,
+ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyProductionCsr(const cppbor::Array& keysToSign,
+ const std::vector<uint8_t>& csr,
+ const RpcHardwareInfo& rpcHardwareInfo,
+ const std::string& instanceName,
+ const std::vector<uint8_t>& challenge,
+ bool allowAnyMode) {
+ return verifyCsr(keysToSign, csr, rpcHardwareInfo, instanceName, challenge, /*isFactory=*/false,
allowAnyMode);
}
-ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& csr,
+ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& encodedCsr,
const std::string& instanceName) {
- auto [parsedRequest, _, csrErrMsg] = cppbor::parse(csr);
- if (!parsedRequest) {
- return csrErrMsg;
- }
- if (!parsedRequest->asArray()) {
- return "AuthenticatedRequest is not a CBOR array.";
- }
- if (parsedRequest->asArray()->size() != 4U) {
- return "AuthenticatedRequest must contain version, UDS certificates, DICE chain, and "
- "signed data. However, the parsed AuthenticatedRequest has " +
- std::to_string(parsedRequest->asArray()->size()) + " entries.";
- }
-
- auto version = parsedRequest->asArray()->get(0)->asUint();
- auto diceCertChain = parsedRequest->asArray()->get(2)->asArray();
-
- if (!version || version->value() != 1U) {
- return "AuthenticatedRequest version must be an unsigned integer and must be equal to 1.";
- }
- if (!diceCertChain) {
- return "AuthenticatedRequest DiceCertChain must be an Array.";
- }
-
- // DICE chain is [ pubkey, + DiceChainEntry ].
auto diceChainKind = getDiceChainKind();
if (!diceChainKind) {
return diceChainKind.message();
}
- auto encodedDiceChain = diceCertChain->encode();
- auto chain = hwtrust::DiceChain::Verify(encodedDiceChain, *diceChainKind,
- /*allowAnyMode=*/false, deviceSuffix(instanceName));
- if (!chain.ok()) return chain.error().message();
- return chain->IsProper();
+ auto csr = hwtrust::Csr::validate(encodedCsr, *diceChainKind, false /*allowAnyMode*/,
+ deviceSuffix(instanceName));
+ if (!csr.ok()) {
+ return csr.error().message();
+ }
+
+ auto diceChain = csr->getDiceChain();
+ if (!diceChain.ok()) {
+ return diceChain.error().message();
+ }
+
+ return diceChain->IsProper();
}
} // namespace aidl::android::hardware::security::keymint::remote_prov
diff --git a/security/keymint/support/remote_prov_utils_test.cpp b/security/keymint/support/remote_prov_utils_test.cpp
index 8ffb149..6f6a2d6 100644
--- a/security/keymint/support/remote_prov_utils_test.cpp
+++ b/security/keymint/support/remote_prov_utils_test.cpp
@@ -25,7 +25,6 @@
#include <keymaster/logger.h>
#include <keymaster/remote_provisioning_utils.h>
#include <openssl/curve25519.h>
-#include <remote_prov/MockIRemotelyProvisionedComponent.h>
#include <remote_prov/remote_prov_utils.h>
#include <algorithm>
@@ -82,6 +81,76 @@
0x50, 0x12, 0x82, 0x37, 0xfe, 0xa4, 0x07, 0xc3, 0xd5, 0xc3, 0x78, 0xcc, 0xf9, 0xef, 0xe1,
0x95, 0x38, 0x9f, 0xb0, 0x79, 0x16, 0x4c, 0x4a, 0x23, 0xc4, 0xdc, 0x35, 0x4e, 0x0f};
+inline const std::vector<uint8_t> kCsrWithDegenerateDiceChain{
+ 0x85, 0x01, 0xa0, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x65,
+ 0xe0, 0x51, 0x62, 0x45, 0x17, 0xcc, 0xa8, 0x40, 0x41, 0x6d, 0xc0, 0x86, 0x7a, 0x15, 0x6e,
+ 0xee, 0x04, 0xae, 0xbd, 0x05, 0x13, 0x36, 0xcb, 0xd2, 0x8d, 0xd8, 0x80, 0x16, 0xc1, 0x69,
+ 0x0d, 0x22, 0x58, 0x20, 0xea, 0xa1, 0x37, 0xd5, 0x01, 0xbd, 0xe0, 0x25, 0x6a, 0x3d, 0x4c,
+ 0xcd, 0x31, 0xa1, 0x4d, 0xa6, 0x80, 0x82, 0x03, 0x40, 0xe2, 0x88, 0x81, 0x53, 0xc3, 0xb3,
+ 0x6d, 0xf7, 0xf4, 0x10, 0xde, 0x96, 0x23, 0x58, 0x20, 0x24, 0x69, 0x44, 0x6e, 0xf5, 0xcc,
+ 0x18, 0xfe, 0x63, 0xac, 0x5e, 0x85, 0x9c, 0xfc, 0x9d, 0xfa, 0x90, 0xee, 0x6c, 0xc2, 0x22,
+ 0x49, 0x02, 0xc7, 0x93, 0xf4, 0x30, 0xf1, 0x51, 0x11, 0x20, 0x33, 0x84, 0x43, 0xa1, 0x01,
+ 0x26, 0xa0, 0x58, 0x97, 0xa5, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67,
+ 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01, 0x3a,
+ 0x00, 0x47, 0x44, 0x57, 0x58, 0x70, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58,
+ 0x20, 0x65, 0xe0, 0x51, 0x62, 0x45, 0x17, 0xcc, 0xa8, 0x40, 0x41, 0x6d, 0xc0, 0x86, 0x7a,
+ 0x15, 0x6e, 0xee, 0x04, 0xae, 0xbd, 0x05, 0x13, 0x36, 0xcb, 0xd2, 0x8d, 0xd8, 0x80, 0x16,
+ 0xc1, 0x69, 0x0d, 0x22, 0x58, 0x20, 0xea, 0xa1, 0x37, 0xd5, 0x01, 0xbd, 0xe0, 0x25, 0x6a,
+ 0x3d, 0x4c, 0xcd, 0x31, 0xa1, 0x4d, 0xa6, 0x80, 0x82, 0x03, 0x40, 0xe2, 0x88, 0x81, 0x53,
+ 0xc3, 0xb3, 0x6d, 0xf7, 0xf4, 0x10, 0xde, 0x96, 0x23, 0x58, 0x20, 0x24, 0x69, 0x44, 0x6e,
+ 0xf5, 0xcc, 0x18, 0xfe, 0x63, 0xac, 0x5e, 0x85, 0x9c, 0xfc, 0x9d, 0xfa, 0x90, 0xee, 0x6c,
+ 0xc2, 0x22, 0x49, 0x02, 0xc7, 0x93, 0xf4, 0x30, 0xf1, 0x51, 0x11, 0x20, 0x33, 0x3a, 0x00,
+ 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40, 0x16, 0xb9, 0x51, 0xdf, 0x31, 0xad, 0xa0, 0x3d,
+ 0x98, 0x40, 0x85, 0xdf, 0xd9, 0xbe, 0xf6, 0x79, 0x62, 0x36, 0x8b, 0x60, 0xaa, 0x79, 0x8e,
+ 0x52, 0x04, 0xdd, 0xba, 0x39, 0xa2, 0x58, 0x9c, 0x60, 0xd5, 0x96, 0x51, 0x42, 0xe2, 0xa5,
+ 0x57, 0x58, 0xb4, 0x89, 0x2c, 0x94, 0xb9, 0xda, 0xe7, 0x93, 0x85, 0xda, 0x64, 0xa0, 0x52,
+ 0xfc, 0x6b, 0xb1, 0x0a, 0xa8, 0x13, 0xd9, 0x84, 0xfb, 0x34, 0x77, 0x84, 0x43, 0xa1, 0x01,
+ 0x26, 0xa0, 0x59, 0x02, 0x0f, 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xe9, 0x84, 0x03,
+ 0x67, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64,
+ 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76,
+ 0x69, 0x63, 0x65, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64,
+ 0x75, 0x63, 0x74, 0x65, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74,
+ 0x61, 0x74, 0x65, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61,
+ 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76,
+ 0x62, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22,
+ 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73,
+ 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74,
+ 0x65, 0x65, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c,
+ 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c,
+ 0x6f, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x65, 0x64, 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63,
+ 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65,
+ 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65,
+ 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21,
+ 0x58, 0x20, 0x46, 0xbd, 0xfc, 0xed, 0xa6, 0x94, 0x9a, 0xc4, 0x5e, 0x27, 0xcf, 0x24, 0x25,
+ 0xc5, 0x0c, 0x7d, 0xed, 0x8f, 0x21, 0xe0, 0x47, 0x81, 0x5a, 0xdc, 0x3b, 0xd4, 0x9e, 0x13,
+ 0xb6, 0x06, 0x36, 0x70, 0x22, 0x58, 0x20, 0x0a, 0xbd, 0xbc, 0x0d, 0x19, 0xba, 0xcc, 0xdc,
+ 0x00, 0x64, 0x31, 0x4c, 0x84, 0x66, 0x1d, 0xfb, 0x50, 0xd0, 0xe3, 0xf8, 0x78, 0x9d, 0xf9,
+ 0x77, 0x2b, 0x40, 0x6b, 0xb5, 0x8e, 0xd3, 0xf8, 0xa9, 0x23, 0x58, 0x21, 0x00, 0x9c, 0x42,
+ 0x3f, 0x79, 0x76, 0xa0, 0xd1, 0x98, 0x58, 0xbb, 0x9b, 0x9e, 0xfb, 0x3b, 0x08, 0xf2, 0xe1,
+ 0xa3, 0xfe, 0xf4, 0x21, 0x5b, 0x97, 0x2d, 0xcb, 0x9a, 0x55, 0x1a, 0x7f, 0xa7, 0xc1, 0xa8,
+ 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xef, 0xd3, 0x88, 0xc4, 0xbc,
+ 0xce, 0x51, 0x4d, 0x4b, 0xd3, 0x81, 0x26, 0xc6, 0xcc, 0x66, 0x3b, 0x12, 0x38, 0xbf, 0x23,
+ 0x7a, 0x2e, 0x7f, 0x82, 0xa7, 0x81, 0x74, 0x21, 0xc0, 0x12, 0x79, 0xf4, 0x22, 0x58, 0x20,
+ 0xdc, 0x85, 0x6c, 0x1c, 0xcc, 0xf9, 0xf3, 0xe8, 0xff, 0x90, 0xfd, 0x89, 0x03, 0xf5, 0xaf,
+ 0x75, 0xa0, 0x79, 0xbb, 0x53, 0x9a, 0x1f, 0x2b, 0x34, 0x86, 0x47, 0x3d, 0x66, 0x2a, 0x07,
+ 0x3b, 0x1e, 0x23, 0x58, 0x20, 0x34, 0x7b, 0x15, 0xcc, 0xbf, 0x26, 0xc9, 0x28, 0x0e, 0xee,
+ 0xc5, 0x47, 0xac, 0x00, 0xc4, 0x4d, 0x81, 0x2b, 0x1e, 0xac, 0x31, 0xd2, 0x6f, 0x36, 0x85,
+ 0xe6, 0xa8, 0xf0, 0x46, 0xfc, 0xd2, 0x83, 0x58, 0x40, 0x55, 0x4c, 0x38, 0xdf, 0xfe, 0x49,
+ 0xa8, 0xa0, 0xa5, 0x08, 0xce, 0x2f, 0xe5, 0xf6, 0x6e, 0x2b, 0xc2, 0x95, 0x39, 0xc8, 0xca,
+ 0x77, 0xd6, 0xf6, 0x67, 0x24, 0x6b, 0x0e, 0x63, 0x5d, 0x11, 0x97, 0x26, 0x52, 0x30, 0xbc,
+ 0x28, 0x1d, 0xbf, 0x2a, 0x3e, 0x8c, 0x90, 0x54, 0xaa, 0xaa, 0xd1, 0x7c, 0x53, 0x7b, 0x48,
+ 0x1f, 0x51, 0x50, 0x6c, 0x32, 0xe1, 0x0f, 0x57, 0xea, 0x47, 0x76, 0x85, 0x0c, 0xa1, 0x6b,
+ 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62, 0x72,
+ 0x61, 0x6e, 0x64, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f, 0x64,
+ 0x65, 0x76, 0x69, 0x63, 0x65, 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32, 0x30,
+ 0x32, 0x31, 0x30, 0x38, 0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
+
// The challenge that is in kKeysToSignForCsrWithUdsCerts and kCsrWithUdsCerts
inline const std::vector<uint8_t> kChallenge{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
@@ -328,6 +397,8 @@
0xa7, 0xb6, 0xc2, 0x40, 0x06, 0x65, 0xc5, 0xff, 0x19, 0xc5, 0xcd, 0x1c, 0xd5, 0x78, 0x01,
0xd4, 0xb8};
+const RpcHardwareInfo kRpcHardwareInfo = {.versionNumber = 3};
+
inline bool equal_byte_views(const byte_view& view1, const byte_view& view2) {
return std::equal(view1.begin(), view1.end(), view2.begin(), view2.end());
}
@@ -557,19 +628,26 @@
DEFAULT_INSTANCE_NAME));
}
+TEST(RemoteProvUtils, validateDiceChainProper) {
+ auto result = isCsrWithProperDiceChain(kCsrWithUdsCerts, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(result) << result.message();
+ ASSERT_TRUE(*result) << "DICE Chain is degenerate";
+}
+
+TEST(RemoteProvUtils, validateDiceChainDegenerate) {
+ auto result = isCsrWithProperDiceChain(kCsrWithDegenerateDiceChain, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(result) << result.message();
+ ASSERT_FALSE(*result) << "DICE Chain is proper";
+}
+
TEST(RemoteProvUtilsTest, requireUdsCertsWhenPresent) {
auto [keysToSignPtr, _, errMsg] = cppbor::parse(kKeysToSignForCsrWithUdsCerts);
ASSERT_TRUE(keysToSignPtr) << "Error: " << errMsg;
- auto mockRpc = SharedRefBase::make<MockIRemotelyProvisionedComponent>();
- EXPECT_CALL(*mockRpc, getHardwareInfo(NotNull())).WillRepeatedly([](RpcHardwareInfo* hwInfo) {
- hwInfo->versionNumber = 3;
- return ScopedAStatus::ok();
- });
-
const auto keysToSign = keysToSignPtr->asArray();
- auto csr = verifyFactoryCsr(*keysToSign, kCsrWithUdsCerts, mockRpc.get(), "default", kChallenge,
- /*allowDegenerate=*/false, /*requireUdsCerts=*/true);
+ auto csr =
+ verifyFactoryCsr(*keysToSign, kCsrWithUdsCerts, kRpcHardwareInfo, "default", kChallenge,
+ /*allowDegenerate=*/false, /*requireUdsCerts=*/true);
ASSERT_TRUE(csr) << csr.message();
}
@@ -577,27 +655,15 @@
auto [keysToSignPtr, _, errMsg] = cppbor::parse(kKeysToSignForCsrWithUdsCerts);
ASSERT_TRUE(keysToSignPtr) << "Error: " << errMsg;
- auto mockRpc = SharedRefBase::make<MockIRemotelyProvisionedComponent>();
- EXPECT_CALL(*mockRpc, getHardwareInfo(NotNull())).WillRepeatedly([](RpcHardwareInfo* hwInfo) {
- hwInfo->versionNumber = 3;
- return ScopedAStatus::ok();
- });
-
const auto* keysToSign = keysToSignPtr->asArray();
- auto csr = verifyFactoryCsr(*keysToSign, kCsrWithUdsCerts, mockRpc.get(), DEFAULT_INSTANCE_NAME,
- kChallenge,
+ auto csr = verifyFactoryCsr(*keysToSign, kCsrWithUdsCerts, kRpcHardwareInfo,
+ DEFAULT_INSTANCE_NAME, kChallenge,
/*allowDegenerate=*/false, /*requireUdsCerts=*/false);
ASSERT_TRUE(csr) << csr.message();
}
TEST(RemoteProvUtilsTest, requireUdsCertsWhenNotPresent) {
- auto mockRpc = SharedRefBase::make<MockIRemotelyProvisionedComponent>();
- EXPECT_CALL(*mockRpc, getHardwareInfo(NotNull())).WillRepeatedly([](RpcHardwareInfo* hwInfo) {
- hwInfo->versionNumber = 3;
- return ScopedAStatus::ok();
- });
-
- auto csr = verifyFactoryCsr(/*keysToSign=*/Array(), kCsrWithoutUdsCerts, mockRpc.get(),
+ auto csr = verifyFactoryCsr(/*keysToSign=*/Array(), kCsrWithoutUdsCerts, kRpcHardwareInfo,
DEFAULT_INSTANCE_NAME, kChallenge, /*allowDegenerate=*/false,
/*requireUdsCerts=*/true);
ASSERT_FALSE(csr);
@@ -610,14 +676,8 @@
kKeysToSignForCsrWithoutUdsCerts.data() + kKeysToSignForCsrWithoutUdsCerts.size());
ASSERT_TRUE(keysToSignPtr) << "Error: " << errMsg;
- auto mockRpc = SharedRefBase::make<MockIRemotelyProvisionedComponent>();
- EXPECT_CALL(*mockRpc, getHardwareInfo(NotNull())).WillRepeatedly([](RpcHardwareInfo* hwInfo) {
- hwInfo->versionNumber = 3;
- return ScopedAStatus::ok();
- });
-
const auto* keysToSign = keysToSignPtr->asArray();
- auto csr = verifyFactoryCsr(*keysToSign, kCsrWithoutUdsCerts, mockRpc.get(),
+ auto csr = verifyFactoryCsr(*keysToSign, kCsrWithoutUdsCerts, kRpcHardwareInfo,
DEFAULT_INSTANCE_NAME, kChallenge,
/*allowDegenerate=*/false, /*requireUdsCerts=*/false);
ASSERT_TRUE(csr) << csr.message();
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 8f918af..5467679 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -35,6 +35,7 @@
#include <remote_prov/remote_prov_utils.h>
#include <optional>
#include <set>
+#include <string_view>
#include <vector>
#include "KeyMintAidlTestBase.h"
@@ -150,22 +151,14 @@
return corruptChain.encode();
}
-string device_suffix(const string& name) {
- size_t pos = name.find('/');
- if (pos == string::npos) {
- return name;
- }
- return name.substr(pos + 1);
-}
-
bool matching_keymint_device(const string& rp_name, std::shared_ptr<IKeyMintDevice>* keyMint) {
- string rp_suffix = device_suffix(rp_name);
+ auto rp_suffix = deviceSuffix(rp_name);
vector<string> km_names = ::android::getAidlHalInstanceNames(IKeyMintDevice::descriptor);
for (const string& km_name : km_names) {
// If the suffix of the KeyMint instance equals the suffix of the
// RemotelyProvisionedComponent instance, assume they match.
- if (device_suffix(km_name) == rp_suffix && AServiceManager_isDeclared(km_name.c_str())) {
+ if (deviceSuffix(km_name) == rp_suffix && AServiceManager_isDeclared(km_name.c_str())) {
::ndk::SpAIBinder binder(AServiceManager_waitForService(km_name.c_str()));
*keyMint = IKeyMintDevice::fromBinder(binder);
return true;
@@ -489,9 +482,9 @@
&protectedData, &keysToSignMac);
ASSERT_TRUE(status.isOk()) << status.getDescription();
- auto result = verifyProductionProtectedData(
- deviceInfo, cppbor::Array(), keysToSignMac, protectedData, testEekChain_, eekId_,
- rpcHardwareInfo.supportedEekCurve, provisionable_.get(), GetParam(), challenge_);
+ auto result = verifyProductionProtectedData(deviceInfo, cppbor::Array(), keysToSignMac,
+ protectedData, testEekChain_, eekId_,
+ rpcHardwareInfo, GetParam(), challenge_);
ASSERT_TRUE(result) << result.message();
}
}
@@ -516,8 +509,7 @@
auto firstBcc = verifyProductionProtectedData(deviceInfo, /*keysToSign=*/cppbor::Array(),
keysToSignMac, protectedData, testEekChain_,
- eekId_, rpcHardwareInfo.supportedEekCurve,
- provisionable_.get(), GetParam(), challenge_);
+ eekId_, rpcHardwareInfo, GetParam(), challenge_);
ASSERT_TRUE(firstBcc) << firstBcc.message();
status = provisionable_->generateCertificateRequest(
@@ -527,8 +519,7 @@
auto secondBcc = verifyProductionProtectedData(deviceInfo, /*keysToSign=*/cppbor::Array(),
keysToSignMac, protectedData, testEekChain_,
- eekId_, rpcHardwareInfo.supportedEekCurve,
- provisionable_.get(), GetParam(), challenge_);
+ eekId_, rpcHardwareInfo, GetParam(), challenge_);
ASSERT_TRUE(secondBcc) << secondBcc.message();
// Verify that none of the keys in the first BCC are repeated in the second one.
@@ -576,9 +567,9 @@
&keysToSignMac);
ASSERT_TRUE(status.isOk()) << status.getDescription();
- auto result = verifyProductionProtectedData(
- deviceInfo, cborKeysToSign_, keysToSignMac, protectedData, testEekChain_, eekId_,
- rpcHardwareInfo.supportedEekCurve, provisionable_.get(), GetParam(), challenge_);
+ auto result = verifyProductionProtectedData(deviceInfo, cborKeysToSign_, keysToSignMac,
+ protectedData, testEekChain_, eekId_,
+ rpcHardwareInfo, GetParam(), challenge_);
ASSERT_TRUE(result) << result.message();
}
}
@@ -766,7 +757,7 @@
provisionable_->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
ASSERT_TRUE(status.isOk()) << status.getDescription();
- auto result = verifyProductionCsr(cppbor::Array(), csr, provisionable_.get(), GetParam(),
+ auto result = verifyProductionCsr(cppbor::Array(), csr, rpcHardwareInfo, GetParam(),
challenge, isRkpVmInstance_);
ASSERT_TRUE(result) << result.message();
}
@@ -788,7 +779,7 @@
auto status = provisionable_->generateCertificateRequestV2(keysToSign_, challenge, &csr);
ASSERT_TRUE(status.isOk()) << status.getDescription();
- auto result = verifyProductionCsr(cborKeysToSign_, csr, provisionable_.get(), GetParam(),
+ auto result = verifyProductionCsr(cborKeysToSign_, csr, rpcHardwareInfo, GetParam(),
challenge, isRkpVmInstance_);
ASSERT_TRUE(result) << result.message();
}
@@ -819,14 +810,14 @@
auto status = provisionable_->generateCertificateRequestV2(keysToSign_, challenge_, &csr);
ASSERT_TRUE(status.isOk()) << status.getDescription();
- auto firstCsr = verifyProductionCsr(cborKeysToSign_, csr, provisionable_.get(), GetParam(),
+ auto firstCsr = verifyProductionCsr(cborKeysToSign_, csr, rpcHardwareInfo, GetParam(),
challenge_, isRkpVmInstance_);
ASSERT_TRUE(firstCsr) << firstCsr.message();
status = provisionable_->generateCertificateRequestV2(keysToSign_, challenge_, &csr);
ASSERT_TRUE(status.isOk()) << status.getDescription();
- auto secondCsr = verifyProductionCsr(cborKeysToSign_, csr, provisionable_.get(), GetParam(),
+ auto secondCsr = verifyProductionCsr(cborKeysToSign_, csr, rpcHardwareInfo, GetParam(),
challenge_, isRkpVmInstance_);
ASSERT_TRUE(secondCsr) << secondCsr.message();
@@ -845,8 +836,8 @@
auto status = provisionable_->generateCertificateRequestV2(keysToSign_, challenge_, &csr);
ASSERT_TRUE(status.isOk()) << status.getDescription();
- auto result = verifyProductionCsr(cborKeysToSign_, csr, provisionable_.get(), GetParam(),
- challenge_, isRkpVmInstance_);
+ auto result = verifyProductionCsr(cborKeysToSign_, csr, rpcHardwareInfo, GetParam(), challenge_,
+ isRkpVmInstance_);
ASSERT_TRUE(result) << result.message();
}
@@ -977,7 +968,7 @@
ASSERT_TRUE(irpcStatus.isOk()) << irpcStatus.getDescription();
auto result =
- verifyProductionCsr(cppbor::Array(), csr, provisionable_.get(), GetParam(), challenge_);
+ verifyProductionCsr(cppbor::Array(), csr, rpcHardwareInfo, GetParam(), challenge_);
ASSERT_TRUE(result) << result.message();
std::unique_ptr<cppbor::Array> csrPayload = std::move(*result);
@@ -1002,7 +993,7 @@
ASSERT_TRUE(bootPatchLevel);
ASSERT_TRUE(securityLevel);
- auto kmDeviceName = device_suffix(GetParam());
+ auto kmDeviceName = deviceSuffix(GetParam());
// Compare DeviceInfo against IDs attested by KeyMint.
ASSERT_TRUE((securityLevel->value() == "tee" && kmDeviceName == "default") ||
diff --git a/staging/security/see/hwcrypto/aidl/Android.bp b/staging/security/see/hwcrypto/aidl/Android.bp
index 0a7e8be..2da59a4 100644
--- a/staging/security/see/hwcrypto/aidl/Android.bp
+++ b/staging/security/see/hwcrypto/aidl/Android.bp
@@ -28,4 +28,5 @@
enabled: true,
},
},
+ frozen: false,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
index 3763f0a..6837a2f 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -38,6 +38,8 @@
android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKey deriveKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKeyParameters parameters);
android.hardware.security.see.hwcrypto.IHwCryptoOperations getHwCryptoOperations();
android.hardware.security.see.hwcrypto.IOpaqueKey importClearKey(in android.hardware.security.see.hwcrypto.types.ExplicitKeyMaterial keyMaterial, in android.hardware.security.see.hwcrypto.KeyPolicy newKeyPolicy);
+ byte[] getCurrentDicePolicy();
+ android.hardware.security.see.hwcrypto.IOpaqueKey keyTokenImport(in android.hardware.security.see.hwcrypto.types.OpaqueKeyToken requestedKey, in byte[] sealingDicePolicy);
enum DeviceKeyId {
DEVICE_BOUND_KEY,
BATCH_KEY,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
index 9cbf272..88dbdf1 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -36,4 +36,6 @@
byte[] exportWrappedKey(in android.hardware.security.see.hwcrypto.IOpaqueKey wrappingKey);
android.hardware.security.see.hwcrypto.KeyPolicy getKeyPolicy();
byte[] getPublicKey();
+ android.hardware.security.see.hwcrypto.types.OpaqueKeyToken getShareableToken(in byte[] sealingDicePolicy);
+ void setProtectionId(in android.hardware.security.see.hwcrypto.types.ProtectionId protectionId, in android.hardware.security.see.hwcrypto.types.OperationType[] allowedOperations);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
new file mode 100644
index 0000000..fc2dd63
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+parcelable OpaqueKeyToken {
+ byte[] keyToken;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
new file mode 100644
index 0000000..1e304ab
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.security.see.hwcrypto.types;
+enum ProtectionId {
+ WIDEVINE_OUTPUT_BUFFER = 1,
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
index b5e7e9d..e472f4c 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -19,6 +19,7 @@
import android.hardware.security.see.hwcrypto.IOpaqueKey;
import android.hardware.security.see.hwcrypto.KeyPolicy;
import android.hardware.security.see.hwcrypto.types.ExplicitKeyMaterial;
+import android.hardware.security.see.hwcrypto.types.OpaqueKeyToken;
/*
* Higher level interface to access and generate keys.
@@ -217,4 +218,42 @@
* otherwise.
*/
IOpaqueKey importClearKey(in ExplicitKeyMaterial keyMaterial, in KeyPolicy newKeyPolicy);
+
+ /*
+ * getCurrentDicePolicy() - Returns the client current DICE policy. This policy is encrypted and
+ * considered opaque from the client perspective. This policy is the
+ * same used to create DICE bound keys and will also be used to seal
+ * secrets that can only be retrieved by the DICE policy owner. The
+ * first use of this seal operation will be
+ * <code>IOpaqueKey::getShareableToken</code> and
+ * <code>IHwCryptoKey::keyTokenImport</code>. To start this process,
+ * the intended key receiver will call this function and then pass the
+ * generated DICE policy to the owner of the key that the receiver
+ * wants to import. The key owner will then call
+ * <code>IOpaqueKey::getShareableToken</code> passing the receiver DICE
+ * policy to insure that only that receiver can import the key.
+ *
+ * Return:
+ * byte[] on success, which is the caller encrypted DICE policy.
+ */
+ byte[] getCurrentDicePolicy();
+
+ /*
+ * key_token_import() - Imports a key from a different client service instance. Because
+ * IOpaqueKey are binder objects that cannot be directly shared between
+ * binder rpc clients, this method provide a way to send a key to another
+ * client. Keys to be imported by the receiver are represented by a token
+ * created using <code>IOpaqueKey::getShareableToken</code>. The flow
+ * to create this token is described in
+ * <code>IHwCryptoKey::getCurrentDicePolicy</code>.
+ *
+ * @requested_key:
+ * Handle to the key to be imported to the caller service.
+ * @sealingDicePolicy:
+ * DICE policy used to seal the exported key.
+ * Return:
+ * A IOpaqueKey that can be directly be used on the local HWCrypto service on
+ * success, service specific error based on <code>HalErrorCode</code> otherwise.
+ */
+ IOpaqueKey keyTokenImport(in OpaqueKeyToken requestedKey, in byte[] sealingDicePolicy);
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
index 0d0f613..9a72639 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -16,7 +16,9 @@
package android.hardware.security.see.hwcrypto;
import android.hardware.security.see.hwcrypto.KeyPolicy;
+import android.hardware.security.see.hwcrypto.types.OpaqueKeyToken;
import android.hardware.security.see.hwcrypto.types.OperationType;
+import android.hardware.security.see.hwcrypto.types.ProtectionId;
interface IOpaqueKey {
/*
@@ -52,4 +54,37 @@
* <code>HalErrorCode</code> otherwise. Format used for the returned public key is COSE.
*/
byte[] getPublicKey();
+
+ /*
+ * getShareableToken() - Returns a token that can shared with another HWCrypto client.
+ *
+ * @sealingDicePolicy:
+ * Token to be used to protect the returned OpaqueKeyToken. It will be used so only
+ * the owner of the sealingDicePolicy can import the key.
+ * Return:
+ * <code>OpaqueKeyMaterial</code> token on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ OpaqueKeyToken getShareableToken(in byte[] sealingDicePolicy);
+
+ /*
+ * setProtectionId() - Sets the protectionID associated with the buffers where the operation
+ * will be performed. A protection ID serves as a limitation on the key so
+ * it can only operate on buffers with a matching protection ID.
+ * The client calling this functions needs to have the necessary permissions
+ * to read and/or write to this buffer. Setting this parameter means that
+ * if the key is shared with a different client, the client receiving the
+ * key will be limited in which buffers can be used to read/write data for
+ * this operation.
+ *
+ * @protectionId:
+ * ID of the given use case to provide protection for. The method of protecting the buffer
+ * will be platform dependent.
+ * @allowedOperations:
+ * array of allowed operations. Allowed operations are either READ or WRITE.
+ *
+ * Return:
+ * service specific error based on <code>HalErrorCode</code> on failure.
+ */
+ void setProtectionId(in ProtectionId protectionId, in OperationType[] allowedOperations);
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
new file mode 100644
index 0000000..db95c18
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2024 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.
+ */
+package android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Implementation defined structure that represents a key and its associated metadata. It is only
+ * valid on the current boot, and its reuse after a session is closed (or between sessions) is not
+ * guaranteed.
+ */
+parcelable OpaqueKeyToken {
+ /*
+ * Opaque type used to send IOpaqueKeys keys to different clients. Its format is implementation
+ * dependant.
+ */
+ byte[] keyToken;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
new file mode 100644
index 0000000..8686882
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2024 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.
+ */
+package android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Enum describing the different types of protected buffers. Protected buffers are named by its
+ * corresponding use case and its underlaying implementation is platform dependant.
+ */
+enum ProtectionId {
+ /*
+ * ProtectionID used by HwCrypto to enable Keys that can be used for Widevine video buffers.
+ * These buffers should not be readable by non-trusted entities and HwCrypto should not allow
+ * any read access to them through its interface.
+ */
+ WIDEVINE_OUTPUT_BUFFER = 1,
+}
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index 09cdc26..d0f1ed9 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -36,6 +36,7 @@
enum UwbVendorCapabilityTlvTypes {
SUPPORTED_POWER_STATS_QUERY = 0xC0,
SUPPORTED_ANTENNA_MODES = 0xC1,
+ SUPPORTED_MAX_SESSION_COUNT = 0xEB,
CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA0,
CCC_SUPPORTED_SYNC_CODES = 0xA1,
CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 0xA2,
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index 28e44ef..2d81ed2 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -48,6 +48,11 @@
*/
SUPPORTED_ANTENNA_MODES = 0xC1,
+ /**
+ * Int value to indicate max supported session count
+ */
+ SUPPORTED_MAX_SESSION_COUNT = 0xEB,
+
/*********************************************
* CCC specific
********************************************/
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
index 6197585..90caa26 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
@@ -51,4 +51,5 @@
long cipherSuitesSupported;
boolean secureHeLtfSupported;
boolean rangingFrameProtectionSupported;
+ int maxSupportedSecureHeLtfProtocolVersion;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
index 0cf048d..48e211d 100644
--- a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
@@ -100,4 +100,8 @@
* Whether frame protection for ranging is supported.
*/
boolean rangingFrameProtectionSupported;
+ /**
+ * Maximum supported secure HE-LTF protocol version.
+ */
+ int maxSupportedSecureHeLtfProtocolVersion;
}
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl
index 4554223..b6c5cf2 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/NetworkParams.aidl
@@ -40,4 +40,5 @@
String passphrase;
boolean isMetered;
byte[] vendorElements;
+ boolean isClientIsolationEnabled;
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl
index 47d9e6f..acc2cad 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/NetworkParams.aidl
@@ -52,4 +52,8 @@
* one or more elements). Example: byte[]{ 221, 4, 17, 34, 51, 1 }
*/
byte[] vendorElements;
+ /**
+ * Whether the network uses client isolation.
+ */
+ boolean isClientIsolationEnabled;
}
diff --git a/wifi/legacy_headers/include/hardware_legacy/rtt.h b/wifi/legacy_headers/include/hardware_legacy/rtt.h
index 631821d..93ea145 100644
--- a/wifi/legacy_headers/include/hardware_legacy/rtt.h
+++ b/wifi/legacy_headers/include/hardware_legacy/rtt.h
@@ -257,7 +257,7 @@
typedef struct {
wifi_rtt_result_v3 rtt_result_v3;
bool is_ranging_protection_enabled;
- bool is_secure_ltf_enabled;
+ bool is_secure_he_ltf_enabled;
wifi_rtt_akm base_akm;
wifi_rtt_cipher_suite cipher_suite;
int secure_he_ltf_protocol_version;
@@ -395,7 +395,9 @@
/* RTT Capabilities v4 (11az secure support) */
typedef struct {
wifi_rtt_capabilities_v3 rtt_capab_v3;
- bool secure_ltf_supported;
+ bool secure_he_ltf_supported;
+ int max_supported_secure_he_ltf_protocol_ver; // Maximum supported secure HE-LTF protocol
+ // version.
bool ranging_fame_protection_supported;
wifi_rtt_akm supported_akms; // Bitmap of wifi_rtt_akm values indicating the set of supported
// AKMs.