Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.server.lights; |
| 18 | |
Steven Moreland | 8b9ec4f | 2016-10-04 17:25:52 -0700 | [diff] [blame] | 19 | import android.hardware.light.V2_0.Flash; |
| 20 | import android.hardware.light.V2_0.Brightness; |
| 21 | |
Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 22 | public abstract class Light { |
Steven Moreland | 8b9ec4f | 2016-10-04 17:25:52 -0700 | [diff] [blame] | 23 | 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 Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Light brightness is managed by a user setting. |
| 29 | */ |
Steven Moreland | 8b9ec4f | 2016-10-04 17:25:52 -0700 | [diff] [blame] | 30 | public static final int BRIGHTNESS_MODE_USER = Brightness.USER; |
Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Light brightness is managed by a light sensor. |
| 34 | */ |
Steven Moreland | 8b9ec4f | 2016-10-04 17:25:52 -0700 | [diff] [blame] | 35 | public static final int BRIGHTNESS_MODE_SENSOR = Brightness.SENSOR; |
Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 36 | |
Ruben Brunk | 8ad3f20 | 2015-12-28 14:45:11 -0800 | [diff] [blame] | 37 | /** |
| 38 | * Low-persistence light mode. |
| 39 | */ |
Steven Moreland | 8b9ec4f | 2016-10-04 17:25:52 -0700 | [diff] [blame] | 40 | public static final int BRIGHTNESS_MODE_LOW_PERSISTENCE = Brightness.LOW_PERSISTENCE; |
Ruben Brunk | 8ad3f20 | 2015-12-28 14:45:11 -0800 | [diff] [blame] | 41 | |
Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 42 | 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 Cordon | 3107d29 | 2016-09-20 15:50:35 -0700 | [diff] [blame] | 49 | public abstract void setVrMode(boolean enabled); |
Ruben Brunk | 8ad3f20 | 2015-12-28 14:45:11 -0800 | [diff] [blame] | 50 | } |