1 /* 2 * Copyright (c) 2022-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 16 #ifndef FRAMEWORK_EXTENSION_INCLUDE_IENTERPRISE_ADMIN_H 17 #define FRAMEWORK_EXTENSION_INCLUDE_IENTERPRISE_ADMIN_H 18 19 #include <iremote_broker.h> 20 #include <string_ex.h> 21 22 namespace OHOS { 23 namespace EDM { 24 class IEnterpriseAdmin : public IRemoteBroker { 25 public: 26 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.EDM.IEnterpriseAdmin"); 27 28 virtual void OnAdminEnabled() = 0; 29 30 virtual void OnAdminDisabled() = 0; 31 32 /** 33 * Called when a new application package has been installed on the device. 34 * @param bundleName Indicates the name of the bundle whose state has been installed. 35 */ 36 virtual void OnBundleAdded(const std::string &bundleName) = 0; 37 38 /** 39 * Called when a new application package has been Removed on the device. 40 * @param bundleName Indicates the name of the bundle whose state has been Removed. 41 */ 42 virtual void OnBundleRemoved(const std::string &bundleName) = 0; 43 44 /** 45 * Called when an application start on the device. 46 * @param bundleName Indicates the bundle name of application that has been started. 47 */ 48 virtual void OnAppStart(const std::string &bundleName) = 0; 49 50 /** 51 * Called when an application stop on the device. 52 * @param bundleName Indicates the bundle name of application that has been stopped. 53 */ 54 virtual void OnAppStop(const std::string &bundleName) = 0; 55 56 enum { 57 COMMAND_ON_ADMIN_ENABLED = 1, 58 COMMAND_ON_ADMIN_DISABLED = 2, 59 COMMAND_ON_BUNDLE_ADDED = 3, 60 COMMAND_ON_BUNDLE_REMOVED = 4, 61 COMMAND_ON_APP_START = 5, 62 COMMAND_ON_APP_STOP = 6 63 }; 64 }; 65 } // namespace EDM 66 } // namespace OHOS 67 #endif // FRAMEWORK_EXTENSION_INCLUDE_IENTERPRISE_ADMIN_H