mirror of
https://gitee.com/openharmony/advertising_oaid
synced 2024-11-23 15:59:59 +00:00
commit
14d71698e2
@ -12,6 +12,7 @@
|
||||
"path" : ["/system/bin/sa_main", "/system/profile/oaid_service.json"],
|
||||
"uid" : "oaid_service",
|
||||
"gid" : ["oaid_service", "shell"],
|
||||
"sandbox": 0,
|
||||
"permission": [
|
||||
"ohos.permission.DISTRIBUTED_DATASYNC",
|
||||
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Cloud {
|
||||
const std::string OAID_VIRTUAL_STR = "-****-****-****-************";
|
||||
OaidObserverManager::OaidObserverManager()
|
||||
{
|
||||
OAID_HILOGI(OAID_MODULE_SERVICE, "OaidObserverManager construct");
|
||||
@ -41,6 +42,8 @@ int32_t OaidObserverManager::RegisterObserver(const sptr<IRemoteConfigObserver>
|
||||
observer_ = observer;
|
||||
|
||||
auto oaid = OAIDService::GetInstance()->GetOAID();
|
||||
std::string target = oaid.substr(0, 9).append(OAID_VIRTUAL_STR);
|
||||
OAID_HILOGI(OAID_MODULE_SERVICE, "registerObserver success, getOaid is: %{public}s", target.c_str());
|
||||
observer->OnOaidUpdated(oaid);
|
||||
return ERR_OK;
|
||||
}
|
||||
@ -52,6 +55,8 @@ void OaidObserverManager::OnUpdateOaid(const std::string &oaid)
|
||||
OAID_HILOGI(OAID_MODULE_SERVICE, "observer is null");
|
||||
return;
|
||||
}
|
||||
std::string target = oaid.substr(0, 9).append(OAID_VIRTUAL_STR);
|
||||
OAID_HILOGI(OAID_MODULE_SERVICE, "OnOaidUpdated success oaid is: %{public}s", target.c_str());
|
||||
observer_->OnOaidUpdated(oaid);
|
||||
}
|
||||
} // namespace Cloud
|
||||
|
@ -303,6 +303,7 @@ int32_t OAIDServiceStub::HandleRegisterControlConfigObserver(MessageParcel &data
|
||||
|
||||
int32_t OAIDServiceStub::RegisterObserver(const sptr<IRemoteConfigObserver> &observer)
|
||||
{
|
||||
OAID_HILOGI(OAID_MODULE_SERVICE, "registerObserver success.");
|
||||
return DelayedSingleton<OaidObserverManager>::GetInstance()->RegisterObserver(observer);
|
||||
}
|
||||
} // namespace Cloud
|
||||
|
Loading…
Reference in New Issue
Block a user