1 /* 2 * Copyright (C) 2022 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 com.android.devicelockcontroller.policy; 18 19 import com.google.common.util.concurrent.Futures; 20 import com.google.common.util.concurrent.ListenableFuture; 21 22 /** 23 * A PolicyHandler class is responsible for setting certain policy for a certain state. 24 */ 25 interface PolicyHandler { 26 onProvisioned()27 default ListenableFuture<Boolean> onProvisioned() { 28 return Futures.immediateFuture(true); 29 } 30 onProvisionInProgress()31 default ListenableFuture<Boolean> onProvisionInProgress() { 32 return Futures.immediateFuture(true); 33 } 34 onProvisionPaused()35 default ListenableFuture<Boolean> onProvisionPaused() { 36 return Futures.immediateFuture(true); 37 } 38 onProvisionFailed()39 default ListenableFuture<Boolean> onProvisionFailed() { 40 return Futures.immediateFuture(true); 41 } 42 onLocked()43 default ListenableFuture<Boolean> onLocked() { 44 return Futures.immediateFuture(true); 45 } 46 onUnlocked()47 default ListenableFuture<Boolean> onUnlocked() { 48 return Futures.immediateFuture(true); 49 } 50 onCleared()51 default ListenableFuture<Boolean> onCleared() { 52 return Futures.immediateFuture(true); 53 } 54 } 55