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

Commit 99264999 authored by Yu Shan's avatar Yu Shan
Browse files

Add supported value APIs to VHAL interface.

Define new VHAL APIs to expose supported min/max value or supported
value list information. These APIs support dynamic supported value
range. Caller can use the APIs to fetch the current value or register
a callback to be notified when the supported value range changes.

Flag: EXEMPT HAL interface
Test: m android.hardware.automotive.vehicle-update-api
Bug: 371636116
Change-Id: I2e0e2abf001872fd9d4c585038a9bee4fd0ea7d8
parent 59682e80
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ aidl_interface {
    srcs: [
        "android/hardware/automotive/vehicle/*.aidl",
    ],
    frozen: true,
    frozen: false,
    stability: "vintf",
    backend: {
        cpp: {
+40 −0
Original line number Diff line number Diff line
/*
 * 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.automotive.vehicle;
@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable HasSupportedValueInfo {
  boolean hasMinSupportedValue;
  boolean hasMaxSupportedValue;
  boolean hasSupportedValuesList;
}
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ interface IVehicle {
  void subscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in android.hardware.automotive.vehicle.SubscribeOptions[] options, int maxSharedMemoryFileCount);
  void unsubscribe(in android.hardware.automotive.vehicle.IVehicleCallback callback, in int[] propIds);
  void returnSharedMemory(in android.hardware.automotive.vehicle.IVehicleCallback callback, long sharedMemoryId);
  android.hardware.automotive.vehicle.SupportedValuesListResults getSupportedValuesLists(in List<android.hardware.automotive.vehicle.PropIdAreaId> propIdAreaIds);
  android.hardware.automotive.vehicle.MinMaxSupportedValueResults getMinMaxSupportedValue(in List<android.hardware.automotive.vehicle.PropIdAreaId> propIdAreaIds);
  void registerSupportedValueChangeCallback(in android.hardware.automotive.vehicle.IVehicleCallback callback, in List<android.hardware.automotive.vehicle.PropIdAreaId> propIdAreaIds);
  void unregisterSupportedValueChangeCallback(in android.hardware.automotive.vehicle.IVehicleCallback callback, in List<android.hardware.automotive.vehicle.PropIdAreaId> propIdAreaIds);
  const long INVALID_MEMORY_ID = 0;
  const int MAX_SHARED_MEMORY_FILES_PER_CLIENT = 3;
}
+1 −0
Original line number Diff line number Diff line
@@ -38,4 +38,5 @@ interface IVehicleCallback {
  oneway void onSetValues(in android.hardware.automotive.vehicle.SetValueResults responses);
  oneway void onPropertyEvent(in android.hardware.automotive.vehicle.VehiclePropValues propValues, int sharedMemoryFileCount);
  oneway void onPropertySetError(in android.hardware.automotive.vehicle.VehiclePropErrors errors);
  oneway void onSupportedValueChange(in List<android.hardware.automotive.vehicle.PropIdAreaId> propIdAreaIds);
}
+40 −0
Original line number Diff line number Diff line
/*
 * 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.automotive.vehicle;
@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable MinMaxSupportedValueResult {
  android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK;
  @nullable android.hardware.automotive.vehicle.RawPropValues minSupportedValue;
  @nullable android.hardware.automotive.vehicle.RawPropValues maxSupportedValue;
}
Loading