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

Commit d24a4b60 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-777c0f47-a42e-446a-b45c-0bb1aaa9612e-for-git_oc-release-406691...

release-request-777c0f47-a42e-446a-b45c-0bb1aaa9612e-for-git_oc-release-4066915 snap-temp-L92300000070444114

Change-Id: I02178b6da249240049b2c38c746232d74f494a0b
parents 46788a9b eb30998a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ static const char* native_processes_to_dump[] = {
        "/system/bin/sdcard",
        "/system/bin/surfaceflinger",
        "/system/bin/vehicle_network_service",
        "/vendor/bin/hw/android.hardware.media.omx@1.0-service", // media.codec
        NULL,
};

+7 −28
Original line number Diff line number Diff line
@@ -1182,14 +1182,8 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
            ALOGE("installd cannot compute input vdex location for '%s'\n", path);
            return false;
        }
        if (dexopt_action == DEX2OAT_FOR_BOOT_IMAGE) {
            // When we dex2oat because of boot image change, we are going to update
            // in-place the vdex file.
            in_vdex_wrapper_fd->reset(open(in_vdex_path_str.c_str(), O_RDWR, 0));
        } else {
        in_vdex_wrapper_fd->reset(open(in_vdex_path_str.c_str(), O_RDONLY, 0));
    }
    }

    // Infer the name of the output VDEX and create it.
    const std::string out_vdex_path_str = create_vdex_filename(out_oat_path);
