mirror of
https://gitee.com/openharmony/communication_wifi.git
synced 2024-12-18 20:40:11 +00:00
commit
c59aaf015a
@ -110,6 +110,7 @@ int WifiHotspotCallbackStub::RemoteOnHotspotStaLeave(uint32_t code, MessageParce
|
||||
|
||||
void WifiHotspotCallbackStub::RegisterCallBack(const sptr<IWifiHotspotCallback> &callBack)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(callBackEventMutex);
|
||||
if (callBack == nullptr) {
|
||||
WIFI_LOGD("RegisterCallBack:callBack is nullptr!");
|
||||
return;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#ifndef OHOS_WIFI_HOTSPOT_CALLBACK_STUB_H
|
||||
#define OHOS_WIFI_HOTSPOT_CALLBACK_STUB_H
|
||||
|
||||
#include <mutex>
|
||||
#include "iremote_stub.h"
|
||||
#include "i_wifi_hotspot_callback.h"
|
||||
|
||||
@ -43,7 +44,7 @@ private:
|
||||
|
||||
private:
|
||||
sptr<IWifiHotspotCallback> userCallback_;
|
||||
|
||||
std::mutex callBackEventMutex;
|
||||
bool mRemoteDied;
|
||||
};
|
||||
} // namespace Wifi
|
||||
|
@ -83,6 +83,7 @@ int WifiP2pCallbackStub::OnRemoteRequest(
|
||||
|
||||
void WifiP2pCallbackStub::RegisterCallBack(const sptr<IWifiP2pCallback> &userCallback)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(callBackEventMutex);
|
||||
if (userCallback_ != nullptr) {
|
||||
WIFI_LOGD("Callback has registered!");
|
||||
return;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#ifndef OHOS_WIFI_P2P_CALLBACK_STUB_H
|
||||
#define OHOS_WIFI_P2P_CALLBACK_STUB_H
|
||||
|
||||
#include <mutex>
|
||||
#include <map>
|
||||
#include "iremote_stub.h"
|
||||
#include "i_wifi_p2p_callback.h"
|
||||
@ -121,6 +122,7 @@ private:
|
||||
HandleFuncMap handleFuncMap;
|
||||
sptr<IWifiP2pCallback> userCallback_;
|
||||
bool mRemoteDied;
|
||||
std::mutex callBackEventMutex;
|
||||
};
|
||||
} // namespace Wifi
|
||||
} // namespace OHOS
|
||||
|
Loading…
Reference in New Issue
Block a user