summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2010-08-20 15:40:31 +0000
committerGerrit Code Review <gerrit2@cyanogenmod.teamdouche.net>2010-08-20 15:40:31 +0000
commit648ab3ac7c3555bc2b6253cdfbc5ac026e3bb9e3 (patch)
treefc4f7ea9428cc9a1ec427f211a53bbf245c6da95
parentadeeb14b4865b6173db1be1179da67bbbceaea9a (diff)
parent6a0b0ec46449015a1b5181a8f22d08422d648a3b (diff)
downloadframeworks_base-648ab3ac7c3555bc2b6253cdfbc5ac026e3bb9e3.zip
frameworks_base-648ab3ac7c3555bc2b6253cdfbc5ac026e3bb9e3.tar.gz
frameworks_base-648ab3ac7c3555bc2b6253cdfbc5ac026e3bb9e3.tar.bz2
Merge "lights: Support deprecated flashlight API on MSM" into froyo
-rw-r--r--services/java/com/android/server/LightsService.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/services/java/com/android/server/LightsService.java b/services/java/com/android/server/LightsService.java
index e057f33..7c0a80e 100644
--- a/services/java/com/android/server/LightsService.java
+++ b/services/java/com/android/server/LightsService.java
@@ -23,7 +23,6 @@ import android.os.IHardwareService;
import android.os.ServiceManager;
import android.os.Message;
import android.util.Slog;
-import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
@@ -62,6 +61,17 @@ public class LightsService {
private final Light mLights[] = new Light[LIGHT_ID_COUNT];
+ private static final String FLASHLIGHT_FILE;
+ private static final String FLASHLIGHT_FILE_SPOTLIGHT = "/sys/class/leds/spotlight/brightness";
+ static {
+ File ff = new File(FLASHLIGHT_FILE_SPOTLIGHT);
+ if (ff.exists()) {
+ FLASHLIGHT_FILE = FLASHLIGHT_FILE_SPOTLIGHT;
+ } else {
+ FLASHLIGHT_FILE = "/sys/class/leds/flashlight/brightness";
+ }
+ }
+
public final class Light {
private Light(int id) {
@@ -149,8 +159,6 @@ public class LightsService {
*/
private final IHardwareService.Stub mLegacyFlashlightHack = new IHardwareService.Stub() {
- private static final String FLASHLIGHT_FILE = "/sys/class/leds/spotlight/brightness";
-
public boolean getFlashlightEnabled() {
try {
FileInputStream fis = new FileInputStream(FLASHLIGHT_FILE);