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 #ifndef DSLM_SERVICE_H 17 #define DSLM_SERVICE_H 18 19 #include <cstdint> 20 #include <iosfwd> 21 #include <string> 22 #include <vector> 23 24 #include "iremote_stub.h" 25 #include "message_option.h" 26 #include "message_parcel.h" 27 #include "nocopyable.h" 28 #include "refbase.h" 29 #include "system_ability.h" 30 31 #include "idevice_security_level.h" 32 33 namespace OHOS { 34 namespace Security { 35 namespace DeviceSecurityLevel { 36 class DslmService : public SystemAbility, public IRemoteStub<IDeviceSecurityLevel>, public NoCopyable { 37 DECLARE_SYSTEM_ABILITY(DslmService); 38 39 public: 40 explicit DslmService(int32_t saId, bool runOnCreate); 41 ~DslmService() override = default; 42 void OnStart() override; 43 void OnStop() override; 44 int32_t Dump(int fd, const std::vector<std::u16string> &args) override; 45 int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 46 47 private: 48 static void ProcessLoadPlugin(void); 49 int32_t ProcessGetDeviceSecurityLevel(MessageParcel &data, MessageParcel &reply); 50 }; 51 } // namespace DeviceSecurityLevel 52 } // namespace Security 53 } // namespace OHOS 54 55 #endif // DSLM_SERVICE_H