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

Commit d431c503 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "sensors-hal-aidl"

* changes:
  Adds sensors aidl default (cuttlefish) implementation
  Adds sensors HAL AIDL interface
parents 0a0b3049 bc2a1b73
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -626,6 +626,13 @@
            <instance>strongbox</instance>
        </interface>
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.sensors</name>
        <interface>
            <name>ISensors</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="true">
        <name>android.hardware.sensors</name>
        <version>1.0</version>
+25 −0
Original line number Diff line number Diff line
// This is the expected build file, but it may not be right in all cases

aidl_interface {
    name: "android.hardware.sensors",
    vendor_available: true,
    srcs: ["android/hardware/sensors/*.aidl"],
    imports: [
        "android.hardware.common-V2",
        "android.hardware.common.fmq-V1",
    ],
    stability: "vintf",
    backend: {
        cpp: {
            enabled: false,
        },
        java: {
            enabled: false,
        },
        ndk: {
            vndk: {
                enabled: true,
            },
        },
    },
}
+76 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 */
///////////////////////////////////////////////////////////////////////////////
// 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.sensors;
@FixedSize @VintfStability
parcelable AdditionalInfo {
  android.hardware.sensors.AdditionalInfo.AdditionalInfoType type;
  int serial;
  android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload payload;
  @FixedSize @VintfStability
  union AdditionalInfoPayload {
    android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.Int32Values dataInt32;
    android.hardware.sensors.AdditionalInfo.AdditionalInfoPayload.FloatValues dataFloat;
    @FixedSize @VintfStability
    parcelable Int32Values {
      int[14] values;
    }
    @FixedSize @VintfStability
    parcelable FloatValues {
      float[14] values;
    }
  }
  @Backing(type="int") @VintfStability
  enum AdditionalInfoType {
    AINFO_BEGIN = 0,
    AINFO_END = 1,
    AINFO_UNTRACKED_DELAY = 65536,
    AINFO_INTERNAL_TEMPERATURE = 65537,
    AINFO_VEC3_CALIBRATION = 65538,
    AINFO_SENSOR_PLACEMENT = 65539,
    AINFO_SAMPLING = 65540,
    AINFO_CHANNEL_NOISE = 131072,
    AINFO_CHANNEL_SAMPLER = 131073,
    AINFO_CHANNEL_FILTER = 131074,
    AINFO_CHANNEL_LINEAR_TRANSFORM = 131075,
    AINFO_CHANNEL_NONLINEAR_MAP = 131076,
    AINFO_CHANNEL_RESAMPLER = 131077,
    AINFO_LOCAL_GEOMAGNETIC_FIELD = 196608,
    AINFO_LOCAL_GRAVITY = 196609,
    AINFO_DOCK_STATE = 196610,
    AINFO_HIGH_PERFORMANCE_MODE = 196611,
    AINFO_MAGNETIC_FIELD_CALIBRATION = 196612,
    AINFO_CUSTOM_START = 268435456,
    AINFO_DEBUGGING_START = 1073741824,
  }
}
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 */
///////////////////////////////////////////////////////////////////////////////
// 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.sensors;
@FixedSize @VintfStability
parcelable DynamicSensorInfo {
  boolean connected;
  int sensorHandle;
  android.hardware.sensors.DynamicSensorInfo.Uuid uuid;
  @FixedSize @VintfStability
  parcelable Uuid {
    byte[16] values;
  }
}
+99 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 */
///////////////////////////////////////////////////////////////////////////////
// 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.sensors;
@FixedSize @VintfStability
parcelable Event {
  long timestamp;
  int sensorHandle;
  android.hardware.sensors.SensorType sensorType;
  android.hardware.sensors.Event.EventPayload payload;
  @FixedSize @VintfStability
  union EventPayload {
    android.hardware.sensors.Event.EventPayload.Vec3 vec3;
    android.hardware.sensors.Event.EventPayload.Vec4 vec4;
    android.hardware.sensors.Event.EventPayload.Uncal uncal;
    android.hardware.sensors.Event.EventPayload.MetaData meta;
    float scalar;
    long stepCount;
    android.hardware.sensors.Event.EventPayload.HeartRate heartRate;
    android.hardware.sensors.Event.EventPayload.Pose6Dof pose6DOF;
    android.hardware.sensors.DynamicSensorInfo dynamic;
    android.hardware.sensors.AdditionalInfo additional;
    android.hardware.sensors.Event.EventPayload.Data data;
    @FixedSize @VintfStability
    parcelable Vec4 {
      float x;
      float y;
      float z;
      float w;
    }
    @FixedSize @VintfStability
    parcelable Vec3 {
      float x;
      float y;
      float z;
      android.hardware.sensors.SensorStatus status;
    }
    @FixedSize @VintfStability
    parcelable Uncal {
      float x;
      float y;
      float z;
      float xBias;
      float yBias;
      float zBias;
    }
    @FixedSize @VintfStability
    parcelable HeartRate {
      float bpm;
      android.hardware.sensors.SensorStatus status;
    }
    @FixedSize @VintfStability
    parcelable MetaData {
      android.hardware.sensors.Event.EventPayload.MetaData.MetaDataEventType what;
      @Backing(type="int") @VintfStability
      enum MetaDataEventType {
        META_DATA_FLUSH_COMPLETE = 1,
      }
    }
    @FixedSize @VintfStability
    parcelable Pose6Dof {
      float[15] values;
    }
    @FixedSize @VintfStability
    parcelable Data {
      float[16] values;
    }
  }
}
Loading