Home
last modified time | relevance | path

Searched refs:observer (Results 1 – 25 of 44) sorted by relevance

12

/base/telephony/call_manager/services/call/src/
Dcall_state_listener.cpp32 bool CallStateListener::AddOneObserver(const std::shared_ptr<CallStateListenerBase> &observer) in AddOneObserver() argument
34 if (observer == nullptr) { in AddOneObserver()
39 if (listenerSet_.count(observer) > 0) { in AddOneObserver()
42 listenerSet_.insert(observer); in AddOneObserver()
46 bool CallStateListener::RemoveOneObserver(const std::shared_ptr<CallStateListenerBase> &observer) in RemoveOneObserver() argument
48 if (observer == nullptr) { in RemoveOneObserver()
53 listenerSet_.erase(observer); in RemoveOneObserver()
71 for (auto &observer : listenerSet_) { in NewCallCreated() local
72 observer->NewCallCreated(callObjectPtr); in NewCallCreated()
79 for (auto &observer : listenerSet_) { in CallDestroyed() local
[all …]
/base/security/access_token/services/test/mock/aafwk/
Dmock_app_mgr_service.cpp32 …ockAppMgrService::RegisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer, in RegisterApplicationStateObserver() argument
35 if (observer == nullptr || observer == observer_) { in RegisterApplicationStateObserver()
38 GTEST_LOG_(INFO) << "register: " << observer; in RegisterApplicationStateObserver()
39 observer_ = observer; in RegisterApplicationStateObserver()
43 …kAppMgrService::UnregisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer) in UnregisterApplicationStateObserver() argument
45 if (observer == nullptr || observer != observer_) { in UnregisterApplicationStateObserver()
48 GTEST_LOG_(INFO) << "unregister: " << observer; in UnregisterApplicationStateObserver()
Dmock_app_mgr_service.h61 …MOCK_METHOD1(RegisterConfigurationObserver, int32_t(const sptr<IConfigurationObserver> &observer));
62 …CK_METHOD1(UnregisterConfigurationObserver, int32_t(const sptr<IConfigurationObserver> &observer));
73 int32_t RegisterApplicationStateObserver(const sptr<IApplicationStateObserver> &observer,
75 int32_t UnregisterApplicationStateObserver(const sptr<IApplicationStateObserver> &observer);
80 …const AAFwk::Want &want, const sptr<IRemoteObject> &observer, const BundleInfo &bundleInfo, int32_… in StartUserTestProcess() argument
/base/request/request/upload/interfaces/kits/napi/src/
Dprogress_callback.cpp65 if (progressWorker == nullptr || progressWorker->observer == nullptr) { in UvOnProgress()
70 napi_open_handle_scope(progressWorker->observer->GetEnv(), &scope); in UvOnProgress()
76 …napi_create_int64(progressWorker->observer->GetEnv(), progressWorker->observer->GetUploadedSize(),… in UvOnProgress()
77 …napi_create_int64(progressWorker->observer->GetEnv(), progressWorker->observer->GetTotalSize(), &a… in UvOnProgress()
78 …napi_get_reference_value(progressWorker->observer->GetEnv(), progressWorker->observer->GetCallback… in UvOnProgress()
79 napi_get_global(progressWorker->observer->GetEnv(), &global); in UvOnProgress()
80 …calStatus = napi_call_function(progressWorker->observer->GetEnv(), global, callback, TWO_ARG, args… in UvOnProgress()
85 napi_close_handle_scope(progressWorker->observer->GetEnv(), scope); in UvOnProgress()
98 progressWorker->observer = shared_from_this(); in Progress()
Dheader_receive_callback.cpp57 if (headerReceiveWorker == nullptr || headerReceiveWorker->observer == nullptr) { in UvOnHeaderReceive()
62 napi_open_handle_scope(headerReceiveWorker->observer->GetEnv(), &scope); in UvOnHeaderReceive()
70 jsHeader = UploadNapi::JSUtil::Convert2JSString(headerReceiveWorker->observer->GetEnv(), in UvOnHeaderReceive()
71 headerReceiveWorker->observer->GetHeader()); in UvOnHeaderReceive()
74 napi_get_reference_value(headerReceiveWorker->observer->GetEnv(), in UvOnHeaderReceive()
75 headerReceiveWorker->observer->GetCallback(), &callback); in UvOnHeaderReceive()
76 napi_get_global(headerReceiveWorker->observer->GetEnv(), &global); in UvOnHeaderReceive()
77 …callStatus = napi_call_function(headerReceiveWorker->observer->GetEnv(), global, callback, 1, args… in UvOnHeaderReceive()
82 napi_close_handle_scope(headerReceiveWorker->observer->GetEnv(), scope); in UvOnHeaderReceive()
96 headerReceiveWorker->observer = shared_from_this(); in HeaderReceive()
Dnotify_callback.cpp58 if (notifyWorker == nullptr || notifyWorker->observer == nullptr) { in UvOnNotify()
63 napi_open_handle_scope(notifyWorker->observer->GetEnv(), &scope); in UvOnNotify()
69 args[0] = UploadNapi::JSUtil::Convert2JSValue(notifyWorker->observer->GetEnv(), in UvOnNotify()
70 notifyWorker->observer->GetTaskStates()); in UvOnNotify()
71 napi_get_reference_value(notifyWorker->observer->GetEnv(), in UvOnNotify()
72 notifyWorker->observer->GetCallback(), &callback); in UvOnNotify()
73 napi_get_global(notifyWorker->observer->GetEnv(), &global); in UvOnNotify()
74 …callStatus = napi_call_function(notifyWorker->observer->GetEnv(), global, callback, 1, args, &resu… in UvOnNotify()
79 napi_close_handle_scope(notifyWorker->observer->GetEnv(), scope); in UvOnNotify()
93 notifyWorker->observer = shared_from_this(); in Notify()
/base/security/access_token/services/privacymanager/src/sensitive/app_manager/
Dapp_manager_privacy_client.cpp43 …gerPrivacyClient::RegisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer) in RegisterApplicationStateObserver() argument
45 if (observer == nullptr) { in RegisterApplicationStateObserver()
55 return proxy->RegisterApplicationStateObserver(observer, bundleNameList); in RegisterApplicationStateObserver()
58 …rPrivacyClient::UnregisterApplicationStateObserver(const sptr<IApplicationStateObserver> &observer) in UnregisterApplicationStateObserver() argument
60 if (observer == nullptr) { in UnregisterApplicationStateObserver()
69 return proxy->UnregisterApplicationStateObserver(observer); in UnregisterApplicationStateObserver()
Dapp_manager_privacy_proxy.cpp28 …agerPrivacyProxy::RegisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer, in RegisterApplicationStateObserver() argument
38 if (!data.WriteRemoteObject(observer->AsObject())) { in RegisterApplicationStateObserver()
56 const sptr<IApplicationStateObserver>& observer) in UnregisterApplicationStateObserver() argument
65 if (!data.WriteRemoteObject(observer->AsObject())) { in UnregisterApplicationStateObserver()
/base/telephony/state_registry/
DREADME.md6 The state registry module provides APIs to register and deregister an observer that listens for var…
34 - The API for registering an observer for the SIM card status takes effect only when SIM cards ar…
46 …ng, options: { slotId?: number }, callback: AsyncCallback\<T\>): void; | Registers an observer. |
47 | function off(type: String, callback?: AsyncCallback\<T\>): void; | Deregisters an observer. |
70 The function of registering an observer for call status change events is used as an example. The pr…
72 1. Call the **on** method with the **type** parameter specified to register an observer for di…
74 3. Call the **off** method to deregister the observer. After the observer is deregistered, no ca…
77 // Import the observer package.
78 import observer from '@ohos.telephony.observer';
80 // Registers an observer.
[all …]
DREADME_zh.md90 import observer from '@ohos.telephony.observer';
93 observer.on('callStateChange', {slotId: 1}, (err, value) => {
104 observer.off('callStateChange', (err, value) => {
/base/security/access_token/services/privacymanager/include/sensitive/app_manager/
Dapp_manager_privacy_proxy.h40 … virtual int32_t RegisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer,
42 …al int32_t UnregisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer) = 0;
58 int32_t RegisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer,
60 …int32_t UnregisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer) overri…
Dapp_manager_privacy_client.h35 int32_t RegisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer);
36 int32_t UnregisterApplicationStateObserver(const sptr<IApplicationStateObserver>& observer);
/base/powermgr/power_manager/services/native/src/setting/
Dsetting_helper.cpp53 auto observer = provider.CreateObserver(SETTING_DISPLAY_OFF_TIME_KEY, func); in RegisterSettingDisplayOffTimeObserver() local
54 ErrCode ret = provider.RegisterObserver(observer); in RegisterSettingDisplayOffTimeObserver()
59 return observer; in RegisterSettingDisplayOffTimeObserver()
62 void SettingHelper::UnregisterSettingDisplayOffTimeObserver(sptr<SettingObserver>& observer) in UnregisterSettingDisplayOffTimeObserver() argument
64 if (observer == nullptr) { in UnregisterSettingDisplayOffTimeObserver()
68 provider.UnregisterObserver(observer); in UnregisterSettingDisplayOffTimeObserver()
/base/telephony/state_registry/frameworks/native/observer/
DBUILD.gn19 "$SUBSYSTEM_DIR/interfaces/innerkits/observer",
30 "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer.cpp",
31 "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer_client.cpp",
32 "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer_proxy.cpp",
33 "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_state_manager.cpp",
37 "$SUBSYSTEM_DIR/frameworks/native/observer/include",
/base/powermgr/power_manager/utils/setting/src/
Dsetting_provider.cpp115 sptr<SettingObserver> observer = new SettingObserver(); in CreateObserver() local
116 observer->SetKey(key); in CreateObserver()
117 observer->SetUpdateFunc(func); in CreateObserver()
118 return observer; in CreateObserver()
121 ErrCode SettingProvider::RegisterObserver(const sptr<SettingObserver>& observer) in RegisterObserver() argument
124 auto uri = AssembleUri(observer->GetKey()); in RegisterObserver()
130 helper->RegisterObserver(uri, observer); in RegisterObserver()
137 ErrCode SettingProvider::UnregisterObserver(const sptr<SettingObserver>& observer) in UnregisterObserver() argument
140 auto uri = AssembleUri(observer->GetKey()); in UnregisterObserver()
146 helper->UnregisterObserver(uri, observer); in UnregisterObserver()
/base/web/webview/test/fuzztest/ohos_adapter/pasteboard_adapter/onpasteboardchanged_fuzzer/
Donpasteboardchanged_fuzzer.cpp32 … std::shared_ptr<PasteboardObserverAdapter> observer = std::make_shared<MockPasteboardObserver>(); in DoSomethingInterestingWithMyAPI() local
33 PasteboardObserverAdapterImpl observerImpl(observer); in DoSomethingInterestingWithMyAPI()
/base/web/webview/test/fuzztest/ohos_adapter/pasteboard_adapter/removepasteboardchangedobserver_fuzzer/
Dremovepasteboardchangedobserver_fuzzer.cpp32 … std::shared_ptr<PasteboardObserverAdapter> observer = std::make_shared<MockPasteboardObserver>(); in DoSomethingInterestingWithMyAPI() local
33 PasteBoardClientAdapterImpl::GetInstance().RemovePasteboardChangedObserver(observer); in DoSomethingInterestingWithMyAPI()
/base/telephony/call_manager/services/call/include/
Dcall_state_listener.h29 bool AddOneObserver(const std::shared_ptr<CallStateListenerBase> &observer);
30 bool RemoveOneObserver(const std::shared_ptr<CallStateListenerBase> &observer);
/base/web/webview/ohos_adapter/pasteboard_adapter/src/
Dpasteboard_client_adapter_impl.cpp30 std::shared_ptr<PasteboardObserverAdapter> observer) in PasteboardObserverAdapterImpl() argument
31 : observer_(observer) {} in PasteboardObserverAdapterImpl()
471 sptr<PasteboardObserver> observer; in AddPasteboardChangedObserver() local
478 observer = new (std::nothrow) PasteboardObserverAdapterImpl(callback); in AddPasteboardChangedObserver()
479 if (!observer) { in AddPasteboardChangedObserver()
482 reg_.emplace(std::make_pair(callback.get(), observer)); in AddPasteboardChangedObserver()
484 PasteboardClient::GetInstance()->AddPasteboardChangedObserver(observer); in AddPasteboardChangedObserver()
492 sptr<PasteboardObserver> observer; in RemovePasteboardChangedObserver() local
499 observer = iter->second; in RemovePasteboardChangedObserver()
502 PasteboardClient::GetInstance()->RemovePasteboardChangedObserver(observer); in RemovePasteboardChangedObserver()
/base/request/request/download/services/src/
Dnetwork_adapter.cpp54 sptr<NetConnCallbackObserver> observer = new(std::nothrow) NetConnCallbackObserver(*this); in RegOnNetworkChange() local
55 if (observer == nullptr) { in RegOnNetworkChange()
59 … = DelayedSingleton<NetConnClient>::GetInstance()->RegisterNetConnCallback(specifier, observer, 0); in RegOnNetworkChange()
Dapplication_state_observer.cpp35 static ApplicationStateObserver observer; in GetInstance() local
36 return observer; in GetInstance()
/base/powermgr/power_manager/utils/setting/include/
Dsetting_provider.h39 ErrCode RegisterObserver(const sptr<SettingObserver>& observer);
40 ErrCode UnregisterObserver(const sptr<SettingObserver>& observer);
/base/notification/distributed_notification_service/services/distributed/test/unittest/mock/
Dmock_distributed_kv_data_manager.cpp37 …tributedKvDataManager::StartWatchDeviceChange(std::shared_ptr<DeviceStatusChangeListener> observer) in StartWatchDeviceChange() argument
42 …stributedKvDataManager::StopWatchDeviceChange(std::shared_ptr<DeviceStatusChangeListener> observer) in StopWatchDeviceChange() argument
/base/telephony/state_registry/interfaces/kits/js/
D@ohos.telephony.observer.d.ts29 declare namespace observer { namespace
305 export default observer;
/base/telephony/state_registry/frameworks/js/napi/
DBUILD.gn16 ohos_shared_library("observer") {
20 "$SUBSYSTEM_DIR/state_registry/frameworks/native/observer/include",

12