Loading libs/binder/IPCThreadState.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,11 @@ void IPCThreadState::disableBackgroundScheduling(bool disable) gDisableBackgroundScheduling = disable; } bool IPCThreadState::backgroundSchedulingDisabled() { return gDisableBackgroundScheduling; } sp<ProcessState> IPCThreadState::process() { return mProcess; Loading libs/binder/Parcel.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading libs/binder/include/binder/IPCThreadState.h +1 −0 Original line number Diff line number Diff line Loading @@ -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. Loading Loading
libs/binder/IPCThreadState.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,11 @@ void IPCThreadState::disableBackgroundScheduling(bool disable) gDisableBackgroundScheduling = disable; } bool IPCThreadState::backgroundSchedulingDisabled() { return gDisableBackgroundScheduling; } sp<ProcessState> IPCThreadState::process() { return mProcess; Loading
libs/binder/Parcel.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading
libs/binder/include/binder/IPCThreadState.h +1 −0 Original line number Diff line number Diff line Loading @@ -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. Loading