Remove access of DisplayClient from vr_wm
It seems like this functionality relied on another pending patch that
will not come into the picture just yet. I am not reverting the full set
of patches, as they contained some other changes which are best left in.
Bug: None
Test: *pending*
Change-Id: I2d6b6ec8ba6acc98388e5f13a54ad2cea25c1a00
diff --git a/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp b/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
index 99e21ec..60ca818 100644
--- a/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
+++ b/services/vr/vr_window_manager/composer/impl/vr_hwc.cpp
@@ -312,32 +312,12 @@
return Error::BAD_CONFIG;
}
- int error = 0;
- auto display_client = DisplayClient::Create(&error);
- SystemDisplayMetrics metrics;
-
- if (error) {
- ALOGE("Could not connect to display service : %s(%d)", strerror(error), error);
- } else {
- error = display_client->GetDisplayMetrics(&metrics);
-
- if (error) {
- ALOGE("Could not get display metrics from display service : %s(%d)", strerror(error), error);
- }
- }
-
- if (error) {
- metrics.display_native_width = 1080;
- metrics.display_native_height = 1920;
- ALOGI("Setting display metrics to default : width=%d height=%d", metrics.display_native_width, metrics.display_native_height);
- }
-
switch (attribute) {
case IComposerClient::Attribute::WIDTH:
- *outValue = metrics.display_native_width;
+ *outValue = 1080;
break;
case IComposerClient::Attribute::HEIGHT:
- *outValue = metrics.display_native_height;
+ *outValue = 1920;
break;
case IComposerClient::Attribute::VSYNC_PERIOD:
*outValue = 1000 * 1000 * 1000 / 30; // 30fps
diff --git a/services/vr/vr_window_manager/surface_flinger_view.cpp b/services/vr/vr_window_manager/surface_flinger_view.cpp
index 46eb880..8411806 100644
--- a/services/vr/vr_window_manager/surface_flinger_view.cpp
+++ b/services/vr/vr_window_manager/surface_flinger_view.cpp
@@ -39,29 +39,9 @@
vr_composer_view_->Initialize(GetComposerViewFromIComposer(
vr_hwcomposer_.get()));
- int error = 0;
- auto display_client = DisplayClient::Create(&error);
- SystemDisplayMetrics metrics;
-
- if (error) {
- ALOGE("Could not connect to display service : %s(%d)", strerror(error), error);
- } else {
- error = display_client->GetDisplayMetrics(&metrics);
-
- if (error) {
- ALOGE("Could not get display metrics from display service : %s(%d)", strerror(error), error);
- }
- }
-
- if (error) {
- metrics.display_native_height = 1920;
- metrics.display_native_width = 1080;
- ALOGI("Setting display metrics to default : width=%d height=%d", metrics.display_native_height, metrics.display_native_width);
- }
-
// TODO(alexst): Refactor ShellView to account for orientation and change this back.
- width_ = metrics.display_native_height;
- height_ = metrics.display_native_width;
+ width_ = 1920;
+ height_ = 1080;
return true;
}