summaryrefslogtreecommitdiff
path: root/light
diff options
context:
space:
mode:
authorDavide Garberi <dade.garberi@gmail.com>2019-08-31 18:52:20 +0200
committerDavide Garberi <dade.garberi@gmail.com>2019-09-18 19:09:12 +0200
commit73bc815d397b47f1d6d0c74f98d4a4b697b19a96 (patch)
treea64b72f884a6eb98fee58178d357a133cb33821a /light
parent396498da87b9dbb7cd9783fefea1bd24a3ebc704 (diff)
sdm660-common: Convert to 660 common tree
Change-Id: I903039730f4181f6a326f28e0ea212db68bdabcc
Diffstat (limited to 'light')
-rw-r--r--light/Android.bp4
-rw-r--r--light/Light.cpp14
-rw-r--r--light/android.hardware.light@2.0-service.xiaomi_sdm660.rc (renamed from light/android.hardware.light@2.0-service.xiaomi_wayne.rc)2
-rw-r--r--light/service.cpp2
4 files changed, 11 insertions, 11 deletions
diff --git a/light/Android.bp b/light/Android.bp
index a60fcf8..e05d16d 100644
--- a/light/Android.bp
+++ b/light/Android.bp
@@ -15,8 +15,8 @@
cc_binary {
defaults: ["hidl_defaults"],
- name: "android.hardware.light@2.0-service.xiaomi_wayne",
- init_rc: ["android.hardware.light@2.0-service.xiaomi_wayne.rc"],
+ name: "android.hardware.light@2.0-service.xiaomi_sdm660",
+ init_rc: ["android.hardware.light@2.0-service.xiaomi_sdm660.rc"],
srcs: ["service.cpp", "Light.cpp"],
shared_libs: [
"libhardware",
diff --git a/light/Light.cpp b/light/Light.cpp
index d1981bb..780d3ab 100644
--- a/light/Light.cpp
+++ b/light/Light.cpp
@@ -16,7 +16,7 @@
//Author := dev_harsh1998, Isaac Chen
-#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_wayne"
+#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_sdm660"
#include <log/log.h>
#include <fstream>
@@ -86,7 +86,7 @@ static std::string getScaledRamp(uint32_t brightness) {
return ramp;
}
-static void handleWayneBacklight(Type /*type*/, const LightState& state) {
+static void handleXiaomiBacklight(Type /*type*/, const LightState& state) {
uint32_t brightness = state.color & 0xFF;
brightness *= 16; // HACK
set(LCD_LED BRIGHTNESS, brightness);
@@ -152,7 +152,7 @@ static std::vector<std::pair<Type, LightState>> notificationStates = {
{ Type::BATTERY, offState },
};
-static void handleWayneNotification(Type type, const LightState& state) {
+static void handleXiaomiNotification(Type type, const LightState& state) {
for(auto it : notificationStates) {
if (it.first == type) {
it.second = state;
@@ -168,10 +168,10 @@ static void handleWayneNotification(Type type, const LightState& state) {
}
static std::map<Type, std::function<void(Type type, const LightState&)>> lights = {
- {Type::BACKLIGHT, handleWayneBacklight},
- {Type::NOTIFICATIONS, handleWayneNotification},
- {Type::BATTERY, handleWayneNotification},
- {Type::ATTENTION, handleWayneNotification},
+ {Type::BACKLIGHT, handleXiaomiBacklight},
+ {Type::NOTIFICATIONS, handleXiaomiNotification},
+ {Type::BATTERY, handleXiaomiNotification},
+ {Type::ATTENTION, handleXiaomiNotification},
};
Light::Light() {}
diff --git a/light/android.hardware.light@2.0-service.xiaomi_wayne.rc b/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc
index f803030..ba0f41a 100644
--- a/light/android.hardware.light@2.0-service.xiaomi_wayne.rc
+++ b/light/android.hardware.light@2.0-service.xiaomi_sdm660.rc
@@ -14,7 +14,7 @@ on boot
chmod 660 /sys/class/leds/red/ramp_step_ms
chmod 660 /sys/class/leds/red/start_idx
-service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.xiaomi_wayne
+service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.xiaomi_sdm660
class hal
user system
group system
diff --git a/light/service.cpp b/light/service.cpp
index abefdc0..8f6fa88 100644
--- a/light/service.cpp
+++ b/light/service.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_wayne"
+#define LOG_TAG "android.hardware.light@2.0-service.xiaomi_sdm660"
#include <hidl/HidlTransportSupport.h>