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

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

release-request-3c1c3700-216e-49d1-9df9-ce360055034d-for-git_oc-dr1-release-41...

release-request-3c1c3700-216e-49d1-9df9-ce360055034d-for-git_oc-dr1-release-4111683 snap-temp-L18000000075285549

Change-Id: I5c010472228c94d20b14fa725057c7a10e96edd2
parents 43621386 c35a5e29
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -863,6 +863,8 @@ bool copy_system_profile(const std::string& system_profile,
        return false;
    }

    // As a security measure we want to write the profile information with the reduced capabilities
    // of the package user id. So we fork and drop capabilities in the child.
    pid_t pid = fork();
    if (pid == 0) {
        /* child -- drop privileges before continuing */
@@ -900,7 +902,9 @@ bool copy_system_profile(const std::string& system_profile,
        if (flock(out_fd.get(), LOCK_UN) != 0) {
            PLOG(WARNING) << "Error unlocking profile " << data_profile_location;
        }
        exit(0);
        // Use _exit since we don't want to run the global destructors in the child.
        // b/62597429
        _exit(0);
    }
    /* parent */
    int return_code = wait_child(pid);
+2 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ public:
            const sp<SurfaceControl>& control, Parcel* parcel);

    sp<Surface> getSurface() const;
    sp<Surface> createSurface() const;
    sp<IBinder> getHandle() const;

    status_t clearLayerFrameStats() const;
@@ -155,6 +156,7 @@ private:

    ~SurfaceControl();

    sp<Surface> generateSurfaceLocked() const;
    status_t validate() const;
    void destroy();

+16 −3
Original line number Diff line number Diff line
@@ -237,17 +237,30 @@ status_t SurfaceControl::writeSurfaceToParcel(
    return parcel->writeStrongBinder(IInterface::asBinder(bp));
}

sp<Surface> SurfaceControl::getSurface() const
sp<Surface> SurfaceControl::generateSurfaceLocked() const
{
    Mutex::Autolock _l(mLock);
    if (mSurfaceData == 0) {
    // This surface is always consumed by SurfaceFlinger, so the
    // producerControlledByApp value doesn't matter; using false.
    mSurfaceData = new Surface(mGraphicBufferProducer, false);

    return mSurfaceData;
}

sp<Surface> SurfaceControl::getSurface() const
{
    Mutex::Autolock _l(mLock);
    if (mSurfaceData == 0) {
        return generateSurfaceLocked();
    }
    return mSurfaceData;
}

sp<Surface> SurfaceControl::createSurface() const
{
    Mutex::Autolock _l(mLock);
    return generateSurfaceLocked();
}

sp<IBinder> SurfaceControl::getHandle() const
{
    Mutex::Autolock lock(mLock);
+14 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#define LOG_TAG "Gralloc2"

#include <hidl/ServiceManagement.h>
#include <hwbinder/IPCThreadState.h>
#include <ui/Gralloc2.h>

@@ -250,4 +251,17 @@ Error Allocator::allocate(BufferDescriptor descriptor, uint32_t count,

} // namespace Gralloc2

namespace {
// Load the IMapper implementation library when this shared library is loaded, rather than when
// we (lazily) create the Gralloc2::Mapper instance. Since these libraries will all be needed by
// nearly all apps, this allows us to load them in Zygote rather than on each app launch.
class PreloadMapperImpl {
public:
    PreloadMapperImpl() {
        android::hardware::preloadPassthroughService<hardware::graphics::mapper::V2_0::IMapper>();
    }
};
static PreloadMapperImpl preloadMapperImpl;
} // namespace

} // namespace android
+3 −6
Original line number Diff line number Diff line
@@ -210,9 +210,6 @@ void HardwareComposer::UpdatePostThreadState(PostThreadStateType state,
}

void HardwareComposer::OnPostThreadResumed() {
  if (request_display_callback_)
    request_display_callback_(true);

  hwc2_hidl_->resetCommands();

  // HIDL HWC seems to have an internal race condition. If we submit a frame too
@@ -249,9 +246,6 @@ void HardwareComposer::OnPostThreadPaused() {

  // Trigger target-specific performance mode change.
  property_set(kDvrPerformanceProperty, "idle");

  if (request_display_callback_)
    request_display_callback_(false);
}

HWC::Error HardwareComposer::Validate(hwc2_display_t display) {
@@ -479,6 +473,9 @@ void HardwareComposer::SetDisplaySurfaces(
    pending_surfaces_ = std::move(surfaces);
  }

  if (request_display_callback_)
    request_display_callback_(!display_idle);

  // Set idle state based on whether there are any surfaces to handle.
  UpdatePostThreadState(PostThreadState::Idle, display_idle);
}
Loading