1 /* 2 * Copyright (C) 2021-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 #ifndef OHOS_WIFI_SPEED_LIMIT_CONFIGS_WRITER_H 16 #define OHOS_WIFI_SPEED_LIMIT_CONFIGS_WRITER_H 17 18 #include <vector> 19 #include "wifi_common_util.h" 20 21 namespace OHOS { 22 namespace Wifi { 23 24 typedef enum { 25 SET_BG_UID = 0, 26 SET_BG_PID, 27 SET_FG_UID, 28 } BgLimitType; 29 30 /** 31 * @Description set background limit speed mode 32 * 33 * @param mode - limit mode 34 * @return ErrCode 35 */ 36 ErrCode SetBgLimitMode(int mode); 37 38 /** 39 * @Description set background limit speed uid&pid list 40 * 41 * @param idList - foreground and background app list 42 * @param type - enable/disable dpi mark 43 * @return void 44 */ 45 void SetBgLimitIdList(std::vector<int> idList, int type); 46 47 /** 48 * @Description write background limit uid&pid data to file 49 * 50 * @param filePath - target file path 51 * @param idArray - uid&pid array 52 * @param size - idArray size 53 * @return NONE 54 */ 55 void SetUidPids(const char *filePath, const int *idArray, int size); 56 57 } // namespace Wifi 58 } // namespace OHOS 59 60 #endif