Skip to content

Commit

Permalink
Revert "liblight: Add brightness level extension support"
Browse files Browse the repository at this point in the history
This reverts commit 586c6d5.

Change-Id: I7af568b0924b6d1bfce903f8d758f21d369c193c
  • Loading branch information
Ch Ganesh Kumar authored and Gerrit - the friendly Code Review server committed Apr 30, 2018
1 parent c9da917 commit 71f50f3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 140 deletions.
6 changes: 2 additions & 4 deletions liblight/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ LOCAL_PATH:= $(call my-dir)
# hw/<COPYPIX_HARDWARE_MODULE_ID>.<ro.board.platform>.so
include $(CLEAR_VARS)

LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/common/inc
LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/qdcm/inc

LOCAL_SRC_FILES := lights.c lights_prv.cpp
LOCAL_SRC_FILES := lights.c
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SHARED_LIBRARIES := liblog libcutils libsdm-disp-vndapis
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_HEADER_LIBRARIES := libhardware_headers
LOCAL_CFLAGS := -DLOG_TAG=\"qdlights\"
LOCAL_CLANG := true
Expand Down
44 changes: 5 additions & 39 deletions liblight/lights.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014, 2017 The Linux Foundation. All rights reserved.
* Copyright (C) 2014, 2017-2018 The Linux Foundation. All rights reserved.
* Not a contribution
* Copyright (C) 2008 The Android Open Source Project
*
Expand Down Expand Up @@ -33,7 +33,6 @@
#include <sys/types.h>

#include <hardware/lights.h>
#include "lights_prv.h"

#ifndef DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS
#define DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS 0x80
Expand All @@ -47,7 +46,6 @@ static struct light_state_t g_notification;
static struct light_state_t g_battery;
static int g_last_backlight_mode = BRIGHTNESS_MODE_USER;
static int g_attention = 0;
static int g_brightness_max = 0;

char const*const RED_LED_FILE
= "/sys/class/leds/red/brightness";
Expand Down Expand Up @@ -165,28 +163,6 @@ set_light_backlight(struct light_device_t* dev,
return err;
}

static int
set_light_backlight_ext(struct light_device_t* dev,
struct light_state_t const* state)
{
int err = 0;

if(!dev) {
return -1;
}

int brightness = state->color & 0x00ffffff;
pthread_mutex_lock(&g_lock);

if (brightness >= 0 && brightness <= g_brightness_max) {
set_brightness_ext_level(brightness);
}

pthread_mutex_unlock(&g_lock);

return err;
}

static int
set_speaker_light_locked(struct light_device_t* dev,
struct light_state_t const* state)
Expand Down Expand Up @@ -242,15 +218,15 @@ set_speaker_light_locked(struct light_device_t* dev,
if (red) {
if (write_int(RED_BLINK_FILE, blink))
write_int(RED_LED_FILE, 0);
}
}
if (green) {
if (write_int(GREEN_BLINK_FILE, blink))
write_int(GREEN_LED_FILE, 0);
}
}
if (blue) {
if (write_int(BLUE_BLINK_FILE, blink))
write_int(BLUE_LED_FILE, 0);
}
}
} else {
write_int(RED_LED_FILE, red);
write_int(GREEN_LED_FILE, green);
Expand Down Expand Up @@ -346,17 +322,7 @@ static int open_lights(const struct hw_module_t* module, char const* name,
struct light_state_t const* state);

if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) {
char property[PROPERTY_VALUE_MAX];
property_get("persist.extend.brightness", property, "0");

if(!(strncmp(property, "1", PROPERTY_VALUE_MAX)) ||
!(strncmp(property, "true", PROPERTY_VALUE_MAX))) {
property_get("persist.display.max_brightness", property, "255");
g_brightness_max = atoi(property);
set_brightness_ext_init();
set_light = set_light_backlight_ext;
} else
set_light = set_light_backlight;
set_light = set_light_backlight;
} else if (0 == strcmp(LIGHT_ID_BATTERY, name))
set_light = set_light_battery;
else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name))
Expand Down
54 changes: 0 additions & 54 deletions liblight/lights_prv.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions liblight/lights_prv.h

This file was deleted.

0 comments on commit 71f50f3

Please sign in to comment.