15c735df2Sopenharmony_ci/* 25c735df2Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 35c735df2Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 45c735df2Sopenharmony_ci * you may not use this file except in compliance with the License. 55c735df2Sopenharmony_ci * You may obtain a copy of the License at 65c735df2Sopenharmony_ci * 75c735df2Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 85c735df2Sopenharmony_ci * 95c735df2Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 105c735df2Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 115c735df2Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 125c735df2Sopenharmony_ci * See the License for the specific language governing permissions and 135c735df2Sopenharmony_ci * limitations under the License. 145c735df2Sopenharmony_ci */ 155c735df2Sopenharmony_ci 165c735df2Sopenharmony_ci#include "app_identity.h" 175c735df2Sopenharmony_ci 185c735df2Sopenharmony_cinamespace OHOS { 195c735df2Sopenharmony_cinamespace Location { 205c735df2Sopenharmony_ciAppIdentity::AppIdentity() 215c735df2Sopenharmony_ci{ 225c735df2Sopenharmony_ci uid_ = 0; 235c735df2Sopenharmony_ci pid_ = 0; 245c735df2Sopenharmony_ci tokenId_ = 0; 255c735df2Sopenharmony_ci tokenIdEx_ = 0; 265c735df2Sopenharmony_ci firstTokenId_ = 0; 275c735df2Sopenharmony_ci bundleName_ = ""; 285c735df2Sopenharmony_ci} 295c735df2Sopenharmony_ci 305c735df2Sopenharmony_ciAppIdentity::AppIdentity(pid_t uid, pid_t pid, uint32_t tokenId, uint64_t tokenIdEx, uint32_t firstTokenId) 315c735df2Sopenharmony_ci : uid_(uid), pid_(pid), tokenId_(tokenId), tokenIdEx_(tokenIdEx), firstTokenId_(firstTokenId) 325c735df2Sopenharmony_ci{ 335c735df2Sopenharmony_ci} 345c735df2Sopenharmony_ci 355c735df2Sopenharmony_cistd::string AppIdentity::ToString() const 365c735df2Sopenharmony_ci{ 375c735df2Sopenharmony_ci std::string str = "uid : " + std::to_string(uid_) + 385c735df2Sopenharmony_ci ", pid : " + std::to_string(pid_) + 395c735df2Sopenharmony_ci ", tokenId : " + std::to_string(tokenId_) + 405c735df2Sopenharmony_ci ", tokenIdEx : " + std::to_string(tokenIdEx_) + 415c735df2Sopenharmony_ci ", firstTokenId : " + std::to_string(firstTokenId_) + 425c735df2Sopenharmony_ci ", bundleName : " + bundleName_; 435c735df2Sopenharmony_ci return str; 445c735df2Sopenharmony_ci} 455c735df2Sopenharmony_ci} // namespace Location 465c735df2Sopenharmony_ci} // namespace OHOS