@@ -1197,20 +1191,6 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
        return false;
    }

    // If we are compiling because the boot image is out of date, we do not
    // need to recreate a vdex, and can use the same existing one.
    if (dexopt_action == DEX2OAT_FOR_BOOT_IMAGE &&
            in_vdex_wrapper_fd->get() != -1 &&
            in_vdex_path_str == out_vdex_path_str) {
        // We unlink the file in case the invocation of dex2oat fails, to ensure we don't
        // have bogus stale vdex files.
        out_vdex_wrapper_fd->reset(
              in_vdex_wrapper_fd->get(),
              [out_vdex_path_str]() { unlink(out_vdex_path_str.c_str()); });
        // Disable auto close for the in wrapper fd (it will be done when destructing the out
        // wrapper).
        in_vdex_wrapper_fd->DisableAutoClose();
    } else {
    out_vdex_wrapper_fd->reset(
          open_output_file(out_vdex_path_str.c_str(), /*recreate*/true, /*permissions*/0644),
          [out_vdex_path_str]() { unlink(out_vdex_path_str.c_str()); });
@@ -1218,7 +1198,6 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_
        ALOGE("installd cannot open vdex'%s' during dexopt\n", out_vdex_path_str.c_str());
        return false;
    }
    }
    if (!set_permissions_and_ownership(out_vdex_wrapper_fd->get(), is_public, uid,
            out_vdex_path_str.c_str(), is_secondary_dex)) {
        ALOGE("installd cannot set owner '%s' for vdex during dexopt\n", out_vdex_path_str.c_str());
+14 −18
Original line number Diff line number Diff line
@@ -829,19 +829,15 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
            egl_tls_t::setContext(EGL_NO_CONTEXT);
        }
    } else {

        if (cur_c != NULL) {
            // Force return to current context for drivers that cannot handle errors
            EGLBoolean restore_result = EGL_FALSE;

            // get a reference to the old current objects
            ContextRef _c2(dp.get(), cur_c);
            SurfaceRef _d2(dp.get(), cur_c->draw);
            SurfaceRef _r2(dp.get(), cur_c->read);

        if (cur_c == NULL) {
            restore_result = dp->makeCurrent(c, cur_c,
                    EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT,
                    EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
        } else {
            c = cur_c;
            impl_ctx = c->context;
            impl_draw = EGL_NO_SURFACE;
@@ -857,7 +853,6 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
            restore_result = dp->makeCurrent(c, cur_c,
                    cur_c->draw, cur_c->read, cur_c->context,
                    impl_draw, impl_read, impl_ctx);
        }
            if (restore_result == EGL_TRUE) {
                _c2.acquire();
                _r2.acquire();
@@ -865,6 +860,7 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
            } else {
                ALOGE("Could not restore original EGL context");
            }
        }
        // this will ALOGE the error
        egl_connection_t* const cnx = &gEGLImpl;
        result = setError(cnx->egl.eglGetError(), (EGLBoolean)EGL_FALSE);
+25 −1
Original line number Diff line number Diff line
@@ -399,6 +399,10 @@ Rect Layer::computeScreenBounds(bool reduceTransparentRegion) const {
    Transform t = getTransform();
    win = t.transform(win);

    if (!s.finalCrop.isEmpty()) {
        win.intersect(s.finalCrop, &win);
    }

    const sp<Layer>& p = getParent();
    // Now we need to calculate the parent bounds, so we can clip ourselves to those.
    // When calculating the parent bounds for purposes of clipping,
@@ -2543,7 +2547,25 @@ bool Layer::reparentChildren(const sp<IBinder>& newParentHandle) {
    }

    for (const sp<Layer>& child : mCurrentChildren) {
        newParent->addChild(child);
        // We don't call addChild as we need to delay updating the child's parent pointer until
        // a transaction occurs. Remember a refresh could occur in between now and the next
        // transaction, in which case the Layer's parent pointer would be updated, but changes
        // made to the parent in the same transaction would not have applied.
        // This means that the following kind of scenario wont work:
        //
        // 1. Existing and visible child and parent surface exist
        // 2. Create new surface hidden
        // 3. Open transaction
        // 4. Show the new surface, and reparent the old surface's children to it.
        // 5. Close transaction.
        //
        // If we were to update the parent pointer immediately, then the child surface
        // could disappear for one frame as it pointed at the new parent which
        // hasn't yet become visible as the transaction hasn't yet occurred.
        //
        // Instead we defer the reparenting to commitChildList which happens as part
        // of the global transaction.
        newParent->mCurrentChildren.add(child);

        sp<Client> client(child->mClientRef.promote());
        if (client != nullptr) {
@@ -2713,6 +2735,8 @@ uint8_t Layer::getAlpha() const {
void Layer::commitChildList() {
    for (size_t i = 0; i < mCurrentChildren.size(); i++) {
        const auto& child = mCurrentChildren[i];
        child->setParent(this);

        child->commitChildList();
    }
    mDrawingChildren = mCurrentChildren;
+32 −0
Original line number Diff line number Diff line
@@ -834,6 +834,38 @@ TEST_F(ChildLayerTest, ChildLayerPositioning) {
    }
}

TEST_F(ChildLayerTest, ChildLayerCropping) {
    SurfaceComposerClient::openGlobalTransaction();
    mChild->show();
    mChild->setPosition(0, 0);
    mFGSurfaceControl->setPosition(0, 0);
    mFGSurfaceControl->setCrop(Rect(0, 0, 5, 5));
    SurfaceComposerClient::closeGlobalTransaction(true);

    {
        ScreenCapture::captureScreen(&mCapture);
        mCapture->expectChildColor(0, 0);
        mCapture->expectChildColor(4, 4);
        mCapture->expectBGColor(5, 5);
    }
}

TEST_F(ChildLayerTest, ChildLayerFinalCropping) {
    SurfaceComposerClient::openGlobalTransaction();
    mChild->show();
    mChild->setPosition(0, 0);
    mFGSurfaceControl->setPosition(0, 0);
    mFGSurfaceControl->setFinalCrop(Rect(0, 0, 5, 5));
    SurfaceComposerClient::closeGlobalTransaction(true);

    {
        ScreenCapture::captureScreen(&mCapture);
        mCapture->expectChildColor(0, 0);
        mCapture->expectChildColor(4, 4);
        mCapture->expectBGColor(5, 5);
    }
}

TEST_F(ChildLayerTest, ChildLayerConstraints) {
    SurfaceComposerClient::openGlobalTransaction();
    mChild->show();