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

Commit 373b4c7b authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'master' into honeycomb-release

parents d101f107 4607aeda
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ public:
            uint32_t* width, uint32_t* height, PixelFormat* format,
            uint32_t reqWidth, uint32_t reqHeight) = 0;

    virtual status_t turnElectronBeamOff(int32_t mode) = 0;

    /* Signal surfaceflinger that there might be some work to do
     * This is an ASYNCHRONOUS call.
     */
@@ -143,7 +145,8 @@ public:
        FREEZE_DISPLAY,
        UNFREEZE_DISPLAY,
        SIGNAL,
        CAPTURE_SCREEN
        CAPTURE_SCREEN,
        TURN_ELECTRON_BEAM_OFF
    };

    virtual status_t    onTransact( uint32_t code,
+15 −0
Original line number Diff line number Diff line
@@ -142,6 +142,15 @@ public:
        return reply.readInt32();
    }

    virtual status_t turnElectronBeamOff(int32_t mode)
    {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeInt32(mode);
        remote()->transact(BnSurfaceComposer::TURN_ELECTRON_BEAM_OFF, data, &reply);
        return reply.readInt32();
    }

    virtual void signal() const
    {
        Parcel data, reply;
@@ -224,6 +233,12 @@ status_t BnSurfaceComposer::onTransact(
            reply->writeInt32(f);
            reply->writeInt32(res);
        } break;
        case TURN_ELECTRON_BEAM_OFF: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            int32_t mode = data.readInt32();
            status_t res = turnElectronBeamOff(mode);
            reply->writeInt32(res);
        }
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
+7 −9
Original line number Diff line number Diff line
@@ -432,10 +432,9 @@ void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropR
    switch (dropReason) {
    case DROP_REASON_POLICY:
#if DEBUG_INBOUND_EVENT_DETAILS
        LOGD("Dropped event because policy requested that it not be delivered to the application.");
        LOGD("Dropped event because policy consumed it.");
#endif
        reason = "inbound event was dropped because the policy requested that it not be "
                "delivered to the application";
        reason = "inbound event was dropped because the policy consumed it";
        break;
    case DROP_REASON_DISABLED:
        LOGI("Dropped event because input dispatch is disabled.");
@@ -625,15 +624,13 @@ bool InputDispatcher::dispatchKeyLocked(
        if (*dropReason == DROP_REASON_NOT_DROPPED) {
            *dropReason = DROP_REASON_POLICY;
        }
        resetTargetsLocked();
        setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_SUCCEEDED);
        return true;
    }

    // Clean up if dropping the event.
    if (*dropReason != DROP_REASON_NOT_DROPPED) {
        resetTargetsLocked();
        setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
        setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
                ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED);
        return true;
    }

@@ -713,7 +710,8 @@ bool InputDispatcher::dispatchMotionLocked(
    // Clean up if dropping the event.
    if (*dropReason != DROP_REASON_NOT_DROPPED) {
        resetTargetsLocked();
        setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
        setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
                ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED);
        return true;
    }

@@ -3396,7 +3394,7 @@ void InputDispatcher::InputState::synthesizeCancelationEvents(nsecs_t currentTim
        }
    }

    for (size_t i = 0; i < mMotionMementos.size(); i++) {
    for (size_t i = 0; i < mMotionMementos.size(); ) {
        const MotionMemento& memento = mMotionMementos.itemAt(i);
        if (shouldCancelEvent(memento.source, options)) {
            outEvents.push(allocator->obtainMotionEntry(currentTime,
+13 −5
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ status_t DisplayHardwareBase::ConsoleManagerThread::initCheck() const

DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger,
        uint32_t displayIndex) 
    : mCanDraw(true)
    : mCanDraw(true), mScreenAcquired(true)
{
    mDisplayEventThread = new DisplayEventThread(flinger);
    if (mDisplayEventThread->initCheck() != NO_ERROR) {
@@ -374,18 +374,21 @@ DisplayHardwareBase::~DisplayHardwareBase()
    mDisplayEventThread->requestExitAndWait();
}

void DisplayHardwareBase::setCanDraw(bool canDraw)
{
    mCanDraw = canDraw;
}

bool DisplayHardwareBase::canDraw() const
{
    return mCanDraw;
    return mCanDraw && mScreenAcquired;
}

void DisplayHardwareBase::releaseScreen() const
{
    status_t err = mDisplayEventThread->releaseScreen();
    if (err >= 0) {
        //LOGD("screen given-up");
        mCanDraw = false;
        mScreenAcquired = false;
    }
}

@@ -393,9 +396,14 @@ void DisplayHardwareBase::acquireScreen() const
{
    status_t err = mDisplayEventThread->acquireScreen();
    if (err >= 0) {
        //LOGD("screen returned");
        mCanDraw = true;
        mScreenAcquired = true;
    }
}

bool DisplayHardwareBase::isScreenAcquired() const
{
    return mScreenAcquired;
}

}; // namespace android
+5 −0
Original line number Diff line number Diff line
@@ -40,7 +40,11 @@ public:
    // console managment
    void releaseScreen() const;
    void acquireScreen() const;
    bool isScreenAcquired() const;

    bool canDraw() const;
    void setCanDraw(bool canDraw);


private:
    class DisplayEventThreadBase : public Thread {
@@ -89,6 +93,7 @@ private:

    sp<DisplayEventThreadBase>  mDisplayEventThread;
    mutable int                 mCanDraw;
    mutable int                 mScreenAcquired;
};

}; // namespace android
Loading