Loading services/displayservice/DisplayEventReceiver.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ #define LOG_TAG "libdisplayservicehidl" #include <displayservice/DisplayEventReceiver.h> Loading Loading @@ -43,7 +44,9 @@ sp<Looper> getLooper() { return looper; } DisplayEventReceiver::AttachedEvent::AttachedEvent(const sp<IEventCallback> &callback) : mCallback(callback) { DisplayEventReceiver::AttachedEvent::AttachedEvent(const sp<IEventCallback> &callback) : mCallback(callback) { mLooperAttached = getLooper()->addFd(mFwkReceiver.getFd(), Looper::POLL_CALLBACK, Looper::EVENT_INPUT, Loading Loading @@ -86,7 +89,7 @@ int DisplayEventReceiver::AttachedEvent::handleEvent(int fd, int events, void* / return 1; // keep the callback } const static size_t SIZE = 1; constexpr size_t SIZE = 1; ssize_t n; FwkReceiver::Event buf[SIZE]; Loading Loading @@ -149,11 +152,11 @@ Return<Status> DisplayEventReceiver::requestNextVsync() { } Return<Status> DisplayEventReceiver::close() { std::unique_lock<std::mutex> lock(mMutex); if (mAttached == nullptr) { return Status::BAD_VALUE; } std::unique_lock<std::mutex> lock(mMutex); bool success = mAttached->detach(); mAttached = nullptr; Loading services/displayservice/DisplayService.cpp +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <displayservice/DisplayService.h> #include <displayservice/DisplayEventReceiver.h> Loading services/displayservice/include/displayservice/DisplayEventReceiver.h +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYEVENTRECEIVER_H #define ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYEVENTRECEIVER_H Loading services/displayservice/include/displayservice/DisplayService.h +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYSERVICE_H #define ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYSERVICE_H Loading Loading
services/displayservice/DisplayEventReceiver.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ #define LOG_TAG "libdisplayservicehidl" #include <displayservice/DisplayEventReceiver.h> Loading Loading @@ -43,7 +44,9 @@ sp<Looper> getLooper() { return looper; } DisplayEventReceiver::AttachedEvent::AttachedEvent(const sp<IEventCallback> &callback) : mCallback(callback) { DisplayEventReceiver::AttachedEvent::AttachedEvent(const sp<IEventCallback> &callback) : mCallback(callback) { mLooperAttached = getLooper()->addFd(mFwkReceiver.getFd(), Looper::POLL_CALLBACK, Looper::EVENT_INPUT, Loading Loading @@ -86,7 +89,7 @@ int DisplayEventReceiver::AttachedEvent::handleEvent(int fd, int events, void* / return 1; // keep the callback } const static size_t SIZE = 1; constexpr size_t SIZE = 1; ssize_t n; FwkReceiver::Event buf[SIZE]; Loading Loading @@ -149,11 +152,11 @@ Return<Status> DisplayEventReceiver::requestNextVsync() { } Return<Status> DisplayEventReceiver::close() { std::unique_lock<std::mutex> lock(mMutex); if (mAttached == nullptr) { return Status::BAD_VALUE; } std::unique_lock<std::mutex> lock(mMutex); bool success = mAttached->detach(); mAttached = nullptr; Loading
services/displayservice/DisplayService.cpp +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <displayservice/DisplayService.h> #include <displayservice/DisplayEventReceiver.h> Loading
services/displayservice/include/displayservice/DisplayEventReceiver.h +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYEVENTRECEIVER_H #define ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYEVENTRECEIVER_H Loading
services/displayservice/include/displayservice/DisplayService.h +16 −0 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYSERVICE_H #define ANDROID_FRAMEWORKS_DISPLAYSERVICE_V1_0_DISPLAYSERVICE_H Loading