1 /*
2 * Copyright (c) 2022 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 "bms_rdb_open_callback.h"
17
18 #include "app_log_wrapper.h"
19
20 namespace OHOS {
21 namespace AppExecFwk {
BmsRdbOpenCallback(const BmsRdbConfig & bmsRdbConfig)22 BmsRdbOpenCallback::BmsRdbOpenCallback(const BmsRdbConfig &bmsRdbConfig)\
23 : bmsRdbConfig_(bmsRdbConfig) {}
24
OnCreate(NativeRdb::RdbStore & rdbStore)25 int32_t BmsRdbOpenCallback::OnCreate(NativeRdb::RdbStore &rdbStore)
26 {
27 APP_LOGI("OnCreate");
28 return NativeRdb::E_OK;
29 }
30
OnUpgrade(NativeRdb::RdbStore & rdbStore,int currentVersion,int targetVersion)31 int32_t BmsRdbOpenCallback::OnUpgrade(
32 NativeRdb::RdbStore &rdbStore, int currentVersion, int targetVersion)
33 {
34 APP_LOGI("OnUpgrade currentVersion: %{plubic}d, targetVersion: %{plubic}d",
35 currentVersion, targetVersion);
36 return NativeRdb::E_OK;
37 }
38
OnDowngrade(NativeRdb::RdbStore & rdbStore,int currentVersion,int targetVersion)39 int32_t BmsRdbOpenCallback::OnDowngrade(
40 NativeRdb::RdbStore &rdbStore, int currentVersion, int targetVersion)
41 {
42 APP_LOGI("OnDowngrade currentVersion: %{plubic}d, targetVersion: %{plubic}d",
43 currentVersion, targetVersion);
44 return NativeRdb::E_OK;
45 }
46
OnOpen(NativeRdb::RdbStore & rdbStore)47 int32_t BmsRdbOpenCallback::OnOpen(NativeRdb::RdbStore &rdbStore)
48 {
49 APP_LOGI("OnOpen");
50 return NativeRdb::E_OK;
51 }
52
onCorruption(std::string databaseFile)53 int32_t BmsRdbOpenCallback::onCorruption(std::string databaseFile)
54 {
55 APP_LOGI("onCorruption");
56 return NativeRdb::E_OK;
57 }
58 } // namespace AppExecFwk
59 } // namespace OHOS
60