From a833eba9baf5ea66e4e24066eca27480eb7672e2 Mon Sep 17 00:00:00 2001 From: Pavel Maltsev Date: Fri, 16 Dec 2016 14:49:21 -0800 Subject: [PATCH] Remove VehiclePermisionMode from VHAL It's not used. Fix: b/33670724 Test: removed unused code Change-Id: Ief883ed07639b06ab7a2356583cbe5053f360e68 --- vehicle/2.0/Android.mk | 34 ------------------- vehicle/2.0/default/impl/DefaultConfig.h | 14 -------- .../2.0/default/tests/VehicleHalTestUtils.h | 7 ---- vehicle/2.0/types.hal | 29 ---------------- vehicle/2.0/vts/types.vts | 30 ---------------- 5 files changed, 114 deletions(-) diff --git a/vehicle/2.0/Android.mk b/vehicle/2.0/Android.mk index dc4d25ce6e..e1b3b391fe 100644 --- a/vehicle/2.0/Android.mk +++ b/vehicle/2.0/Android.mk @@ -681,21 +681,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (VehiclePermissionModel) -# -GEN := $(intermediates)/android/hardware/vehicle/V2_0/VehiclePermissionModel.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.VehiclePermissionModel - $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) @@ -1634,25 +1619,6 @@ $(GEN): $(LOCAL_PATH)/types.hal $(transform-generated-source) LOCAL_GENERATED_SOURCES += $(GEN) -# -# Build types.hal (VehiclePermissionModel) -# -GEN := $(intermediates)/android/hardware/vehicle/V2_0/VehiclePermissionModel.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.VehiclePermissionModel - -$(GEN): $(LOCAL_PATH)/types.hal - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) - # # Build types.hal (VehiclePropConfig) # diff --git a/vehicle/2.0/default/impl/DefaultConfig.h b/vehicle/2.0/default/impl/DefaultConfig.h index e4ca5ca038..77c4f98241 100644 --- a/vehicle/2.0/default/impl/DefaultConfig.h +++ b/vehicle/2.0/default/impl/DefaultConfig.h @@ -32,14 +32,12 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::INFO_MAKE, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::STATIC, - .permissionModel = VehiclePermissionModel::OEM_ONLY, }, { .prop = VehicleProperty::HVAC_POWER_ON, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1) }, @@ -47,7 +45,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_DEFROSTER, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = VehicleAreaWindow::FRONT_WINDSHIELD | VehicleAreaWindow::REAR_WINDSHIELD @@ -57,7 +54,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_RECIRC_ON, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1) }, @@ -65,7 +61,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_AC_ON, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1) }, @@ -73,7 +68,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_AUTO_ON, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1) }, @@ -81,7 +75,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_FAN_SPEED, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1), .areaConfigs = { VehicleAreaConfig { @@ -96,7 +89,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_FAN_DIRECTION, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1), }, @@ -104,7 +96,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_TEMPERATURE_SET, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT, @@ -126,28 +117,24 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::NIGHT_MODE, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, }, { .prop = VehicleProperty::DRIVING_STATUS, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, }, { .prop = VehicleProperty::GEAR_SELECTION, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, }, { .prop = VehicleProperty::INFO_FUEL_CAPACITY, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = { VehicleAreaConfig { .minFloatValue = 0, @@ -160,7 +147,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::DISPLAY_BRIGHTNESS, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = { VehicleAreaConfig { .minInt32Value = 0, diff --git a/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/vehicle/2.0/default/tests/VehicleHalTestUtils.h index 586b5abffd..77541fcb18 100644 --- a/vehicle/2.0/default/tests/VehicleHalTestUtils.h +++ b/vehicle/2.0/default/tests/VehicleHalTestUtils.h @@ -32,7 +32,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::INFO_MAKE, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::STATIC, - .permissionModel = VehiclePermissionModel::OEM_ONLY, .configString = "Some=config,options=if,you=have_any", }, @@ -40,7 +39,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_FAN_SPEED, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = static_cast( VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT), .areaConfigs = { @@ -61,7 +59,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::HVAC_SEAT_TEMPERATURE, .access = VehiclePropertyAccess::WRITE, .changeMode = VehiclePropertyChangeMode::ON_SET, - .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = static_cast( VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT), .areaConfigs = { @@ -81,7 +78,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::INFO_FUEL_CAPACITY, .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = { VehicleAreaConfig { .minFloatValue = 0, @@ -94,7 +90,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::DISPLAY_BRIGHTNESS, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = { VehicleAreaConfig { .minInt32Value = 0, @@ -107,7 +102,6 @@ const VehiclePropConfig kVehicleProperties[] = { .prop = VehicleProperty::MIRROR_FOLD, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .permissionModel = VehiclePermissionModel::OEM_ONLY, } }; @@ -238,7 +232,6 @@ inline std::string toString(const VehiclePropConfig &config) { << " prop: " << enumToHexString(config.prop) << ",\n" << " supportedAreas: " << hexString(config.supportedAreas) << ",\n" << " access: " << enumToHexString(config.access) << ",\n" - << " permissionModel: " << enumToHexString(config.permissionModel) << ",\n" << " changeMode: " << enumToHexString(config.changeMode) << ",\n" << " configFlags: " << hexString(config.configFlags) << ",\n" << " minSampleRate: " << config.minSampleRate << ",\n" diff --git a/vehicle/2.0/types.hal b/vehicle/2.0/types.hal index 72fa554273..5ab0c247e2 100644 --- a/vehicle/2.0/types.hal +++ b/vehicle/2.0/types.hal @@ -2143,30 +2143,6 @@ enum VehiclePropertyAccess : int32_t { READ_WRITE = 0x03, }; -/* - * These permissions define how the OEMs want to distribute their information - * and security they want to apply. On top of these restrictions, android will - * have additional 'app-level' permissions that the apps will need to ask the - * user before the apps have the information. - * This information must be kept in VehiclePropConfig#permissionModel. - */ -enum VehiclePermissionModel : int32_t { - /* - * No special restriction, but each property can still require specific - * android app-level permission. - */ - NO_RESTRICTION = 0, - - /* Signature only. Only APKs signed with OEM keys are allowed. */ - OEM_ONLY = 0x1, - - /* System only. APKs built-in to system can access the property. */ - SYSTEM_APP_ONLY = 0x2, - - /* Equivalent to “system|signature” */ - OEM_OR_SYSTEM_APP = 0x3, -}; - /* * Car states. * @@ -2310,11 +2286,6 @@ struct VehiclePropConfig { */ VehiclePropertyChangeMode changeMode; - /* - * Defines permission model to access the data. - */ - VehiclePermissionModel permissionModel; - /* * Some of the properties may have associated areas (for example, some hvac * properties are associated with VehicleAreaZone), in these diff --git a/vehicle/2.0/vts/types.vts b/vehicle/2.0/vts/types.vts index fc63add32d..d36813885e 100644 --- a/vehicle/2.0/vts/types.vts +++ b/vehicle/2.0/vts/types.vts @@ -1164,31 +1164,6 @@ attribute: { } } -attribute: { - name: "::android::hardware::vehicle::V2_0::VehiclePermissionModel" - type: TYPE_ENUM - enum_value: { - scalar_type: "int32_t" - - enumerator: "NO_RESTRICTION" - scalar_value: { - int32_t: 0 - } - enumerator: "OEM_ONLY" - scalar_value: { - int32_t: 1 - } - enumerator: "SYSTEM_APP_ONLY" - scalar_value: { - int32_t: 2 - } - enumerator: "OEM_OR_SYSTEM_APP" - scalar_value: { - int32_t: 3 - } - } -} - attribute: { name: "::android::hardware::vehicle::V2_0::VehicleDrivingStatus" type: TYPE_ENUM @@ -1599,11 +1574,6 @@ attribute: { type: TYPE_ENUM predefined_type: "::android::hardware::vehicle::V2_0::VehiclePropertyChangeMode" } - struct_value: { - name: "permissionModel" - type: TYPE_ENUM - predefined_type: "::android::hardware::vehicle::V2_0::VehiclePermissionModel" - } struct_value: { name: "supportedAreas" type: TYPE_SCALAR