Loading include/surfaceflinger/ISurfaceComposer.h +4 −1 Original line number Original line Diff line number Diff line Loading @@ -119,6 +119,8 @@ public: uint32_t* width, uint32_t* height, PixelFormat* format, uint32_t* width, uint32_t* height, PixelFormat* format, uint32_t reqWidth, uint32_t reqHeight) = 0; 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 /* Signal surfaceflinger that there might be some work to do * This is an ASYNCHRONOUS call. * This is an ASYNCHRONOUS call. */ */ Loading @@ -143,7 +145,8 @@ public: FREEZE_DISPLAY, FREEZE_DISPLAY, UNFREEZE_DISPLAY, UNFREEZE_DISPLAY, SIGNAL, SIGNAL, CAPTURE_SCREEN CAPTURE_SCREEN, TURN_ELECTRON_BEAM_OFF }; }; virtual status_t onTransact( uint32_t code, virtual status_t onTransact( uint32_t code, Loading libs/surfaceflinger_client/ISurfaceComposer.cpp +15 −0 Original line number Original line Diff line number Diff line Loading @@ -142,6 +142,15 @@ public: return reply.readInt32(); 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 virtual void signal() const { { Parcel data, reply; Parcel data, reply; Loading Loading @@ -224,6 +233,12 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(f); reply->writeInt32(f); reply->writeInt32(res); reply->writeInt32(res); } break; } 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: default: return BBinder::onTransact(code, data, reply, flags); return BBinder::onTransact(code, data, reply, flags); } } Loading libs/ui/InputDispatcher.cpp +7 −9 Original line number Original line Diff line number Diff line Loading @@ -432,10 +432,9 @@ void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropR switch (dropReason) { switch (dropReason) { case DROP_REASON_POLICY: case DROP_REASON_POLICY: #if DEBUG_INBOUND_EVENT_DETAILS #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 #endif reason = "inbound event was dropped because the policy requested that it not be " reason = "inbound event was dropped because the policy consumed it"; "delivered to the application"; break; break; case DROP_REASON_DISABLED: case DROP_REASON_DISABLED: LOGI("Dropped event because input dispatch is disabled."); LOGI("Dropped event because input dispatch is disabled."); Loading Loading @@ -625,15 +624,13 @@ bool InputDispatcher::dispatchKeyLocked( if (*dropReason == DROP_REASON_NOT_DROPPED) { if (*dropReason == DROP_REASON_NOT_DROPPED) { *dropReason = DROP_REASON_POLICY; *dropReason = DROP_REASON_POLICY; } } resetTargetsLocked(); setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_SUCCEEDED); return true; } } // Clean up if dropping the event. // Clean up if dropping the event. if (*dropReason != DROP_REASON_NOT_DROPPED) { if (*dropReason != DROP_REASON_NOT_DROPPED) { resetTargetsLocked(); resetTargetsLocked(); setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED); setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED); return true; return true; } } Loading Loading @@ -713,7 +710,8 @@ bool InputDispatcher::dispatchMotionLocked( // Clean up if dropping the event. // Clean up if dropping the event. if (*dropReason != DROP_REASON_NOT_DROPPED) { if (*dropReason != DROP_REASON_NOT_DROPPED) { resetTargetsLocked(); resetTargetsLocked(); setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED); setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED); return true; return true; } } Loading Loading @@ -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); const MotionMemento& memento = mMotionMementos.itemAt(i); if (shouldCancelEvent(memento.source, options)) { if (shouldCancelEvent(memento.source, options)) { outEvents.push(allocator->obtainMotionEntry(currentTime, outEvents.push(allocator->obtainMotionEntry(currentTime, Loading services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp +13 −5 Original line number Original line Diff line number Diff line Loading @@ -359,7 +359,7 @@ status_t DisplayHardwareBase::ConsoleManagerThread::initCheck() const DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger, DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger, uint32_t displayIndex) uint32_t displayIndex) : mCanDraw(true) : mCanDraw(true), mScreenAcquired(true) { { mDisplayEventThread = new DisplayEventThread(flinger); mDisplayEventThread = new DisplayEventThread(flinger); if (mDisplayEventThread->initCheck() != NO_ERROR) { if (mDisplayEventThread->initCheck() != NO_ERROR) { Loading @@ -374,18 +374,21 @@ DisplayHardwareBase::~DisplayHardwareBase() mDisplayEventThread->requestExitAndWait(); mDisplayEventThread->requestExitAndWait(); } } void DisplayHardwareBase::setCanDraw(bool canDraw) { mCanDraw = canDraw; } bool DisplayHardwareBase::canDraw() const bool DisplayHardwareBase::canDraw() const { { return mCanDraw; return mCanDraw && mScreenAcquired; } } void DisplayHardwareBase::releaseScreen() const void DisplayHardwareBase::releaseScreen() const { { status_t err = mDisplayEventThread->releaseScreen(); status_t err = mDisplayEventThread->releaseScreen(); if (err >= 0) { if (err >= 0) { //LOGD("screen given-up"); mScreenAcquired = false; mCanDraw = false; } } } } Loading @@ -393,9 +396,14 @@ void DisplayHardwareBase::acquireScreen() const { { status_t err = mDisplayEventThread->acquireScreen(); status_t err = mDisplayEventThread->acquireScreen(); if (err >= 0) { if (err >= 0) { //LOGD("screen returned"); mCanDraw = true; mCanDraw = true; mScreenAcquired = true; } } } bool DisplayHardwareBase::isScreenAcquired() const { return mScreenAcquired; } } }; // namespace android }; // namespace android services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,11 @@ public: // console managment // console managment void releaseScreen() const; void releaseScreen() const; void acquireScreen() const; void acquireScreen() const; bool isScreenAcquired() const; bool canDraw() const; bool canDraw() const; void setCanDraw(bool canDraw); private: private: class DisplayEventThreadBase : public Thread { class DisplayEventThreadBase : public Thread { Loading Loading @@ -89,6 +93,7 @@ private: sp<DisplayEventThreadBase> mDisplayEventThread; sp<DisplayEventThreadBase> mDisplayEventThread; mutable int mCanDraw; mutable int mCanDraw; mutable int mScreenAcquired; }; }; }; // namespace android }; // namespace android Loading Loading
include/surfaceflinger/ISurfaceComposer.h +4 −1 Original line number Original line Diff line number Diff line Loading @@ -119,6 +119,8 @@ public: uint32_t* width, uint32_t* height, PixelFormat* format, uint32_t* width, uint32_t* height, PixelFormat* format, uint32_t reqWidth, uint32_t reqHeight) = 0; 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 /* Signal surfaceflinger that there might be some work to do * This is an ASYNCHRONOUS call. * This is an ASYNCHRONOUS call. */ */ Loading @@ -143,7 +145,8 @@ public: FREEZE_DISPLAY, FREEZE_DISPLAY, UNFREEZE_DISPLAY, UNFREEZE_DISPLAY, SIGNAL, SIGNAL, CAPTURE_SCREEN CAPTURE_SCREEN, TURN_ELECTRON_BEAM_OFF }; }; virtual status_t onTransact( uint32_t code, virtual status_t onTransact( uint32_t code, Loading
libs/surfaceflinger_client/ISurfaceComposer.cpp +15 −0 Original line number Original line Diff line number Diff line Loading @@ -142,6 +142,15 @@ public: return reply.readInt32(); 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 virtual void signal() const { { Parcel data, reply; Parcel data, reply; Loading Loading @@ -224,6 +233,12 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(f); reply->writeInt32(f); reply->writeInt32(res); reply->writeInt32(res); } break; } 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: default: return BBinder::onTransact(code, data, reply, flags); return BBinder::onTransact(code, data, reply, flags); } } Loading
libs/ui/InputDispatcher.cpp +7 −9 Original line number Original line Diff line number Diff line Loading @@ -432,10 +432,9 @@ void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropR switch (dropReason) { switch (dropReason) { case DROP_REASON_POLICY: case DROP_REASON_POLICY: #if DEBUG_INBOUND_EVENT_DETAILS #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 #endif reason = "inbound event was dropped because the policy requested that it not be " reason = "inbound event was dropped because the policy consumed it"; "delivered to the application"; break; break; case DROP_REASON_DISABLED: case DROP_REASON_DISABLED: LOGI("Dropped event because input dispatch is disabled."); LOGI("Dropped event because input dispatch is disabled."); Loading Loading @@ -625,15 +624,13 @@ bool InputDispatcher::dispatchKeyLocked( if (*dropReason == DROP_REASON_NOT_DROPPED) { if (*dropReason == DROP_REASON_NOT_DROPPED) { *dropReason = DROP_REASON_POLICY; *dropReason = DROP_REASON_POLICY; } } resetTargetsLocked(); setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_SUCCEEDED); return true; } } // Clean up if dropping the event. // Clean up if dropping the event. if (*dropReason != DROP_REASON_NOT_DROPPED) { if (*dropReason != DROP_REASON_NOT_DROPPED) { resetTargetsLocked(); resetTargetsLocked(); setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED); setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED); return true; return true; } } Loading Loading @@ -713,7 +710,8 @@ bool InputDispatcher::dispatchMotionLocked( // Clean up if dropping the event. // Clean up if dropping the event. if (*dropReason != DROP_REASON_NOT_DROPPED) { if (*dropReason != DROP_REASON_NOT_DROPPED) { resetTargetsLocked(); resetTargetsLocked(); setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED); setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED); return true; return true; } } Loading Loading @@ -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); const MotionMemento& memento = mMotionMementos.itemAt(i); if (shouldCancelEvent(memento.source, options)) { if (shouldCancelEvent(memento.source, options)) { outEvents.push(allocator->obtainMotionEntry(currentTime, outEvents.push(allocator->obtainMotionEntry(currentTime, Loading
services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp +13 −5 Original line number Original line Diff line number Diff line Loading @@ -359,7 +359,7 @@ status_t DisplayHardwareBase::ConsoleManagerThread::initCheck() const DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger, DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger, uint32_t displayIndex) uint32_t displayIndex) : mCanDraw(true) : mCanDraw(true), mScreenAcquired(true) { { mDisplayEventThread = new DisplayEventThread(flinger); mDisplayEventThread = new DisplayEventThread(flinger); if (mDisplayEventThread->initCheck() != NO_ERROR) { if (mDisplayEventThread->initCheck() != NO_ERROR) { Loading @@ -374,18 +374,21 @@ DisplayHardwareBase::~DisplayHardwareBase() mDisplayEventThread->requestExitAndWait(); mDisplayEventThread->requestExitAndWait(); } } void DisplayHardwareBase::setCanDraw(bool canDraw) { mCanDraw = canDraw; } bool DisplayHardwareBase::canDraw() const bool DisplayHardwareBase::canDraw() const { { return mCanDraw; return mCanDraw && mScreenAcquired; } } void DisplayHardwareBase::releaseScreen() const void DisplayHardwareBase::releaseScreen() const { { status_t err = mDisplayEventThread->releaseScreen(); status_t err = mDisplayEventThread->releaseScreen(); if (err >= 0) { if (err >= 0) { //LOGD("screen given-up"); mScreenAcquired = false; mCanDraw = false; } } } } Loading @@ -393,9 +396,14 @@ void DisplayHardwareBase::acquireScreen() const { { status_t err = mDisplayEventThread->acquireScreen(); status_t err = mDisplayEventThread->acquireScreen(); if (err >= 0) { if (err >= 0) { //LOGD("screen returned"); mCanDraw = true; mCanDraw = true; mScreenAcquired = true; } } } bool DisplayHardwareBase::isScreenAcquired() const { return mScreenAcquired; } } }; // namespace android }; // namespace android
services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,11 @@ public: // console managment // console managment void releaseScreen() const; void releaseScreen() const; void acquireScreen() const; void acquireScreen() const; bool isScreenAcquired() const; bool canDraw() const; bool canDraw() const; void setCanDraw(bool canDraw); private: private: class DisplayEventThreadBase : public Thread { class DisplayEventThreadBase : public Thread { Loading Loading @@ -89,6 +93,7 @@ private: sp<DisplayEventThreadBase> mDisplayEventThread; sp<DisplayEventThreadBase> mDisplayEventThread; mutable int mCanDraw; mutable int mCanDraw; mutable int mScreenAcquired; }; }; }; // namespace android }; // namespace android Loading