Home | History | Annotate | Download | only in power
      1 /*
      2  * Copyright (C) 2012 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.server.power;
     18 
     19 /**
     20  * Low-level screen on blocker mechanism which is used to keep the screen off
     21  * or the contents of the screen hidden until the window manager is ready to show new content.
     22  */
     23 interface ScreenOnBlocker {
     24     /**
     25      * Acquires the screen on blocker.
     26      * Prevents the screen from turning on.
     27      *
     28      * Calls to acquire() nest and must be matched by the same number
     29      * of calls to release().
     30      */
     31     void acquire();
     32 
     33     /**
     34      * Releases the screen on blocker.
     35      * Allows the screen to turn on.
     36      *
     37      * It is an error to call release() if the screen on blocker has not been acquired.
     38      * The system may crash.
     39      */
     40     void release();
     41 }
     42