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 
16 #ifndef OHOS_WIFI_STA_APP_ACCELERATION_H
17 #define OHOS_WIFI_STA_APP_ACCELERATION_H
18 
19 #include "wifi_errcode.h"
20 #include "define.h"
21 #include "appmgr/app_mgr_interface.h"
22 #include "sta_service_callback.h"
23 
24 namespace OHOS {
25 namespace Wifi {
26 
27 class StaAppAcceleration {
28 public:
29     explicit StaAppAcceleration(int instId = 0);
30     ~StaAppAcceleration();
31     StaServiceCallback GetStaCallback() const;
32     ErrCode InitAppAcceleration();
33     void HandleScreenStatusChanged(int screenState);
34 #ifndef OHOS_ARCH_LITE
35     void HandleForegroundAppChangedAction(const AppExecFwk::AppStateData &appStateData);
36 #endif
37 private:
38     void DealStaConnChanged(OperateResState state, const WifiLinkedInfo &info, int instId = 0);
39     void SetPmMode(int mode);
40     void StartGameBoost(int uid);
41     void StopGameBoost(int uid);
42     void SetGameBoostMode(int enable, int uid, int type, int limitMode);
43     void HighPriorityTransmit(int uid, int protocol, int enable);
44     void StopAllAppAcceleration();
45 
46 private:
47     StaServiceCallback m_staCallback;
48     bool gameBoostingFlag;
49 };
50 
51 } // namespace Wifi
52 } // namespace OHOS
53 #endif
54