blob: b5ec603f5f708f5a1e403a0b26fc5b8920a2d092 [file] [log] [blame]
Adam Lesinski182f73f2013-12-05 16:48:06 -08001/*
2 * Copyright (C) 2013 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 com.android.server.lights;
18
Steven Moreland8b9ec4f2016-10-04 17:25:52 -070019import android.hardware.light.V2_0.Flash;
20import android.hardware.light.V2_0.Brightness;
21
Adam Lesinski182f73f2013-12-05 16:48:06 -080022public abstract class Light {
Steven Moreland8b9ec4f2016-10-04 17:25:52 -070023 public static final int LIGHT_FLASH_NONE = Flash.NONE;
24 public static final int LIGHT_FLASH_TIMED = Flash.TIMED;
25 public static final int LIGHT_FLASH_HARDWARE = Flash.HARDWARE;
Adam Lesinski182f73f2013-12-05 16:48:06 -080026
27 /**
28 * Light brightness is managed by a user setting.
29 */
Steven Moreland8b9ec4f2016-10-04 17:25:52 -070030 public static final int BRIGHTNESS_MODE_USER = Brightness.USER;
Adam Lesinski182f73f2013-12-05 16:48:06 -080031
32 /**
33 * Light brightness is managed by a light sensor.
34 */
Steven Moreland8b9ec4f2016-10-04 17:25:52 -070035 public static final int BRIGHTNESS_MODE_SENSOR = Brightness.SENSOR;
Adam Lesinski182f73f2013-12-05 16:48:06 -080036
Ruben Brunk8ad3f202015-12-28 14:45:11 -080037 /**
38 * Low-persistence light mode.
39 */
Steven Moreland8b9ec4f2016-10-04 17:25:52 -070040 public static final int BRIGHTNESS_MODE_LOW_PERSISTENCE = Brightness.LOW_PERSISTENCE;
Ruben Brunk8ad3f202015-12-28 14:45:11 -080041
Adam Lesinski182f73f2013-12-05 16:48:06 -080042 public abstract void setBrightness(int brightness);
43 public abstract void setBrightness(int brightness, int brightnessMode);
44 public abstract void setColor(int color);
45 public abstract void setFlashing(int color, int mode, int onMS, int offMS);
46 public abstract void pulse();
47 public abstract void pulse(int color, int onMS);
48 public abstract void turnOff();
Santos Cordon3107d292016-09-20 15:50:35 -070049 public abstract void setVrMode(boolean enabled);
Ruben Brunk8ad3f202015-12-28 14:45:11 -080050}