• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CHEEK_EVENT = 1;
25     public static final int TOUCH_EVENT = 2;  // touch events are TOUCH for 300ms, and then either
26                                               // up events or LONG_TOUCH events.
27     public static final int LONG_TOUCH_EVENT = 3;
28     public static final int TOUCH_UP_EVENT = 4;
29     public static final int BUTTON_EVENT = 5;  // Button and trackball events.
30 
31     public static final int POKE_LOCK_IGNORE_CHEEK_EVENTS = 0x1;
32     public static final int POKE_LOCK_SHORT_TIMEOUT = 0x2;
33     public static final int POKE_LOCK_MEDIUM_TIMEOUT = 0x4;
34     public static final int POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS = 0x8;
35 
36     public static final int POKE_LOCK_TIMEOUT_MASK = 0x6;
37 
goToSleep(long time)38     void goToSleep(long time);
39 
40     // notify power manager when keyboard is opened/closed
setKeyboardVisibility(boolean visible)41     void setKeyboardVisibility(boolean visible);
42 
43     // when the keyguard is up, it manages the power state, and userActivity doesn't do anything.
enableUserActivity(boolean enabled)44     void enableUserActivity(boolean enabled);
45 
46     // the same as the method on PowerManager
userActivity(long time, boolean noChangeLights, int eventType)47     public void userActivity(long time, boolean noChangeLights, int eventType);
48 
isScreenOn()49     boolean isScreenOn();
50 }
51