Updating ConfigurationDataGet api to include edid data.

Bug: 138398637

Test: manual - ran through modified unit test to make sure the edid data was returned on the MTP
845.

Change-Id: I171cf90d005a09a9cb6ee1081efee653cce47c4a
This commit is contained in:
mamik 2019-07-25 13:07:21 -07:00 committed by Mike Ma
parent 324922b5b1
commit a08194b008
4 changed files with 26 additions and 1 deletions

View file

@ -191,7 +191,8 @@ struct SurfaceInfo {
enum class ConfigFileType : uint32_t {
kLensMetrics,
kDeviceMetrics,
kDeviceConfiguration
kDeviceConfiguration,
kDeviceEdid
};
struct DisplayProtocol {

View file

@ -85,6 +85,8 @@ enum {
DVR_CONFIGURATION_DATA_DEVICE_METRICS = 1,
// Request the per device configuration data file.
DVR_CONFIGURATION_DATA_DEVICE_CONFIG = 2,
// Request the edid data for the display.
DVR_CONFIGURATION_DATA_DEVICE_EDID = 3,
};
// dvr_display_manager.h

View file

@ -44,6 +44,18 @@ DisplayService::DisplayService(Hwc2::Composer* hidl,
Endpoint::Create(display::DisplayProtocol::kClientPath)) {
hardware_composer_.Initialize(
hidl, primary_display_id, request_display_callback);
uint8_t port;
const auto error = hidl->getDisplayIdentificationData(
primary_display_id, &port, &display_identification_data_);
if (error != android::hardware::graphics::composer::V2_1::Error::NONE) {
if (error !=
android::hardware::graphics::composer::V2_1::Error::UNSUPPORTED) {
ALOGI("DisplayService: identification data error\n");
} else {
ALOGI("DisplayService: identification data unsupported\n");
}
}
}
bool DisplayService::IsInitialized() const {
@ -204,6 +216,12 @@ pdx::Status<std::string> DisplayService::OnGetConfigurationData(
case display::ConfigFileType::kDeviceConfiguration:
property_name = kDvrDeviceConfigProperty;
break;
case display::ConfigFileType::kDeviceEdid:
if (display_identification_data_.size() == 0) {
return ErrorStatus(ENOENT);
}
return std::string(display_identification_data_.begin(),
display_identification_data_.end());
default:
return ErrorStatus(EINVAL);
}

View file

@ -18,6 +18,8 @@
#include "epoll_event_dispatcher.h"
#include "hardware_composer.h"
#include "DisplayHardware/DisplayIdentification.h"
namespace android {
namespace dvr {
@ -117,6 +119,8 @@ class DisplayService : public pdx::ServiceBase<DisplayService> {
DisplayService(const DisplayService&) = delete;
void operator=(const DisplayService&) = delete;
DisplayIdentificationData display_identification_data_;
};
} // namespace dvr