From cd220aa256e7c845d61fcdcd85a75ecc4652fabb Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 29 Nov 2024 21:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=94=B5=E6=BA=90=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/GPIOControl.cpp | 5 ++++- app/src/main/cpp/PhoneDevice.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/GPIOControl.cpp b/app/src/main/cpp/GPIOControl.cpp index 11102abc..08831424 100644 --- a/app/src/main/cpp/GPIOControl.cpp +++ b/app/src/main/cpp/GPIOControl.cpp @@ -363,7 +363,10 @@ bool GpioControl::Startup() // if (m_thread.) m_exitSignal = false; m_thread = std::thread(PowerControlThreadProc); - +#ifdef _DEBUG + pthread_t nativeHandle = m_thread.native_handle(); + pthread_setname_np(nativeHandle, "gpioclose"); +#endif return true; } diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 4dbd9d54..030511c0 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -441,6 +441,8 @@ CPhoneDevice::CPhoneDevice(JavaVM* vm, jobject service, const std::string& appPa RegisterHandlerForSignal(SIGUSR2); + GpioControl::Startup(); + LoadNetworkInfo(); m_vm = vm; @@ -533,6 +535,8 @@ CPhoneDevice::~CPhoneDevice() delete m_network; m_network = NULL; } + + GpioControl::Stop(); } void CPhoneDevice::SetListener(IListener* listener)