1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.app.admin;
18 
19 import android.app.admin.DevicePolicyManager.OperationSafetyReason;
20 
21 /**
22  * Device policy manager local system service interface for methods that don't require the
23  * {@code device_admin} feature.
24  *
25  * Maintenance note: if you need to expose information from DPMS to lower level services such as
26  * PM/UM/AM/etc, then exposing it from DevicePolicyManagerInternal is not safe because it may cause
27  * lock order inversion. Consider using {@link DevicePolicyCache} instead.
28  *
29  * @hide Only for use within the system server.
30  */
31 public interface DevicePolicyManagerLiteInternal {
32 
33     /**
34      * Notifies the system that an unsafe operation reason has changed.
35      *
36      * @throws IllegalArgumentException if {@code checker} is not the same as set on
37      *         {@code DevicePolicyManagerService.setDevicePolicySafetyChecker()}.
38      */
notifyUnsafeOperationStateChanged(DevicePolicySafetyChecker checker, @OperationSafetyReason int reason, boolean isSafe)39     void notifyUnsafeOperationStateChanged(DevicePolicySafetyChecker checker,
40             @OperationSafetyReason int reason, boolean isSafe);
41 }
42