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 16 #ifndef OHOS_ROSEN_SCREEN_SESSION_DUMPER_H 17 #define OHOS_ROSEN_SCREEN_SESSION_DUMPER_H 18 19 #include <string> 20 #include <locale> 21 #include <codecvt> 22 #include <vector> 23 #include <set> 24 #include <refbase.h> 25 26 #include "event_tracker.h" 27 #include "dm_common.h" 28 #include "window_manager_hilog.h" 29 #include "screen_session_manager.h" 30 31 namespace OHOS { 32 namespace Rosen { 33 34 class ScreenSessionDumper : public RefBase { 35 public: 36 ScreenSessionDumper(int fd, const std::vector<std::u16string>& args); 37 ~ScreenSessionDumper() = default; 38 39 void ExcuteDumpCmd(); 40 void DumpEventTracker(EventTracker& tracker); 41 void DumpFreezedPidList(std::set<int32_t> pidList); 42 void DumpMultiUserInfo(std::vector<int32_t> oldScbPids, int32_t userId, int32_t ScbPid); 43 44 private: 45 void ShowHelpInfo(); 46 void ShowAllScreenInfo(); 47 void DumpFoldStatus(); 48 void OutputDumpInfo(); 49 void DumpScreenSessionById(ScreenId id); 50 void DumpRsInfoById(ScreenId id); 51 void DumpRsInfoById01(sptr<ScreenSession> screenSession); 52 void DumpCutoutInfoById(ScreenId id); 53 void DumpScreenInfoById(ScreenId id); 54 void DumpScreenPropertyById(ScreenId id); 55 void ExcuteInjectCmd(); 56 /* 57 hidumper 命令注入隔离 58 */ 59 void ShowNotifyFoldStatusChangedInfo(); 60 void ShowIllegalArgsInfo(); 61 bool IsValidDisplayModeCommand(std::string command); 62 int SetFoldDisplayMode(); 63 int SetFoldStatusLocked(); 64 65 private: 66 int fd_; 67 std::vector<std::string> params_; 68 std::string dumpInfo_; 69 }; 70 } // Rosen 71 } // OHOS 72 #endif // OHOS_ROSEN_SCREEN_SESSION_DUMPER_H