1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef ACCESSTOKEN_SYNC_KIT_LOADER_CPP
16 #define ACCESSTOKEN_SYNC_KIT_LOADER_CPP
17 
18 #include "token_sync_kit_loader.h"
19 
20 #include "token_sync_kit.h"
21 
22 namespace OHOS {
23 namespace Security {
24 namespace AccessToken {
GetRemoteHapTokenInfo(const std::string & deviceID,AccessTokenID tokenID) const25 int32_t TokenSyncManagerLoader::GetRemoteHapTokenInfo(const std::string& deviceID, AccessTokenID tokenID) const
26 {
27     return TokenSyncKit::GetRemoteHapTokenInfo(deviceID, tokenID);
28 }
29 
DeleteRemoteHapTokenInfo(AccessTokenID tokenID) const30 int32_t TokenSyncManagerLoader::DeleteRemoteHapTokenInfo(AccessTokenID tokenID) const
31 {
32     return TokenSyncKit::DeleteRemoteHapTokenInfo(tokenID);
33 }
34 
UpdateRemoteHapTokenInfo(const HapTokenInfoForSync & tokenInfo) const35 int32_t TokenSyncManagerLoader::UpdateRemoteHapTokenInfo(const HapTokenInfoForSync& tokenInfo) const
36 {
37     return TokenSyncKit::UpdateRemoteHapTokenInfo(tokenInfo);
38 }
39 
40 extern "C" {
Create()41 void* Create()
42 {
43     return reinterpret_cast<void*>(new TokenSyncManagerLoader);
44 }
45 
Destroy(void * loaderPtr)46 void Destroy(void* loaderPtr)
47 {
48     delete reinterpret_cast<TokenSyncKitInterface*>(loaderPtr);
49 }
50 }
51 } // namespace AccessToken
52 } // namespace Security
53 } // namespace OHOS
54 #endif // ACCESSTOKEN_SYNC_KIT_LOADER_CPP
55