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

Commit a4a5fb54 authored by Martijn Coenen's avatar Martijn Coenen Committed by android-build-merger
Browse files

Merge "Correctly set minimum priority on nodes." into oc-dev

am: fc93a4bd

Change-Id: If7cb26f43e85a11cb99ce9be511c44d35ddaca02
parents da58bf4b fc93a4bd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -338,6 +338,11 @@ void IPCThreadState::disableBackgroundScheduling(bool disable)
    gDisableBackgroundScheduling = disable;
}

bool IPCThreadState::backgroundSchedulingDisabled()
{
    return gDisableBackgroundScheduling;
}

sp<ProcessState> IPCThreadState::process()
{
    return mProcess;
+8 −1
Original line number Diff line number Diff line
@@ -211,7 +211,14 @@ status_t flatten_binder(const sp<ProcessState>& /*proc*/,
{
    flat_binder_object obj;

    obj.flags = 0x7f | FLAT_BINDER_FLAG_ACCEPTS_FDS;
    if (IPCThreadState::self()->backgroundSchedulingDisabled()) {
        /* minimum priority for all nodes is nice 0 */
        obj.flags = FLAT_BINDER_FLAG_ACCEPTS_FDS;
    } else {
        /* minimum priority for all nodes is MAX_NICE(19) */
        obj.flags = 0x13 | FLAT_BINDER_FLAG_ACCEPTS_FDS;
    }

    if (binder != NULL) {
        IBinder *local = binder->localBinder();
        if (!local) {
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ public:
    // in to it but doesn't want to acquire locks in its services while in
    // the background.
    static  void                disableBackgroundScheduling(bool disable);
            bool                backgroundSchedulingDisabled();

            // Call blocks until the number of executing binder threads is less than
            // the maximum number of binder threads threads allowed for this process.