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

Commit 08315ccb authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Define the runtime sensor handle range in ISensors.aidl

Add a test to make sure that there are no sensors with handles within this range in the HAL.

Fix: 259227294
Test: VtsAidlHalSensorsTargetTest

Change-Id: Ib785984a0b43457eacd41031bbf361375f9d21f8
parent 5d13ab6d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -593,6 +593,7 @@
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.sensors</name>
        <version>2</version>
        <interface>
            <name>ISensors</name>
            <instance>default</instance>
+2 −0
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ interface ISensors {
  const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 24;
  const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 88;
  const int DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH = 104;
  const int RUNTIME_SENSORS_HANDLE_BASE = 1593835520;
  const int RUNTIME_SENSORS_HANDLE_END = 1610612735;
  @Backing(type="int") @VintfStability
  enum RateLevel {
    STOP = 0,
+9 −0
Original line number Diff line number Diff line
@@ -371,4 +371,13 @@ interface ISensors {
    const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_DATA = 0x18;
    const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_RESERVED = 0x58;
    const int DIRECT_REPORT_SENSOR_EVENT_TOTAL_LENGTH = 104;

    /**
     * Constants related to reserved sensor handle ranges.
     *
     * The following range (inclusive) is reserved for usage by the system for
     * runtime sensors.
     */
    const int RUNTIME_SENSORS_HANDLE_BASE = 0x5F000000;
    const int RUNTIME_SENSORS_HANDLE_END = 0x5FFFFFFF;
}
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ cc_library_static {
        "libhardware",
        "libbase",
        "libutils",
        "android.hardware.sensors-V1-ndk",
        "android.hardware.sensors-V2-ndk",
    ],
    local_include_dirs: ["include/aidl/sensors"],
    export_shared_lib_headers: [
+2 −2
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ cc_library_static {
        "libfmq",
        "libpower",
        "libbinder_ndk",
        "android.hardware.sensors-V1-ndk",
        "android.hardware.sensors-V2-ndk",
    ],
    export_include_dirs: ["include"],
    srcs: [
@@ -68,7 +68,7 @@ cc_binary {
        "libcutils",
        "liblog",
        "libutils",
        "android.hardware.sensors-V1-ndk",
        "android.hardware.sensors-V2-ndk",
    ],
    static_libs: [
        "libsensorsexampleimpl",
Loading