PowerManagerInternal.java revision 4ccb823a9f62e57f9d221f83a97e82967e79a9e5
1/*
2 * Copyright (C) 2014 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
17package android.os;
18
19import android.view.WindowManagerPolicy;
20
21/**
22 * Power manager local system service interface.
23 *
24 * @hide Only for use within the system server.
25 */
26public abstract class PowerManagerInternal {
27    /**
28     * Used by the window manager to override the screen brightness based on the
29     * current foreground activity.
30     *
31     * This method must only be called by the window manager.
32     *
33     * @param brightness The overridden brightness, or -1 to disable the override.
34     */
35    public abstract void setScreenBrightnessOverrideFromWindowManager(int brightness);
36
37    /**
38     * Used by the window manager to override the button brightness based on the
39     * current foreground activity.
40     *
41     * This method must only be called by the window manager.
42     *
43     * @param brightness The overridden brightness, or -1 to disable the override.
44     */
45    public abstract void setButtonBrightnessOverrideFromWindowManager(int brightness);
46
47    /**
48     * Used by the window manager to override the user activity timeout based on the
49     * current foreground activity.  It can only be used to make the timeout shorter
50     * than usual, not longer.
51     *
52     * This method must only be called by the window manager.
53     *
54     * @param timeoutMillis The overridden timeout, or -1 to disable the override.
55     */
56    public abstract void setUserActivityTimeoutOverrideFromWindowManager(long timeoutMillis);
57
58    // TODO: Remove this and retrieve as a local service instead.
59    public abstract void setPolicy(WindowManagerPolicy policy);
60}
61