Loading libs/adbd_auth/adbd_auth.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,10 @@ public: this->callbacks_.key_authorized(arg, id); this->dispatched_prompt_ = std::nullopt; // We need to dispatch pending prompts here upon success as well, // since we might have multiple queued prompts. DispatchPendingPrompt(); } else if (packet[0] == 'N' && packet[1] == 'O') { CHECK_EQ(2UL, packet.length()); // TODO: Do we want a callback if the key is denied? Loading libs/gui/DisplayEventDispatcher.cpp +17 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,10 @@ static const size_t EVENT_BUFFER_SIZE = 100; DisplayEventDispatcher::DisplayEventDispatcher(const sp<Looper>& looper, ISurfaceComposer::VsyncSource vsyncSource, ISurfaceComposer::ConfigChanged configChanged) : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false) { : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false), mConfigChangeFlag(configChanged) { ALOGV("dispatcher %p ~ Initializing display event dispatcher.", this); } Loading Loading @@ -86,6 +89,18 @@ status_t DisplayEventDispatcher::scheduleVsync() { return OK; } void DisplayEventDispatcher::toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) { if (mConfigChangeFlag == configChangeFlag) { return; } status_t status = mReceiver.toggleConfigEvents(configChangeFlag); if (status) { ALOGW("Failed enable config events, status=%d", status); return; } mConfigChangeFlag = configChangeFlag; } int DisplayEventDispatcher::handleEvent(int, int events, void*) { if (events & (Looper::EVENT_ERROR | Looper::EVENT_HANGUP)) { ALOGE("Display event receiver pipe was closed or an error occurred. " Loading Loading @@ -140,7 +155,7 @@ bool DisplayEventDispatcher::processPendingEvents(nsecs_t* outTimestamp, break; case DisplayEventReceiver::DISPLAY_EVENT_CONFIG_CHANGED: dispatchConfigChanged(ev.header.timestamp, ev.header.displayId, ev.config.configId); ev.config.configId, ev.config.vsyncPeriod); break; default: ALOGW("dispatcher %p ~ ignoring unknown event type %#x", this, ev.header.type); Loading libs/gui/DisplayEventReceiver.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,14 @@ status_t DisplayEventReceiver::requestNextVsync() { return NO_INIT; } status_t DisplayEventReceiver::toggleConfigEvents( ISurfaceComposer::ConfigChanged configChangeFlag) { if (mEventConnection != nullptr) { mEventConnection->toggleConfigEvents(configChangeFlag); return NO_ERROR; } return NO_INIT; } ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events, size_t count) { Loading libs/gui/IDisplayEventConnection.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ enum class Tag : uint32_t { STEAL_RECEIVE_CHANNEL = IBinder::FIRST_CALL_TRANSACTION, SET_VSYNC_RATE, REQUEST_NEXT_VSYNC, LAST = REQUEST_NEXT_VSYNC, TOGGLE_CONFIG_EVENTS, LAST = TOGGLE_CONFIG_EVENTS, }; } // Anonymous namespace Loading @@ -53,6 +54,12 @@ public: callRemoteAsync<decltype(&IDisplayEventConnection::requestNextVsync)>( Tag::REQUEST_NEXT_VSYNC); } void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) override { callRemoteAsync<decltype( &IDisplayEventConnection::toggleConfigEvents)>(Tag::TOGGLE_CONFIG_EVENTS, configChangeFlag); } }; // Out-of-line virtual method definition to trigger vtable emission in this translation unit (see Loading @@ -74,6 +81,8 @@ status_t BnDisplayEventConnection::onTransact(uint32_t code, const Parcel& data, return callLocal(data, reply, &IDisplayEventConnection::setVsyncRate); case Tag::REQUEST_NEXT_VSYNC: return callLocalAsync(data, reply, &IDisplayEventConnection::requestNextVsync); case Tag::TOGGLE_CONFIG_EVENTS: return callLocalAsync(data, reply, &IDisplayEventConnection::toggleConfigEvents); } } Loading libs/gui/SurfaceComposerClient.cpp +15 −7 Original line number Diff line number Diff line Loading @@ -484,14 +484,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr mListenerCallbacks[listener].callbackIds.insert(std::make_move_iterator( callbackIds.begin()), std::make_move_iterator(callbackIds.end())); // register surface controls for this listener that is merging for (const auto& surfaceControl : surfaceControls) { registerSurfaceControlForCallback(surfaceControl); } mListenerCallbacks[listener] .surfaceControls.insert(std::make_move_iterator(surfaceControls.begin()), mListenerCallbacks[listener].surfaceControls.insert(surfaceControls.begin(), surfaceControls.end()); auto& currentProcessCallbackInfo = mListenerCallbacks[TransactionCompletedListener::getIInstance()]; currentProcessCallbackInfo.surfaceControls .insert(std::make_move_iterator(surfaceControls.begin()), std::make_move_iterator(surfaceControls.end())); // register all surface controls for all callbackIds for this listener that is merging for (const auto& surfaceControl : currentProcessCallbackInfo.surfaceControls) { TransactionCompletedListener::getInstance() ->addSurfaceControlToCallbacks(surfaceControl, currentProcessCallbackInfo.callbackIds); } } mInputWindowCommands.merge(other.mInputWindowCommands); Loading Loading
libs/adbd_auth/adbd_auth.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,10 @@ public: this->callbacks_.key_authorized(arg, id); this->dispatched_prompt_ = std::nullopt; // We need to dispatch pending prompts here upon success as well, // since we might have multiple queued prompts. DispatchPendingPrompt(); } else if (packet[0] == 'N' && packet[1] == 'O') { CHECK_EQ(2UL, packet.length()); // TODO: Do we want a callback if the key is denied? Loading
libs/gui/DisplayEventDispatcher.cpp +17 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,10 @@ static const size_t EVENT_BUFFER_SIZE = 100; DisplayEventDispatcher::DisplayEventDispatcher(const sp<Looper>& looper, ISurfaceComposer::VsyncSource vsyncSource, ISurfaceComposer::ConfigChanged configChanged) : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false) { : mLooper(looper), mReceiver(vsyncSource, configChanged), mWaitingForVsync(false), mConfigChangeFlag(configChanged) { ALOGV("dispatcher %p ~ Initializing display event dispatcher.", this); } Loading Loading @@ -86,6 +89,18 @@ status_t DisplayEventDispatcher::scheduleVsync() { return OK; } void DisplayEventDispatcher::toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) { if (mConfigChangeFlag == configChangeFlag) { return; } status_t status = mReceiver.toggleConfigEvents(configChangeFlag); if (status) { ALOGW("Failed enable config events, status=%d", status); return; } mConfigChangeFlag = configChangeFlag; } int DisplayEventDispatcher::handleEvent(int, int events, void*) { if (events & (Looper::EVENT_ERROR | Looper::EVENT_HANGUP)) { ALOGE("Display event receiver pipe was closed or an error occurred. " Loading Loading @@ -140,7 +155,7 @@ bool DisplayEventDispatcher::processPendingEvents(nsecs_t* outTimestamp, break; case DisplayEventReceiver::DISPLAY_EVENT_CONFIG_CHANGED: dispatchConfigChanged(ev.header.timestamp, ev.header.displayId, ev.config.configId); ev.config.configId, ev.config.vsyncPeriod); break; default: ALOGW("dispatcher %p ~ ignoring unknown event type %#x", this, ev.header.type); Loading
libs/gui/DisplayEventReceiver.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,14 @@ status_t DisplayEventReceiver::requestNextVsync() { return NO_INIT; } status_t DisplayEventReceiver::toggleConfigEvents( ISurfaceComposer::ConfigChanged configChangeFlag) { if (mEventConnection != nullptr) { mEventConnection->toggleConfigEvents(configChangeFlag); return NO_ERROR; } return NO_INIT; } ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events, size_t count) { Loading
libs/gui/IDisplayEventConnection.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ enum class Tag : uint32_t { STEAL_RECEIVE_CHANNEL = IBinder::FIRST_CALL_TRANSACTION, SET_VSYNC_RATE, REQUEST_NEXT_VSYNC, LAST = REQUEST_NEXT_VSYNC, TOGGLE_CONFIG_EVENTS, LAST = TOGGLE_CONFIG_EVENTS, }; } // Anonymous namespace Loading @@ -53,6 +54,12 @@ public: callRemoteAsync<decltype(&IDisplayEventConnection::requestNextVsync)>( Tag::REQUEST_NEXT_VSYNC); } void toggleConfigEvents(ISurfaceComposer::ConfigChanged configChangeFlag) override { callRemoteAsync<decltype( &IDisplayEventConnection::toggleConfigEvents)>(Tag::TOGGLE_CONFIG_EVENTS, configChangeFlag); } }; // Out-of-line virtual method definition to trigger vtable emission in this translation unit (see Loading @@ -74,6 +81,8 @@ status_t BnDisplayEventConnection::onTransact(uint32_t code, const Parcel& data, return callLocal(data, reply, &IDisplayEventConnection::setVsyncRate); case Tag::REQUEST_NEXT_VSYNC: return callLocalAsync(data, reply, &IDisplayEventConnection::requestNextVsync); case Tag::TOGGLE_CONFIG_EVENTS: return callLocalAsync(data, reply, &IDisplayEventConnection::toggleConfigEvents); } } Loading
libs/gui/SurfaceComposerClient.cpp +15 −7 Original line number Diff line number Diff line Loading @@ -484,14 +484,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr mListenerCallbacks[listener].callbackIds.insert(std::make_move_iterator( callbackIds.begin()), std::make_move_iterator(callbackIds.end())); // register surface controls for this listener that is merging for (const auto& surfaceControl : surfaceControls) { registerSurfaceControlForCallback(surfaceControl); } mListenerCallbacks[listener] .surfaceControls.insert(std::make_move_iterator(surfaceControls.begin()), mListenerCallbacks[listener].surfaceControls.insert(surfaceControls.begin(), surfaceControls.end()); auto& currentProcessCallbackInfo = mListenerCallbacks[TransactionCompletedListener::getIInstance()]; currentProcessCallbackInfo.surfaceControls .insert(std::make_move_iterator(surfaceControls.begin()), std::make_move_iterator(surfaceControls.end())); // register all surface controls for all callbackIds for this listener that is merging for (const auto& surfaceControl : currentProcessCallbackInfo.surfaceControls) { TransactionCompletedListener::getInstance() ->addSurfaceControlToCallbacks(surfaceControl, currentProcessCallbackInfo.callbackIds); } } mInputWindowCommands.merge(other.mInputWindowCommands); Loading