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 16 #include "mock_form_data_proxy_record_test.h" 17 18 namespace { 19 int32_t g_mockRegisterPermStateChangeCallback = 0; 20 int32_t g_mockUnRegisterPermStateChangeCallback = 0; 21 } 22 23 namespace OHOS { MockRegisterPermStateChangeCallback(int32_t mockRet)24void MockRegisterPermStateChangeCallback(int32_t mockRet) 25 { 26 g_mockRegisterPermStateChangeCallback = mockRet; 27 } 28 MockUnRegisterPermStateChangeCallback(int32_t mockRet)29void MockUnRegisterPermStateChangeCallback(int32_t mockRet) 30 { 31 g_mockUnRegisterPermStateChangeCallback = mockRet; 32 } 33 } // namespace OHOS 34 35 namespace OHOS { 36 namespace Security { 37 namespace AccessToken { 38 39 RegisterPermStateChangeCallback(const std::shared_ptr<PermStateChangeCallbackCustomize> & callback)40int32_t AccessTokenKit::RegisterPermStateChangeCallback( 41 const std::shared_ptr<PermStateChangeCallbackCustomize>& callback) 42 { 43 (void)callback; 44 return g_mockRegisterPermStateChangeCallback; 45 } 46 UnRegisterPermStateChangeCallback(const std::shared_ptr<PermStateChangeCallbackCustomize> & callback)47int32_t AccessTokenKit::UnRegisterPermStateChangeCallback( 48 const std::shared_ptr<PermStateChangeCallbackCustomize>& callback) 49 { 50 (void)callback; 51 return g_mockUnRegisterPermStateChangeCallback; 52 } 53 54 } // namespace AccessToken 55 } // namespace Security 56 } // namespace OHOS