• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "app_details_rdb_open_callback.h"
16 #include "app_details_rdb_data_define.h"
17 #include "app_domain_verify_hilog.h"
18 #include "rdb_errno.h"
19 
20 namespace OHOS {
21 namespace AppDomainVerify {
AppDetailsRdbOpenCallback(const RdbConfigInfo & conf)22 AppDetailsRdbOpenCallback::AppDetailsRdbOpenCallback(const RdbConfigInfo& conf)
23     : m_conf(conf)
24 {
25 }
26 
OnCreate(NativeRdb::RdbStore & rdbStore)27 int32_t AppDetailsRdbOpenCallback::OnCreate(NativeRdb::RdbStore& rdbStore)
28 {
29     APP_DOMAIN_VERIFY_HILOGI(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "RdbStore OnCreate");
30     return NativeRdb::E_OK;
31 }
OnUpgrade(NativeRdb::RdbStore & rdbStore,int currentVersion,int targetVersion)32 int32_t AppDetailsRdbOpenCallback::OnUpgrade(NativeRdb::RdbStore& rdbStore, int currentVersion, int targetVersion)
33 {
34     APP_DOMAIN_VERIFY_HILOGI(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE,
35         "OnUpgrade currentVersion: %{public}d, targetVersion: %{public}d", currentVersion, targetVersion);
36     return NativeRdb::E_OK;
37 }
OnDowngrade(NativeRdb::RdbStore & rdbStore,int currentVersion,int targetVersion)38 int32_t AppDetailsRdbOpenCallback::OnDowngrade(
39     NativeRdb::RdbStore& rdbStore, int currentVersion, int targetVersion)
40 {
41     APP_DOMAIN_VERIFY_HILOGI(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE,
42         "OnDowngrade currentVersion: %{public}d, targetVersion: %{public}d", currentVersion, targetVersion);
43     return NativeRdb::E_OK;
44 }
OnOpen(NativeRdb::RdbStore & rdbStore)45 int32_t AppDetailsRdbOpenCallback::OnOpen(NativeRdb::RdbStore& rdbStore)
46 {
47     APP_DOMAIN_VERIFY_HILOGI(APP_DOMAIN_VERIFY_MGR_MODULE_SERVICE, "RdbStore OnOpen");
48     return NativeRdb::E_OK;
49 }
onCorruption(std::string databaseFile)50 int32_t AppDetailsRdbOpenCallback::onCorruption(std::string databaseFile)
51 {
52     return NativeRdb::E_OK;
53 }
54 }  // namespace AppDomainVerify
55 }  // namespace OHOS
56