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 19 import android.hardware.light.V2_0.Flash; 20 import android.hardware.light.V2_0.Brightness; 21 22 public abstract class Light { 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; 26 27 /** 28 * Light brightness is managed by a user setting. 29 */ 30 public static final int BRIGHTNESS_MODE_USER = Brightness.USER; 31 32 /** 33 * Light brightness is managed by a light sensor. 34 */ 35 public static final int BRIGHTNESS_MODE_SENSOR = Brightness.SENSOR; 36 37 /** 38 * Low-persistence light mode. 39 */ 40 public static final int BRIGHTNESS_MODE_LOW_PERSISTENCE = Brightness.LOW_PERSISTENCE; 41 setBrightness(int brightness)42 public abstract void setBrightness(int brightness); setBrightness(int brightness, int brightnessMode)43 public abstract void setBrightness(int brightness, int brightnessMode); setColor(int color)44 public abstract void setColor(int color); setFlashing(int color, int mode, int onMS, int offMS)45 public abstract void setFlashing(int color, int mode, int onMS, int offMS); pulse()46 public abstract void pulse(); pulse(int color, int onMS)47 public abstract void pulse(int color, int onMS); turnOff()48 public abstract void turnOff(); setVrMode(boolean enabled)49 public abstract void setVrMode(boolean enabled); 50 } 51