Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0956c4dc authored by Aaron Kling's avatar Aaron Kling Committed by Jan Altensen
Browse files

BootAnimation: Check for resolution override

Change-Id: Ib001ce767067e3789ea5957ac9b23ed416341d18
parent 83340a2f
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -505,7 +505,19 @@ status_t BootAnimation::readyToRun() {

    mMaxWidth = android::base::GetIntProperty("ro.surface_flinger.max_graphics_width", 0);
    mMaxHeight = android::base::GetIntProperty("ro.surface_flinger.max_graphics_height", 0);
    ui::Size resolution = displayMode.resolution;

    // check for overridden ui resolution
    ui::Size resolution;
    char *endptr;
    std::string size_override = android::base::GetProperty("ro.config.size_override", "");

    resolution.width = strtoimax(size_override.c_str(), &endptr, 10);
    if (endptr[0] == ',')
        resolution.height = strtoimax(endptr+1, NULL, 10);

    if (resolution.width <= 0 || resolution.height <= 0)
        resolution = displayMode.resolution;

    resolution = limitSurfaceSize(resolution.width, resolution.height);
    // create the native surface
    sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
@@ -554,6 +566,11 @@ status_t BootAnimation::readyToRun() {
        t.setLayerStack(control, LAYER_STACK);
    }

    // Scale forced resolution to physical resolution
    Rect forcedRes(0, 0, resolution.width, resolution.height);
    Rect physRes(0, 0, displayMode.resolution.width, displayMode.resolution.height);
    t.setDisplayProjection(mDisplayToken, ui::ROTATION_0, forcedRes, physRes);

    t.setLayer(control, 0x40000000)
        .apply();