OSDN Git Service

Remove obsolete flashlight support.
authorMike Lockwood <lockwood@android.com>
Wed, 25 Nov 2009 17:55:44 +0000 (12:55 -0500)
committerMike Lockwood <lockwood@android.com>
Wed, 25 Nov 2009 17:55:44 +0000 (12:55 -0500)
Change-Id: I7d366449301ee685bb3202c738ade06c3102229e
Signed-off-by: Mike Lockwood <lockwood@android.com>
flashlight/Android.mk [deleted file]
flashlight/flashlight.c [deleted file]
include/hardware_legacy/flashlight.h [deleted file]

diff --git a/flashlight/Android.mk b/flashlight/Android.mk
deleted file mode 100644 (file)
index 237d0df..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-
-LOCAL_SRC_FILES += flashlight/flashlight.c
-ifeq ($(QEMU_HARDWARE),yes)
-  LOCAL_CFLAGS += -DQEMU_FLASHLIGHT
-endif
diff --git a/flashlight/flashlight.c b/flashlight/flashlight.c
deleted file mode 100644 (file)
index 0325e11..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#include <hardware_legacy/flashlight.h>
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "qemu.h"
-
-#define FLASHLIGHT "/sys/class/leds/spotlight/brightness"
-#define CAMERA_FLASH "/sys/class/timed_output/flash/enable"
-
-#ifdef QEMU_HARDWARE
-int  qemu_get_flashlight_enabled()
-{
-    char  question[256];
-    char  answer[256];
-    int   len;
-
-    len = qemu_command_format( question, sizeof question,
-                               "get_flashlight_enabled" );
-
-    len = qemu_control_query( question, len, answer, sizeof answer );
-    if (len <= 0) return 0;
-
-    /* we expect an answer of 0 or 1 */
-    return (answer[0] == '1');
-}
-
-int qemu_set_flashlight_enabled(int  on)
-{
-    return qemu_control_command( "set_flashlight_enabled:%d", on );
-}
-
-int qemu_enable_camera_flash(int  milliseconds)
-{
-    return qemu_control_command( "enable_camera_flash:%d", milliseconds );
-}
-#endif
-
-int get_flashlight_enabled()
-{
-    int fd;
-    int ret = 0;
-    char value;
-
-    QEMU_FALLBACK(get_flashlight_enabled());
-
-    fd = open(FLASHLIGHT, O_RDONLY);
-    if(fd && read(fd, &value, 1) == 1) {
-        ret = (value == '1');
-    }
-    close(fd);
-
-    return ret;
-}
-
-int set_flashlight_enabled(int on)
-{
-    int nwr, ret, fd;
-    char value[20];
-
-    QEMU_FALLBACK(set_flashlight_enabled(on));
-
-    fd = open(FLASHLIGHT, O_RDWR);
-    if(fd < 0)
-        return errno;
-
-    nwr = sprintf(value, "%d\n", !!on);
-    ret = write(fd, value, nwr);
-
-    close(fd);
-
-    return (ret == nwr) ? 0 : -1;
-}
-
-int enable_camera_flash(int milliseconds)
-{
-    int nwr, ret, fd;
-    char value[20];
-
-    QEMU_FALLBACK(enable_camera_flash(milliseconds));
-
-    fd = open(CAMERA_FLASH, O_RDWR);
-    if(fd < 0)
-        return errno;
-
-    nwr = sprintf(value, "%d\n", milliseconds);
-    ret = write(fd, value, nwr);
-
-    close(fd);
-
-    return (ret == nwr) ? 0 : -1;
-}
diff --git a/include/hardware_legacy/flashlight.h b/include/hardware_legacy/flashlight.h
deleted file mode 100644 (file)
index d372307..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _HARDWARE_FLASHLIGHT_H\r
-#define _HARDWARE_FLASHLIGHT_H\r
-\r
-#if __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-int get_flashlight_enabled();\r
-int set_flashlight_enabled(int on);\r
-int enable_camera_flash(int milliseconds);\r
-\r
-#if __cplusplus\r
-} // extern "C"\r
-#endif\r
-\r
-#endif // _HARDWARE_FLASHLIGHT_H\r