1 /* 2 * Copyright (c) 2023 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 HISTORY_INFO_MGR_H 16 #define HISTORY_INFO_MGR_H 17 18 #include <vector> 19 #include "service_db_helper.h" 20 #include "nocopyable.h" 21 22 namespace OHOS { 23 namespace IntellVoiceEngine { 24 const std::string KEY_WAKEUP_ENGINE_BUNDLE_NAME = "WakeupEngineBundleName"; 25 const std::string KEY_WAKEUP_ENGINE_ABILITY_NAME = "WakeupEngineAbilityName"; 26 const std::string KEY_WAKEUP_VESRION = "WakeupVersion"; 27 const std::string KEY_LANGUAGE = "Language"; 28 const std::string KEY_AREA = "Area"; 29 const std::string KEY_WAKEUP_PHRASE = "WakeupPhrase"; 30 31 class HistoryInfoMgr : private ServiceDbHelper { 32 public: 33 HistoryInfoMgr(); 34 ~HistoryInfoMgr() = default; 35 GetInstance()36 static HistoryInfoMgr& GetInstance() 37 { 38 static HistoryInfoMgr historyInfoMgr; 39 return historyInfoMgr; 40 } 41 42 void SetEnrollEngineUid(int32_t uid); 43 int32_t GetEnrollEngineUid(); 44 void SetWakeupEngineBundleName(const std::string &bundleName); 45 std::string GetWakeupEngineBundleName(); 46 void SetWakeupEngineAbilityName(const std::string &abilityName); 47 std::string GetWakeupEngineAbilityName(); 48 void SetWakeupVesion(const std::string &wakeupVesion); 49 std::string GetWakeupVesion(); 50 void SetLanguage(const std::string &language); 51 std::string GetLanguage(); 52 void SetArea(const std::string &area); 53 std::string GetArea(); 54 void SetSensibility(const std::string &sensibility); 55 std::string GetSensibility(); 56 void SetWakeupPhrase(const std::string &wakeupPhrase); 57 std::string GetWakeupPhrase(); 58 void SetWakeupDspFeature(const std::string &wakeupDspFeature); 59 std::string GetWakeupDspFeature(); 60 void DeleteKey(const std::vector<std::string> &keyList); 61 62 private: 63 DISALLOW_COPY_AND_MOVE(HistoryInfoMgr); 64 }; 65 } 66 } 67 #endif