From e726683f477ba0d5e2193f44a23c1eee03598774 Mon Sep 17 00:00:00 2001 From: yayaws_zk <584363327@qq.com> Date: Thu, 21 Aug 2025 11:38:19 +0000 Subject: [PATCH 1/2] !84 fix hwservicemanager wait binder timeout fix hwservicemanager wait binder timeout delete va makefile --- aosp/system/hwservicemanager/service.cpp | 229 +++++++++++++ aosp/system/libhwbinder/ProcessState.cpp | 3 +- .../include/hwbinder/ProcessState.h | 134 ++++++++ aosp/vendor/isula/vagpu/Android.bp | 27 -- aosp/vendor/isula/vagpu/Android.mk | 315 ------------------ 5 files changed, 365 insertions(+), 343 deletions(-) create mode 100644 aosp/system/hwservicemanager/service.cpp create mode 100644 aosp/system/libhwbinder/include/hwbinder/ProcessState.h delete mode 100644 aosp/vendor/isula/vagpu/Android.bp delete mode 100644 aosp/vendor/isula/vagpu/Android.mk diff --git a/aosp/system/hwservicemanager/service.cpp b/aosp/system/hwservicemanager/service.cpp new file mode 100644 index 000000000..dd441b558 --- /dev/null +++ b/aosp/system/hwservicemanager/service.cpp @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2016 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. + */ + +#define LOG_TAG "hwservicemanager" + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ServiceManager.h" +#include "TokenManager.h" + +#define ONE_MS_IN_US 1000 +#define ONE_SECOND_IN_US (1000 * (ONE_MS_IN_US)) +#define TWO_MINUTES_IN_US (120 * (ONE_SECOND_IN_US)) +#define min(a, b) ((a) < (b) ? (a) : (b)) + +int gSleepTime = 50 * ONE_MS_IN_US; +int gTotalTime = 0; + +// libutils: +using android::sp; +using android::Looper; +using android::LooperCallback; + +// libhwbinder: +using android::hardware::BHwBinder; +using android::hardware::IBinder; +using android::hardware::IPCThreadState; +using android::hardware::ProcessState; + +// libhidl +using android::hardware::handleTransportPoll; +using android::hardware::setRequestingSid; +using android::hardware::HidlReturnRestriction; +using android::hardware::setProcessHidlReturnRestriction; +using android::hardware::setupTransportPolling; +using android::hardware::toBinder; + +// implementations +using android::hidl::manager::implementation::ServiceManager; +using android::hidl::manager::V1_0::IServiceManager; +using android::hidl::token::V1_0::implementation::TokenManager; + +static std::string serviceName = "default"; + +class HwBinderCallback : public LooperCallback { +public: + static sp setupTo(const sp& looper) { + sp cb = new HwBinderCallback; + + int fdHwBinder = setupTransportPolling(); + LOG_ALWAYS_FATAL_IF(fdHwBinder < 0, "Failed to setupTransportPolling: %d", fdHwBinder); + + // Flush after setupPolling(), to make sure the binder driver + // knows about this thread handling commands. + IPCThreadState::self()->flushCommands(); + + int ret = looper->addFd(fdHwBinder, + Looper::POLL_CALLBACK, + Looper::EVENT_INPUT, + cb, + nullptr /*data*/); + LOG_ALWAYS_FATAL_IF(ret != 1, "Failed to add binder FD to Looper"); + + return cb; + } + + int handleEvent(int fd, int /*events*/, void* /*data*/) override { + handleTransportPoll(fd); + return 1; // Continue receiving callbacks. + } +}; + +// LooperCallback for IClientCallback +class ClientCallbackCallback : public LooperCallback { +public: + static sp setupTo(const sp& looper, const sp& manager) { + sp cb = new ClientCallbackCallback(manager); + + int fdTimer = timerfd_create(CLOCK_MONOTONIC, 0 /*flags*/); + LOG_ALWAYS_FATAL_IF(fdTimer < 0, "Failed to timerfd_create: fd: %d err: %d", fdTimer, errno); + + itimerspec timespec { + .it_interval = { + .tv_sec = 5, + .tv_nsec = 0, + }, + .it_value = { + .tv_sec = 5, + .tv_nsec = 0, + }, + }; + + int timeRes = timerfd_settime(fdTimer, 0 /*flags*/, ×pec, nullptr); + LOG_ALWAYS_FATAL_IF(timeRes < 0, "Failed to timerfd_settime: res: %d err: %d", timeRes, errno); + + int addRes = looper->addFd(fdTimer, + Looper::POLL_CALLBACK, + Looper::EVENT_INPUT, + cb, + nullptr); + LOG_ALWAYS_FATAL_IF(addRes != 1, "Failed to add client callback FD to Looper"); + + return cb; + } + + int handleEvent(int fd, int /*events*/, void* /*data*/) override { + uint64_t expirations; + int ret = read(fd, &expirations, sizeof(expirations)); + if (ret != sizeof(expirations)) { + ALOGE("Read failed to callback FD: ret: %d err: %d", ret, errno); + } + + mManager->handleClientCallbacks(); + return 1; // Continue receiving callbacks. + } +private: + ClientCallbackCallback(const sp& manager) : mManager(manager) {} + sp mManager; +}; + +bool wait_for_binder() { + if (gSleepTime < ONE_SECOND_IN_US) { + gSleepTime = min(ONE_SECOND_IN_US, gSleepTime * 2); + } + + usleep(gSleepTime); + + gTotalTime += gSleepTime; + if (gTotalTime < TWO_MINUTES_IN_US) { + // wait for 2min + return true; + } + return false; +} + +int main() { + // If hwservicemanager crashes, the system may be unstable and hard to debug. This is both why + // we log this and why we care about this at all. + setProcessHidlReturnRestriction(HidlReturnRestriction::ERROR_IF_UNCHECKED); + + // TODO(b/36424585): make fatal + ProcessState::self()->setCallRestriction(ProcessState::CallRestriction::ERROR_IF_NOT_ONEWAY); + if (!android::hardware::isHidlSupported()) { + ALOGI("HIDL is not supported on this device so hwservicemanager is not needed"); + int rc = property_set("hwservicemanager.disabled", "true"); + if (rc) { + LOG_ALWAYS_FATAL("Failed to set \"hwservicemanager.disabled\" (error %d).\"", rc); + } + // wait here for init to see the proprty and shut us down + while (true) { + ALOGW("Waiting on init to shut this process down."); + sleep(10); + } + } + + sp manager = new ServiceManager(); + setRequestingSid(manager, true); + + if (!manager->add(serviceName, manager).withDefault(false)) { + ALOGE("Failed to register hwservicemanager with itself."); + } + + sp tokenManager = new TokenManager(); + if (!manager->add(serviceName, tokenManager).withDefault(false)) { + ALOGE("Failed to register ITokenManager with hwservicemanager."); + } + + // Tell IPCThreadState we're the service manager + sp binder = toBinder(manager); + sp service = static_cast(binder.get()); // local binder object + IPCThreadState::self()->setTheContextObject(service); + // Then tell the kernel + while (!ProcessState::self()->becomeContextManager()) { + if (wait_for_binder()) { + ALOGW("Wait for binder driver(%s)\n", strerror(errno)); + continue; + } + ALOGE("Failed for become ContextManager(%s)", strerror(errno)); + break; + } + + int rc = property_set("hwservicemanager.ready", "true"); + if (rc) { + ALOGE("Failed to set \"hwservicemanager.ready\" (error %d). "\ + "HAL services will not start!\n", rc); + } + + sp looper = Looper::prepare(0 /* opts */); + + (void)HwBinderCallback::setupTo(looper); + (void)ClientCallbackCallback::setupTo(looper, manager); + + ALOGI("hwservicemanager is ready now."); + + while (true) { + looper->pollAll(-1 /* timeoutMillis */); + } + + return 0; +} diff --git a/aosp/system/libhwbinder/ProcessState.cpp b/aosp/system/libhwbinder/ProcessState.cpp index d235cdaee..3f5184f95 100644 --- a/aosp/system/libhwbinder/ProcessState.cpp +++ b/aosp/system/libhwbinder/ProcessState.cpp @@ -120,7 +120,7 @@ sp ProcessState::getContextObject(const sp& /*caller*/) return getStrongProxyForHandle(0); } -void ProcessState::becomeContextManager() +bool ProcessState::becomeContextManager() { AutoMutex _l(mLock); @@ -142,6 +142,7 @@ void ProcessState::becomeContextManager() if (result == -1) { ALOGE("Binder ioctl to become context manager failed: %s\n", strerror(errno)); } + return result == 0 } // Get references to userspace objects held by the kernel binder driver diff --git a/aosp/system/libhwbinder/include/hwbinder/ProcessState.h b/aosp/system/libhwbinder/include/hwbinder/ProcessState.h new file mode 100644 index 000000000..a814e65cf --- /dev/null +++ b/aosp/system/libhwbinder/include/hwbinder/ProcessState.h @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2005 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_HARDWARE_PROCESS_STATE_H +#define ANDROID_HARDWARE_PROCESS_STATE_H + +#include +#include +#include +#include + +#include + +#include + +// WARNING: this code is part of libhwbinder, a fork of libbinder. Generally, +// this means that it is only relevant to HIDL. Any AIDL- or libbinder-specific +// code should not try to use these things. + +// --------------------------------------------------------------------------- +namespace android { +namespace hardware { + +class IPCThreadState; + +class ProcessState : public virtual RefBase +{ +public: + static sp self(); + static sp selfOrNull(); + // Note: don't call self() or selfOrNull() before initWithMmapSize() + // with '0' as an argument, this is the same as selfOrNull + static sp initWithMmapSize(size_t mmapSize); // size in bytes + + void startThreadPool(); + + sp getContextObject(const sp& /*caller*/); + // only call once, without creating a pool + bool becomeContextManager(); + + sp getStrongProxyForHandle(int32_t handle); + wp getWeakProxyForHandle(int32_t handle); + void expungeHandle(int32_t handle, IBinder* binder); + + void spawnPooledThread(bool isMain); + + status_t setThreadPoolConfiguration(size_t maxThreads, bool callerJoinsPool); + status_t enableOnewaySpamDetection(bool enable); + size_t getMaxThreads(); + void giveThreadPoolName(); + + ssize_t getKernelReferences(size_t count, uintptr_t* buf); + // This refcount includes: + // 1. Strong references to the node by this and other processes + // 2. Temporary strong references held by the kernel during a + // transaction on the node. + // It does NOT include local strong references to the node + ssize_t getStrongRefCountForNodeByHandle(int32_t handle); + size_t getMmapSize(); + + enum class CallRestriction { + // all calls okay + NONE, + // log when calls are blocking + ERROR_IF_NOT_ONEWAY, + // abort process on blocking calls + FATAL_IF_NOT_ONEWAY, + }; + // Sets calling restrictions for all transactions in this process. This must be called + // before any threads are spawned. + void setCallRestriction(CallRestriction restriction); + +private: + static sp init(size_t mmapSize, bool requireMmapSize); + + friend class IPCThreadState; + explicit ProcessState(size_t mmapSize); + ~ProcessState(); + + ProcessState(const ProcessState& o); + ProcessState& operator=(const ProcessState& o); + String8 makeBinderThreadName(); + + struct handle_entry { + IBinder* binder; + RefBase::weakref_type* refs; + }; + + handle_entry* lookupHandleLocked(int32_t handle); + + int mDriverFD; + void* mVMStart; + + // Protects thread count variable below. + pthread_mutex_t mThreadCountLock; + // Number of binder threads current executing a command. + size_t mExecutingThreadsCount; + // Maximum number for binder threads allowed for this process. + size_t mMaxThreads; + // Time when thread pool was emptied + int64_t mStarvationStartTimeMs; + + mutable Mutex mLock; // protects everything below. + + VectormHandleToObject; + + String8 mRootDir; + bool mThreadPoolStarted; + bool mSpawnThreadOnStart; + volatile int32_t mThreadPoolSeq; + const size_t mMmapSize; + + CallRestriction mCallRestriction; +}; + +} // namespace hardware +} // namespace android + +// --------------------------------------------------------------------------- + +#endif // ANDROID_HARDWARE_PROCESS_STATE_H diff --git a/aosp/vendor/isula/vagpu/Android.bp b/aosp/vendor/isula/vagpu/Android.bp deleted file mode 100644 index 103c509e0..000000000 --- a/aosp/vendor/isula/vagpu/Android.bp +++ /dev/null @@ -1,27 +0,0 @@ -cc_prebuilt_library_shared { - name: "libvaccrt", - vendor_available: true, - compile_multilib: "both", - target: { - android_arm: { - srcs: ["system/vendor/lib/libvaccrt.so"], - }, - android_arm64: { - srcs: ["system/vendor/lib64/libvaccrt.so"], - }, - }, -} - -cc_prebuilt_library_shared { - name: "libc++_shared", - vendor_available: true, - compile_multilib: "both", - target: { - android_arm: { - srcs: ["system/vendor/lib/libc++_shared.so"], - }, - android_arm64: { - srcs: ["system/vendor/lib64/libc++_shared.so"], - }, - }, -} \ No newline at end of file diff --git a/aosp/vendor/isula/vagpu/Android.mk b/aosp/vendor/isula/vagpu/Android.mk deleted file mode 100644 index 5238f9e53..000000000 --- a/aosp/vendor/isula/vagpu/Android.mk +++ /dev/null @@ -1,315 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -define install-va-shared-libs -include $$(CLEAR_VARS) -LOCAL_MODULE := $1 -LOCAL_VENDOR_MODULE := true -LOCAL_SRC_FILES_arm64 := $2 -ifneq ($3,) -LOCAL_SRC_FILES_arm := $3 -endif -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -ifneq ($4,) -LOCAL_MODULE_RELATIVE_PATH := $4 -endif -LOCAL_MODULE_SUFFIX := .so -LOCAL_CHECK_ELF_FILES := false -ifneq ($5,) -LOCAL_MULTILIB := $5 -endif -include $$(BUILD_PREBUILT) -endef - -define install-codec-libs-to-system -include $$(CLEAR_VARS) -LOCAL_MODULE := $1 -LOCAL_SRC_FILES_arm64 := $2 -ifneq ($3,) -LOCAL_SRC_FILES_arm := $3 -endif -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -ifneq ($4,) -LOCAL_MODULE_RELATIVE_PATH := $4 -endif -LOCAL_MODULE_SUFFIX := .so -LOCAL_CHECK_ELF_FILES := false -ifneq ($5,) -LOCAL_MULTILIB := $5 -endif -include $$(BUILD_PREBUILT) -endef - -define install-va-video-libs -include $$(CLEAR_VARS) -LOCAL_MODULE := $1 -LOCAL_VENDOR_MODULE := true -LOCAL_SRC_FILES_arm64 := $2 -ifneq ($3,) -LOCAL_SRC_FILES_arm := $3 -endif -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -ifneq ($4,) -LOCAL_MODULE_RELATIVE_PATH := $4 -endif -LOCAL_CHECK_ELF_FILES := false -ifneq ($5,) -LOCAL_MULTILIB := $5 -endif -include $$(BUILD_PREBUILT) -endef - -define install-va-configs -include $$(CLEAR_VARS) -LOCAL_MODULE := $1 -LOCAL_VENDOR_MODULE := true -LOCAL_SRC_FILES_arm64 := $2 -ifneq ($3,) -LOCAL_SRC_FILES_arm := $3 -endif -ifneq ($4,) -LOCAL_MODULE_PATH := $4 -endif -LOCAL_MODULE_CLASS := ETC -LOCAL_CHECK_ELF_FILES := false -include $$(BUILD_PREBUILT) -endef - -define install-va-bins -include $$(CLEAR_VARS) -LOCAL_MODULE := $1 -LOCAL_SRC_FILES_arm64 := $2 -ifneq ($3,) -LOCAL_SRC_FILES_arm := $3 -endif -ifneq ($4,) -LOCAL_MODULE_RELATIVE_PATH := $4 -endif -LOCAL_MODULE_CLASS := EXECUTABLES -LOCAL_CHECK_ELF_FILES := false -LOCAL_PROPRIETARY_MODULE = true -include $$(BUILD_PREBUILT) -endef - -define override-va-syslibs -include $$(CLEAR_VARS) -LOCAL_MODULE := $1 -LOCAL_SRC_FILES_arm64 := $2 -ifneq ($3,) -LOCAL_SRC_FILES_arm := $3 -endif -LOCAL_MODULE_PATH := $(TARGET_OUT_SYSTEM_LIB64) -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_CHECK_ELF_FILES := false -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_SUFFIX := .so -LOCAL_OVERRIDES_PACKAGES := $1 -include $$(BUILD_PREBUILT) -endef - -ifneq ($(wildcard $(LOCAL_PATH)/system/vendor/lib),) -VA_MULTILIB := both -else -VA_MULTILIB := first -endif - - -# GFX - -egl_libs := \ -libEGL_default \ -libGLESv2_default \ -libGLESv1_CM_default \ - -$(foreach lib, $(egl_libs), \ - $(eval $(call install-va-shared-libs, \ - $(lib), \ - system/vendor/lib64/egl/$(lib).so, \ - system/vendor/lib/egl/$(lib).so, \ - egl, \ - $(VA_MULTILIB)))) - -hw_libs := \ -gralloc.default \ -vulkan.default \ -hwcomposer.default \ - -$(foreach lib, $(hw_libs), \ - $(eval $(call install-va-shared-libs, \ - $(lib), \ - system/vendor/lib64/hw/$(lib).so, \ - system/vendor/lib/hw/$(lib).so, \ - hw, \ - $(VA_MULTILIB)))) - -um_libs := \ -libVAegl \ -libsrv_um \ -libusc \ -libufwriter \ -libsutu_display \ -libcreatesurface \ -libvaANDROID_WSEGL \ -libvalloc \ - -$(foreach lib, $(um_libs), \ - $(eval $(call install-va-shared-libs, \ - $(lib), \ - system/vendor/lib64/$(lib).so, \ - system/vendor/lib/$(lib).so, \ - , \ - $(VA_MULTILIB)))) - -gpu_bins := \ -gpu_config.sh \ - -$(foreach bin, $(gpu_bins), \ - $(eval $(call install-va-bins, \ - $(bin), \ - system/vendor/bin/$(bin), \ - , \ - ))) - -va_config := \ -va_gfx.ini \ - -$(foreach config, $(va_config), \ - $(eval $(call install-va-configs, \ - $(config), \ - system/vendor/etc/$(config), \ - , \ - $(TARGET_OUT_VENDOR_ETC)))) - -$(foreach config, $(vame_config), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/etc/$(config)), \ - $(eval $(call install-va-configs, \ - $(config), \ - system/vendor/etc/$(config), \ - , \ - $(TARGET_OUT_VENDOR_ETC))))) - -# va libs - -va_libs := \ -libvmpp-enc \ -libvmpp-dec \ - -$(foreach lib, $(va_libs), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/lib64/$(lib).so), \ - $(eval $(call install-va-shared-libs, \ - $(lib), \ - system/vendor/lib64/$(lib).so, \ - system/vendor/lib/$(lib).so, \ - , \ - $(VA_MULTILIB))))) - -# OMX - -omx_libs := \ -libstagefrighthw_va \ -libVa_OMX_VideoDec_HW \ -va_omx_component \ - -$(foreach lib, $(omx_libs), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/lib64/$(lib).so), \ - $(eval $(call install-va-shared-libs, \ - $(lib), \ - system/vendor/lib64/$(lib).so, \ - system/vendor/lib/$(lib).so, \ - , \ - $(VA_MULTILIB))))) - -omx_config := \ -media_codecs_va_video.xml \ - -$(foreach config, $(omx_config), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/etc/$(config)), \ - $(eval $(call install-va-configs, \ - $(config), \ - system/vendor/etc/$(config), \ - , \ - $(TARGET_OUT_VENDOR_ETC))))) - -# C2 - -codec2_libs := \ - libcodec2_default_common \ - libcodec2_default_store \ - libcodec2_default_video_enc \ - libcodec2_default_video_dec \ - libcodec2_default_component \ - -$(foreach lib, $(codec2_libs), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/lib64/$(lib).so), \ - $(eval $(call install-va-shared-libs, \ - $(lib), \ - system/vendor/lib64/$(lib).so, \ - system/vendor/lib/$(lib).so, \ - , \ - $(VA_MULTILIB))))) - -codec2_service := \ - android.hardware.media.c2@1.0-service-default \ - -$(foreach srv, $(codec2_service), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/bin/hw/$(srv)), \ - $(eval $(call install-va-bins, \ - $(srv), \ - system/vendor/bin/hw/$(srv), \ - , \ - hw)))) - -codec2_config := \ - media_codecs_c2.xml \ - default_enc_params.json \ - -$(foreach config, $(codec2_config), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/etc/$(config)), \ - $(eval $(call install-va-configs, \ - $(config), \ - system/vendor/etc/$(config), \ - , \ - $(TARGET_OUT_VENDOR_ETC))))) - -codec2_init := \ - android.hardware.media.c2@1.0-service-default.rc \ - -$(foreach srv, $(codec2_init), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/etc/init/$(srv)), \ - $(eval $(call install-va-configs, \ - $(srv), \ - system/vendor/etc/init/$(srv), \ - , \ - $(TARGET_OUT_VENDOR_ETC)/init)))) - -codec2_xml := \ - android.hardware.media.c2@1.0-service-default.xml \ - -$(foreach srv, $(codec2_xml), \ - $(if $(wildcard $(LOCAL_PATH)/system/vendor/etc/vintf/manifest/$(srv)), \ - $(eval $(call install-va-configs, \ - $(srv), \ - system/vendor/etc/vintf/manifest/$(srv), \ - , \ - $(TARGET_OUT_VENDOR_ETC)/vintf/manifest)))) - -# system libs: FFMPEG c2 va display_server -system_libs := \ -libavdevice \ -libavfilter \ -libswscale \ -libavutil \ -libswresample \ -libavformat \ -libavcodec \ -libpostproc \ -libDisplayServer \ -va_drv_video \ - -$(foreach lib, $(system_libs), \ - $(if $(wildcard $(LOCAL_PATH)/system/lib64/$(lib).so), \ - $(eval $(call install-codec-libs-to-system, \ - $(lib), \ - system/lib64/$(lib).so, \ - system/lib/$(lib).so, \ - , \ - $(VA_MULTILIB))))) \ No newline at end of file -- Gitee From 8f0c06420a8b631e55457f2665bb577463d0f745 Mon Sep 17 00:00:00 2001 From: yayaws_zk <584363327@qq.com> Date: Thu, 21 Aug 2025 12:31:38 +0000 Subject: [PATCH 2/2] update aosp/system/libhwbinder/ProcessState.cpp. Signed-off-by: yayaws_zk <584363327@qq.com> --- aosp/system/libhwbinder/ProcessState.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aosp/system/libhwbinder/ProcessState.cpp b/aosp/system/libhwbinder/ProcessState.cpp index 3f5184f95..65c16ac89 100644 --- a/aosp/system/libhwbinder/ProcessState.cpp +++ b/aosp/system/libhwbinder/ProcessState.cpp @@ -142,7 +142,7 @@ bool ProcessState::becomeContextManager() if (result == -1) { ALOGE("Binder ioctl to become context manager failed: %s\n", strerror(errno)); } - return result == 0 + return result == 0; } // Get references to userspace objects held by the kernel binder driver -- Gitee