!59 oaid重置添加关键日志

Merge pull request !59 from 李盼/master
This commit is contained in:
openharmony_ci 2024-08-08 11:10:02 +00:00 committed by Gitee
commit 14d71698e2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 7 additions and 0 deletions

View File

@ -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",

View File

@ -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

View File

@ -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