Home | History | Annotate | Download | only in os
      1 /*
      2  * Copyright (C) 2007 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.os;
     18 
     19 /** @hide */
     20 public interface LocalPowerManager {
     21     // Note: be sure to update BatteryStats if adding or modifying event constants.
     22 
     23     public static final int OTHER_EVENT = 0;
     24     public static final int BUTTON_EVENT = 1;
     25     public static final int TOUCH_EVENT = 2;
     26 
     27     public static final int POKE_LOCK_IGNORE_TOUCH_EVENTS = 0x1;
     28 
     29     public static final int POKE_LOCK_SHORT_TIMEOUT = 0x2;
     30     public static final int POKE_LOCK_MEDIUM_TIMEOUT = 0x4;
     31     public static final int POKE_LOCK_TIMEOUT_MASK = 0x6;
     32 
     33     void goToSleep(long time);
     34 
     35     // notify power manager when keyboard is opened/closed
     36     void setKeyboardVisibility(boolean visible);
     37 
     38     // when the keyguard is up, it manages the power state, and userActivity doesn't do anything.
     39     void enableUserActivity(boolean enabled);
     40 
     41     // the same as the method on PowerManager
     42     void userActivity(long time, boolean noChangeLights, int eventType);
     43 
     44     boolean isScreenOn();
     45 
     46     void setScreenBrightnessOverride(int brightness);
     47     void setButtonBrightnessOverride(int brightness);
     48 }
     49