summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.cpp
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-02-03 22:29:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-03 22:29:43 +0000
commit5e135fe82318c370f4be7d2d552012dc9467a893 (patch)
tree63c9e18bdfbe46599cc4022b3b43f40bedd60aa2 /cmds/bootanimation/BootAnimation.cpp
parentd1395ead038cbf70041497f8c60e69b14f46a03c (diff)
parent69b281d5f3ad61490bd8795795cefaa1f4674401 (diff)
Merge "Adapt SurfaceControl to libgui API for display info"
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
-rw-r--r--cmds/bootanimation/BootAnimation.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 520366f518ab..a1278f358380 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -42,10 +42,10 @@
#include <android-base/properties.h>
+#include <ui/DisplayConfig.h>
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
#include <ui/Region.h>
-#include <ui/DisplayInfo.h>
#include <gui/ISurfaceComposer.h>
#include <gui/Surface.h>
@@ -283,16 +283,19 @@ status_t BootAnimation::readyToRun() {
mDisplayToken = SurfaceComposerClient::getInternalDisplayToken();
if (mDisplayToken == nullptr)
- return -1;
+ return NAME_NOT_FOUND;
- DisplayInfo dinfo;
- status_t status = SurfaceComposerClient::getDisplayInfo(mDisplayToken, &dinfo);
- if (status)
- return -1;
+ DisplayConfig displayConfig;
+ const status_t error =
+ SurfaceComposerClient::getActiveDisplayConfig(mDisplayToken, &displayConfig);
+ if (error != NO_ERROR)
+ return error;
+
+ const ui::Size& resolution = displayConfig.resolution;
// create the native surface
sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
- dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
+ resolution.getWidth(), resolution.getHeight(), PIXEL_FORMAT_RGB_565);
SurfaceComposerClient::Transaction t;