Add Java equal and toString annotations.

Add annotations so that the Java backend would generate equals and
toString methods, which would be useful in our code.

Test: Manual build.
Bug: 205774940
Change-Id: Ib08c5f42d29c6d028abcaa1a577147d1495cf550
This commit is contained in:
Yu Shan
2021-11-23 17:09:11 -08:00
parent b0d07d21d0
commit f9dcdea9f4
62 changed files with 62 additions and 31 deletions

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable CreateUserRequest {
int requestId;
android.hardware.automotive.vehicle.UserInfo newUserInfo;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable CreateUserResponse {
int requestId;
android.hardware.automotive.vehicle.CreateUserStatus status = android.hardware.automotive.vehicle.CreateUserStatus.SUCCESS;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable GetValueRequest {
long requestId;
android.hardware.automotive.vehicle.VehiclePropValue prop;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable GetValueRequests {
android.hardware.automotive.vehicle.GetValueRequest[] payloads;
@nullable ParcelFileDescriptor sharedMemoryFd;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable GetValueResult {
long requestId;
android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable GetValueResults {
android.hardware.automotive.vehicle.GetValueResult[] payloads;
@nullable ParcelFileDescriptor sharedMemoryFd;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable InitialUserInfoRequest {
int requestId;
android.hardware.automotive.vehicle.InitialUserInfoRequestType requestType = android.hardware.automotive.vehicle.InitialUserInfoRequestType.UNKNOWN;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable InitialUserInfoResponse {
int requestId;
android.hardware.automotive.vehicle.InitialUserInfoResponseAction action = android.hardware.automotive.vehicle.InitialUserInfoResponseAction.DEFAULT;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable RawPropValues {
int[] int32Values = {};
float[] floatValues;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable RemoveUserRequest {
int requestId;
android.hardware.automotive.vehicle.UserInfo removedUserInfo;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable SetValueRequest {
long requestId;
android.hardware.automotive.vehicle.VehiclePropValue value;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable SetValueRequests {
android.hardware.automotive.vehicle.SetValueRequest[] payloads;
@nullable ParcelFileDescriptor sharedMemoryFd;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable SetValueResult {
long requestId;
android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable SetValueResults {
android.hardware.automotive.vehicle.SetValueResult[] payloads;
@nullable ParcelFileDescriptor sharedMemoryFd;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable SubscribeOptions {
int propId;
int[] areaIds;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable SwitchUserRequest {
int requestId;
android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable SwitchUserResponse {
int requestId;
android.hardware.automotive.vehicle.SwitchUserMessageType messageType = android.hardware.automotive.vehicle.SwitchUserMessageType.UNKNOWN;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable UserIdentificationAssociation {
android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID;
android.hardware.automotive.vehicle.UserIdentificationAssociationValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationValue.UNKNOWN;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable UserIdentificationGetRequest {
int requestId;
android.hardware.automotive.vehicle.UserInfo userInfo;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable UserIdentificationResponse {
int requestId;
int numberAssociation;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable UserIdentificationSetAssociation {
android.hardware.automotive.vehicle.UserIdentificationAssociationType type = android.hardware.automotive.vehicle.UserIdentificationAssociationType.INVALID;
android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue value = android.hardware.automotive.vehicle.UserIdentificationAssociationSetValue.INVALID;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable UserIdentificationSetRequest {
int requestId;
android.hardware.automotive.vehicle.UserInfo userInfo;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable UserInfo {
int userId = 0;
int flags;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable UsersInfo {
android.hardware.automotive.vehicle.UserInfo currentUser;
int numberUsers;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable VehicleAreaConfig {
int areaId;
int minInt32Value;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable VehiclePropConfig {
int prop;
android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable VehiclePropConfigs {
android.hardware.automotive.vehicle.VehiclePropConfig[] payloads;
@nullable ParcelFileDescriptor sharedMemoryFd;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable VehiclePropError {
int propId;
int areaId;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable VehiclePropErrors {
android.hardware.automotive.vehicle.VehiclePropError[] payloads;
@nullable ParcelFileDescriptor sharedMemoryFd;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable VehiclePropValue {
long timestamp;
int areaId;

View File

@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true) @VintfStability
parcelable VehiclePropValues {
android.hardware.automotive.vehicle.VehiclePropValue[] payloads;
long sharedMemoryId;

View File

@@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UsersInfo;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable CreateUserRequest {
/**
* Arbitrary id used to map the response to the request.

View File

@@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.CreateUserStatus;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable CreateUserResponse {
/**
* Id of the request being responded.

View File

@@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle;
import android.hardware.automotive.vehicle.VehiclePropValue;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable GetValueRequest {
// A unique request ID. For every client, the request ID must start with 1
// and monotonically increase for every SetValueRequest. If it hits

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.GetValueRequest;
import android.os.ParcelFileDescriptor;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable GetValueRequests {
// A list of GetValueRequest to get if they fit the binder memory
// limitation.

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.StatusCode;
import android.hardware.automotive.vehicle.VehiclePropValue;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable GetValueResult {
// The ID for the request this response is for.
long requestId;

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.GetValueResult;
import android.os.ParcelFileDescriptor;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable GetValueResults {
// The list of responses if they fit the binder memory limitation.
GetValueResult[] payloads;

View File

@@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UsersInfo;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable InitialUserInfoRequest {
/**
* Arbitrary id used to map the HAL response to the request.

View File

@@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UserInfo;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable InitialUserInfoResponse {
/**
* Id of the request being responded.

View File

@@ -17,6 +17,7 @@
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable RawPropValues {
/**
* This is used for properties of types VehiclePropertyType#INT

View File

@@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UsersInfo;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable RemoveUserRequest {
/**
* Arbitrary id used to map the response to the request.

View File

@@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle;
import android.hardware.automotive.vehicle.VehiclePropValue;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable SetValueRequest {
// A unique request ID. For every client, the request ID must start with 1
// and monotonically increase for every SetValueRequest. If it hits

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.SetValueRequest;
import android.os.ParcelFileDescriptor;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable SetValueRequests {
// The list of request if they fit the binder memory limitation.
SetValueRequest[] payloads;

View File

@@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle;
import android.hardware.automotive.vehicle.StatusCode;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable SetValueResult {
// The ID for the request this response is for.
long requestId;

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.SetValueResult;
import android.os.ParcelFileDescriptor;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable SetValueResults {
// The list of responses if they fit the binder memory limitation.
SetValueResult[] payloads;

View File

@@ -20,6 +20,7 @@ package android.hardware.automotive.vehicle;
* Encapsulates information about subscription to vehicle property events.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable SubscribeOptions {
/** Property to subscribe */
int propId;

View File

@@ -27,6 +27,7 @@ import android.hardware.automotive.vehicle.UsersInfo;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable SwitchUserRequest {
/**
* Arbitrary id used to map the response to the request.

View File

@@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.SwitchUserStatus;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable SwitchUserResponse {
/**
* Id of the request being responded.

View File

@@ -23,6 +23,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociationValue;
* Helper struct used when getting a user/identification association type.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable UserIdentificationAssociation {
UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID;
UserIdentificationAssociationValue value = UserIdentificationAssociationValue.UNKNOWN;

View File

@@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UserInfo;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable UserIdentificationGetRequest {
/**
* Id of the request being responded.

View File

@@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociation;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable UserIdentificationResponse {
/**
* Id of the request being responded.

View File

@@ -23,6 +23,7 @@ import android.hardware.automotive.vehicle.UserIdentificationAssociationType;
* Helper struct used when setting a user/identification association type.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable UserIdentificationSetAssociation {
UserIdentificationAssociationType type = UserIdentificationAssociationType.INVALID;
UserIdentificationAssociationSetValue value = UserIdentificationAssociationSetValue.INVALID;

View File

@@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.UserInfo;
* VehiclePropValue.RawValue through libraries provided by the default Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable UserIdentificationSetRequest {
/**
* Id of the request being responded.

View File

@@ -20,6 +20,7 @@ package android.hardware.automotive.vehicle;
* Information about a specific Android user.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable UserInfo {
/**
* System user.

View File

@@ -26,6 +26,7 @@ import android.hardware.automotive.vehicle.UserInfo;
* Vehicle HAL implementation.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable UsersInfo {
/**
* The current foreground user.

View File

@@ -17,6 +17,7 @@
package android.hardware.automotive.vehicle;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable VehicleAreaConfig {
/**
* Area id is ignored for VehiclePropertyGroup:GLOBAL properties.

View File

@@ -21,6 +21,7 @@ import android.hardware.automotive.vehicle.VehiclePropertyAccess;
import android.hardware.automotive.vehicle.VehiclePropertyChangeMode;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable VehiclePropConfig {
/** Property identifier */
int prop;

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.VehiclePropConfig;
import android.os.ParcelFileDescriptor;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable VehiclePropConfigs {
// The list of vehicle property configs if they fit the binder memory
// limitation.

View File

@@ -19,6 +19,7 @@ package android.hardware.automotive.vehicle;
import android.hardware.automotive.vehicle.StatusCode;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable VehiclePropError {
// Property ID.
int propId;

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.VehiclePropError;
import android.os.ParcelFileDescriptor;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable VehiclePropErrors {
// List of property set errors if they fit binder memory limitation.
VehiclePropError[] payloads;

View File

@@ -25,6 +25,7 @@ import android.hardware.automotive.vehicle.VehiclePropertyStatus;
* events.
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable VehiclePropValue {
/** Time is elapsed nanoseconds since boot */
long timestamp;

View File

@@ -20,6 +20,7 @@ import android.hardware.automotive.vehicle.VehiclePropValue;
import android.os.ParcelFileDescriptor;
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable VehiclePropValues {
// The list of vehicle properties if they fit the binder memory limitation.
VehiclePropValue[] payloads;