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

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

Merge "Introduce ignition state property in VHAL"

parents b56cd1bf d567a2a1
Loading
Loading
Loading
Loading
+38 −0
Original line number Original line Diff line number Diff line
@@ -662,6 +662,25 @@ $(GEN): $(LOCAL_PATH)/types.hal
	$(transform-generated-source)
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
LOCAL_GENERATED_SOURCES += $(GEN)


#
# Build types.hal (VehicleIgnitionState)
#
GEN := $(intermediates)/android/hardware/vehicle/V2_0/VehicleIgnitionState.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
        -Ljava \
        -randroid.hardware:hardware/interfaces \
        -randroid.hidl:system/libhidl/transport \
        android.hardware.vehicle@2.0::types.VehicleIgnitionState

$(GEN): $(LOCAL_PATH)/types.hal
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)

#
#
# Build types.hal (VehicleInstrumentClusterType)
# Build types.hal (VehicleInstrumentClusterType)
#
#
@@ -1596,6 +1615,25 @@ $(GEN): $(LOCAL_PATH)/types.hal
	$(transform-generated-source)
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
LOCAL_GENERATED_SOURCES += $(GEN)


#
# Build types.hal (VehicleIgnitionState)
#
GEN := $(intermediates)/android/hardware/vehicle/V2_0/VehicleIgnitionState.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
        -Ljava \
        -randroid.hardware:hardware/interfaces \
        -randroid.hidl:system/libhidl/transport \
        android.hardware.vehicle@2.0::types.VehicleIgnitionState

$(GEN): $(LOCAL_PATH)/types.hal
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)

#
#
# Build types.hal (VehicleInstrumentClusterType)
# Build types.hal (VehicleInstrumentClusterType)
#
#
+6 −0
Original line number Original line Diff line number Diff line
@@ -153,6 +153,12 @@ const VehiclePropConfig kVehicleProperties[] = {
                .maxInt32Value = 10
                .maxInt32Value = 10
            }
            }
        }
        }
    },

    {
        .prop = VehicleProperty::IGNITION_STATE,
        .access = VehiclePropertyAccess::READ,
        .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
    }
    }
};
};


+3 −0
Original line number Original line Diff line number Diff line
@@ -87,6 +87,9 @@ VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(
        case VehicleProperty::DRIVING_STATUS:
        case VehicleProperty::DRIVING_STATUS:
            v = pool.obtainInt32(toInt(VehicleDrivingStatus::UNRESTRICTED));
            v = pool.obtainInt32(toInt(VehicleDrivingStatus::UNRESTRICTED));
            break;
            break;
        case VehicleProperty::IGNITION_STATE:
            v = pool.obtainInt32(toInt(VehicleIgnitionState::ACC));
            break;
        default:
        default:
            *outStatus = StatusCode::INVALID_ARG;
            *outStatus = StatusCode::INVALID_ARG;
    }
    }
+41 −0
Original line number Original line Diff line number Diff line
@@ -309,6 +309,18 @@ enum VehicleProperty: int32_t {
        | VehiclePropertyType:INT32
        | VehiclePropertyType:INT32
        | VehicleArea:GLOBAL),
        | VehicleArea:GLOBAL),


    /*
     * Represents ignition state
     *
     * @change_mode VehiclePropertyChangeMode:ON_CHANGE
     * @access VehiclePropertyAccess:READ
     */
    IGNITION_STATE = (
        0x0409
            | VehiclePropertyGroup:SYSTEM
            | VehiclePropertyType:INT32
            | VehicleArea:GLOBAL),

    /*
    /*
     * Fan speed setting
     * Fan speed setting
     *
     *
@@ -2390,6 +2402,35 @@ struct VehiclePropValue {
    RawValue value;
    RawValue value;
};
};


enum VehicleIgnitionState : int32_t {
    UNDEFINED = 0,

    /* Steering wheel is locked */
    LOCK = 1,

     /*
      * Steering wheel is not locked, engine and all accessories are OFF. If
      * car can be in LOCK and OFF state at the same time than HAL must report
      * LOCK state.
      */
    OFF,

    /*
     * Typically in this state accessories become available (e.g. radio).
     * Instrument cluster and engine are turned off
     */
    ACC,

    /*
     * Ignition is in state ON. Accessories and instrument cluster available,
     * engine might be running or ready to be started.
     */
    ON,

    /* Typically in this state engine is starting (cranking). */
    START
};



/*
/*
 * Represent the operation where the current error has happened.
 * Represent the operation where the current error has happened.