aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--light/Light.cpp14
-rw-r--r--light/Light.h3
-rw-r--r--light/service.cpp30
3 files changed, 1 insertions, 46 deletions
diff --git a/light/Light.cpp b/light/Light.cpp
index a364f05..c59abb6 100644
--- a/light/Light.cpp
+++ b/light/Light.cpp
@@ -59,7 +59,6 @@ namespace V2_0 {
namespace implementation {
Light::Light(std::pair<std::ofstream, uint32_t>&& lcd_backlight,
- std::vector<std::ofstream>&& button_backlight,
std::ofstream&& red_led, std::ofstream&& green_led, std::ofstream&& blue_led,
std::ofstream&& red_duty_pcts, std::ofstream&& green_duty_pcts, std::ofstream&& blue_duty_pcts,
std::ofstream&& red_start_idx, std::ofstream&& green_start_idx, std::ofstream&& blue_start_idx,
@@ -69,7 +68,6 @@ Light::Light(std::pair<std::ofstream, uint32_t>&& lcd_backlight,
std::ofstream&& red_blink, std::ofstream&& green_blink, std::ofstream&& blue_blink,
std::ofstream&& rgb_blink)
: mLcdBacklight(std::move(lcd_backlight)),
- mButtonBacklight(std::move(button_backlight)),
mRedLed(std::move(red_led)),
mGreenLed(std::move(green_led)),
mBlueLed(std::move(blue_led)),
@@ -95,12 +93,10 @@ Light::Light(std::pair<std::ofstream, uint32_t>&& lcd_backlight,
auto attnFn(std::bind(&Light::setAttentionLight, this, std::placeholders::_1));
auto backlightFn(std::bind(&Light::setLcdBacklight, this, std::placeholders::_1));
auto batteryFn(std::bind(&Light::setBatteryLight, this, std::placeholders::_1));
- auto buttonsFn(std::bind(&Light::setButtonsBacklight, this, std::placeholders::_1));
auto notifFn(std::bind(&Light::setNotificationLight, this, std::placeholders::_1));
mLights.emplace(std::make_pair(Type::ATTENTION, attnFn));
mLights.emplace(std::make_pair(Type::BACKLIGHT, backlightFn));
mLights.emplace(std::make_pair(Type::BATTERY, batteryFn));
- mLights.emplace(std::make_pair(Type::BUTTONS, buttonsFn));
mLights.emplace(std::make_pair(Type::NOTIFICATIONS, notifFn));
}
@@ -151,16 +147,6 @@ void Light::setLcdBacklight(const LightState& state) {
mLcdBacklight.first << brightness << std::endl;
}
-void Light::setButtonsBacklight(const LightState& state) {
- std::lock_guard<std::mutex> lock(mLock);
-
- uint32_t brightness = rgbToBrightness(state);
-
- for (auto& button : mButtonBacklight) {
- button << brightness << std::endl;
- }
-}
-
void Light::setBatteryLight(const LightState& state) {
std::lock_guard<std::mutex> lock(mLock);
mBatteryState = state;
diff --git a/light/Light.h b/light/Light.h
index f21e19e..958d215 100644
--- a/light/Light.h
+++ b/light/Light.h
@@ -32,7 +32,6 @@ namespace implementation {
struct Light : public ILight {
Light(std::pair<std::ofstream, uint32_t>&& lcd_backlight,
- std::vector<std::ofstream>&& button_backlight,
std::ofstream&& red_led, std::ofstream&& green_led, std::ofstream&& blue_led,
std::ofstream&& red_duty_pcts, std::ofstream&& green_duty_pcts, std::ofstream&& blue_duty_pcts,
std::ofstream&& red_start_idx, std::ofstream&& green_start_idx, std::ofstream&& blue_start_idx,
@@ -49,14 +48,12 @@ struct Light : public ILight {
private:
void setAttentionLight(const LightState& state);
void setBatteryLight(const LightState& state);
- void setButtonsBacklight(const LightState& state);
void setLcdBacklight(const LightState& state);
void setNotificationLight(const LightState& state);
void setSpeakerBatteryLightLocked();
void setSpeakerLightLocked(const LightState& state);
std::pair<std::ofstream, uint32_t> mLcdBacklight;
- std::vector<std::ofstream> mButtonBacklight;
std::ofstream mRedLed;
std::ofstream mGreenLed;
std::ofstream mBlueLed;
diff --git a/light/service.cpp b/light/service.cpp
index 8dd750d..cab1d04 100644
--- a/light/service.cpp
+++ b/light/service.cpp
@@ -32,9 +32,6 @@ using android::hardware::light::V2_0::implementation::Light;
const static std::string kLcdBacklightPath = "/sys/class/leds/lcd-backlight/brightness";
const static std::string kLcdMaxBacklightPath = "/sys/class/leds/lcd-backlight/max_brightness";
-const static std::string kButton1BacklightPath = "/sys/class/leds/button-backlight/brightness";
-const static std::string kButton2BacklightPath = "/sys/class/leds/button-backlight1/brightness";
-const static std::string kButton3BacklightPath = "/sys/class/leds/button-backlight2/brightness";
const static std::string kRedLedPath = "/sys/class/leds/red/brightness";
const static std::string kGreenLedPath = "/sys/class/leds/green/brightness";
const static std::string kBlueLedPath = "/sys/class/leds/blue/brightness";
@@ -60,7 +57,6 @@ const static std::string kRgbBlinkPath = "/sys/class/leds/rgb/rgb_blink";
int main() {
uint32_t lcdMaxBrightness = 255;
- std::vector<std::ofstream> buttonBacklight;
std::ofstream lcdBacklight(kLcdBacklightPath);
if (!lcdBacklight) {
@@ -78,30 +74,6 @@ int main() {
lcdMaxBacklight >> lcdMaxBrightness;
}
- std::ofstream button1Backlight(kButton1BacklightPath);
- if (button1Backlight) {
- buttonBacklight.emplace_back(std::move(button1Backlight));
- } else {
- LOG(WARNING) << "Failed to open " << kButton1BacklightPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- }
-
- std::ofstream button2Backlight(kButton2BacklightPath);
- if (button2Backlight) {
- buttonBacklight.emplace_back(std::move(button2Backlight));
- } else {
- LOG(WARNING) << "Failed to open " << kButton2BacklightPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- }
-
- std::ofstream button3Backlight(kButton3BacklightPath);
- if (button3Backlight) {
- buttonBacklight.emplace_back(std::move(button3Backlight));
- } else {
- LOG(WARNING) << "Failed to open " << kButton3BacklightPath << ", error=" << errno
- << " (" << strerror(errno) << ")";
- }
-
std::ofstream redLed(kRedLedPath);
if (!redLed) {
LOG(ERROR) << "Failed to open " << kRedLedPath << ", error=" << errno
@@ -257,7 +229,7 @@ int main() {
}
android::sp<ILight> service = new Light(
- {std::move(lcdBacklight), lcdMaxBrightness}, std::move(buttonBacklight),
+ {std::move(lcdBacklight), lcdMaxBrightness},
std::move(redLed), std::move(greenLed), std::move(blueLed),
std::move(redDutyPcts), std::move(greenDutyPcts), std::move(blueDutyPcts),
std::move(redStartIdx), std::move(greenStartIdx), std::move(blueStartIdx),