Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions sensors/aidl/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,34 @@ cc_binary {
],
srcs: ["main.cpp"],
}

prebuilt_etc {
name: "sensors-aidl.rc",
src: "sensors-aidl.rc",
installable: false,
}

prebuilt_etc {
name: "sensors-aidl.xml",
src: "sensors-aidl.xml",
sub_dir: "vintf",
installable: false,
}

// Default vendor APEX for android.hardware.sensors.
// Custom implementations may use override_apex based on this APEX.
apex {
name: "com.android.hardware.sensors.intel",
manifest: "apex_manifest.json",
key: "com.android.hardware.key",
certificate: ":com.android.hardware.certificate",
file_contexts: "file_contexts",
updatable: false,
vendor: true,

binaries: ["[email protected]"],
prebuilts: [
"sensors-aidl.rc", // init rc
"sensors-aidl.xml", // vintf fragment
],
}
1 change: 1 addition & 0 deletions sensors/aidl/aidl_api/android.hardware.sensors/1/.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c38c6b75e592ba5a6400b6348ad7f27db3064410
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* 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,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/*
* 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;
android.hardware.sensors.Event.EventPayload.HeadTracker headTracker;
android.hardware.sensors.Event.EventPayload.LimitedAxesImu limitedAxesImu;
android.hardware.sensors.Event.EventPayload.LimitedAxesImuUncal limitedAxesImuUncal;
android.hardware.sensors.Event.EventPayload.Heading heading;
@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 HeadTracker {
float rx;
float ry;
float rz;
float vx;
float vy;
float vz;
int discontinuityCount;
}
@FixedSize @VintfStability
parcelable LimitedAxesImu {
float x;
float y;
float z;
float xSupported;
float ySupported;
float zSupported;
}
@FixedSize @VintfStability
parcelable LimitedAxesImuUncal {
float x;
float y;
float z;
float xBias;
float yBias;
float zBias;
float xSupported;
float ySupported;
float zSupported;
}
@FixedSize @VintfStability
parcelable HeartRate {
float bpm;
android.hardware.sensors.SensorStatus status;
}
@FixedSize @VintfStability
parcelable Heading {
float heading;
float accuracy;
}
@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;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* 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;
@VintfStability
interface ISensors {
void activate(in int sensorHandle, in boolean enabled);
void batch(in int sensorHandle, in long samplingPeriodNs, in long maxReportLatencyNs);
int configDirectReport(in int sensorHandle, in int channelHandle, in android.hardware.sensors.ISensors.RateLevel rate);
void flush(in int sensorHandle);
android.hardware.sensors.SensorInfo[] getSensorsList();
void initialize(in android.hardware.common.fmq.MQDescriptor<android.hardware.sensors.Event,android.hardware.common.fmq.SynchronizedReadWrite> eventQueueDescriptor, in android.hardware.common.fmq.MQDescriptor<int,android.hardware.common.fmq.SynchronizedReadWrite> wakeLockDescriptor, in android.hardware.sensors.ISensorsCallback sensorsCallback);
void injectSensorData(in android.hardware.sensors.Event event);
int registerDirectChannel(in android.hardware.sensors.ISensors.SharedMemInfo mem);
void setOperationMode(in android.hardware.sensors.ISensors.OperationMode mode);
void unregisterDirectChannel(in int channelHandle);
const int ERROR_NO_MEMORY = -12;
const int ERROR_BAD_VALUE = -22;
const int WAKE_LOCK_TIMEOUT_SECONDS = 1;
const int EVENT_QUEUE_FLAG_BITS_READ_AND_PROCESS = 1;
const int EVENT_QUEUE_FLAG_BITS_EVENTS_READ = 2;
const int WAKE_LOCK_QUEUE_FLAG_BITS_DATA_WRITTEN = 1;
const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_FIELD = 0;
const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_REPORT_TOKEN = 4;
const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_SENSOR_TYPE = 8;
const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_ATOMIC_COUNTER = 12;
const int DIRECT_REPORT_SENSOR_EVENT_OFFSET_SIZE_TIMESTAMP = 16;
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;
@Backing(type="int") @VintfStability
enum RateLevel {
STOP = 0,
NORMAL = 1,
FAST = 2,
VERY_FAST = 3,
}
@Backing(type="int") @VintfStability
enum OperationMode {
NORMAL = 0,
DATA_INJECTION = 1,
}
@VintfStability
parcelable SharedMemInfo {
android.hardware.sensors.ISensors.SharedMemInfo.SharedMemType type;
android.hardware.sensors.ISensors.SharedMemInfo.SharedMemFormat format;
int size;
android.hardware.common.NativeHandle memoryHandle;
@Backing(type="int") @VintfStability
enum SharedMemFormat {
SENSORS_EVENT = 1,
}
@Backing(type="int") @VintfStability
enum SharedMemType {
ASHMEM = 1,
GRALLOC = 2,
}
}
}
Loading