From 870d396127c2e5e247cb85a7921143e78ee81ce4 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Tue, 18 Jun 2019 11:09:35 +0200 Subject: Move function about dependency selection Move function used to test if a dependency is selected. BUG-AGL: SPEC-2329 Change-Id: Ic577a33741d705e09dd14a48dde0483db792b97d Signed-off-by: Jonathan Aillet --- lib/4a-hal-utilities/4a-hal-utilities-data.c | 54 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'lib/4a-hal-utilities') diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.c b/lib/4a-hal-utilities/4a-hal-utilities-data.c index 845ea59..6f85565 100644 --- a/lib/4a-hal-utilities/4a-hal-utilities-data.c +++ b/lib/4a-hal-utilities/4a-hal-utilities-data.c @@ -70,6 +70,33 @@ char *HalUtlGetProbedDeviceClassString(enum ProbedDeviceClasses deviceClass) return NULL; } +int HalUtlIsDependencySelected(struct InternalHalProbedDevice *probedDevice, enum DependencyStatus requestedStatus) +{ + if(! probedDevice) { + return 0; + } + + switch(requestedStatus) { + case UNAVAILABLE_DEPENDENCY: + if(! probedDevice->deviceData) + return 1; + else + return 0; + + case AVAILABLE_DEPENDENCY: + if(probedDevice->deviceData) + return 1; + else + return 0; + + case ALL_DEPENDENCY: + return 1; + + default: + return 0; + } +} + struct InternalHalProbedDevice *HalUtlAddProbedDeviceToProbedDeviceList(struct InternalHalProbedDevice **probedDevicesList) { struct InternalHalProbedDevice *currentProbedDevice; @@ -443,33 +470,6 @@ json_object *HalUtlGetJsonForSpecificDependenciesUsingUid(afb_api_t apiHandle, return requestedProbedDeviceJ; } -int HalUtlIsDependencySelected(struct InternalHalProbedDevice *probedDevice, enum DependencyStatus requestedStatus) -{ - if(! probedDevice) { - return 0; - } - - switch(requestedStatus) { - case UNAVAILABLE_DEPENDENCY: - if(! probedDevice->deviceData) - return 1; - else - return 0; - - case AVAILABLE_DEPENDENCY: - if(probedDevice->deviceData) - return 1; - else - return 0; - - case ALL_DEPENDENCY: - return 1; - - default: - return 0; - } -} - json_object *HalUtlGetJsonArrayForSelectedDependencies(afb_api_t apiHandle, struct InternalHalProbedDevice **probedDevicesList, enum DependencyInfoJsonFormat jsonFormat, -- cgit 1.2.3-korg