Skip to content

Commit

Permalink
notification/flashlight: fixes for pixel4 events
Browse files Browse the repository at this point in the history
  • Loading branch information
tbalden committed Feb 2, 2020
1 parent e9fae23 commit f3ee4f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
13 changes: 5 additions & 8 deletions drivers/misc/notification/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void ntf_add_listener(void (*f)(char* event, int num_param, char* str_param)) {
}
EXPORT_SYMBOL(ntf_add_listener);

static bool screen_on = false, screen_on_early = false, screen_off_early = false;
static bool screen_on = true, screen_on_early = false, screen_off_early = false;
static long last_input_event = 0;

// ======= SCREEN ON/OFF
Expand Down Expand Up @@ -389,13 +389,10 @@ bool ntf_wake_by_user(void) {
}
EXPORT_SYMBOL(ntf_wake_by_user);

void set_last_input_event(const char * caller) {
//I("%s caller %s",__func__,caller);
last_input_event = get_global_mseconds();
}
void ntf_input_event(const char* caller, const char *param) {
// input event happened, stop stuff, store timesamp, set wake_by_user
set_last_input_event(__func__);
//pr_info("%s called by %s",__func__,caller);
last_input_event = get_global_mseconds();
wake_by_user = true;
smart_set_last_user_activity_time();
ntf_notify_listeners(NTF_EVENT_INPUT,1,(char *)param);
Expand All @@ -417,9 +414,9 @@ void ntf_vibration(int length) {
ntf_notify_listeners(NTF_EVENT_NOTIFICATION, 1, NTF_EVENT_NOTIFICATION_ARG_HAPTIC);
}
}
#if 1
#if 0
// htc u12
// if (length==TD_VALUE_HTC_U12_FINGERPRINT) register_fp_vibration();//ntf_input_event(__func__,"fp");
if (length==TD_VALUE_HTC_U12_FINGERPRINT) register_fp_vibration();//ntf_input_event(__func__,"fp");
#endif
}
EXPORT_SYMBOL(ntf_vibration);
Expand Down
7 changes: 5 additions & 2 deletions drivers/misc/notification/ntf_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,13 @@ static void ntf_listener(char* event, int num_param, char* str_param) {
flash_stop_blink();
}
}
if (!strcmp(event,NTF_EVENT_WAKE_BY_USER)) {
if (!strcmp(event,NTF_EVENT_WAKE_BY_USER)) { // SCREEN ON BY USER
flash_stop_blink();
}
if (!strcmp(event,NTF_EVENT_INPUT)) {
if (!strcmp(event,NTF_EVENT_LOCKED) && !num_param) { // UNLOCKED / faceunlock
flash_stop_blink();
}
if (!strcmp(event,NTF_EVENT_INPUT)) { // INPUT
if (ntf_wake_by_user()) {
flash_stop_blink();
}
Expand Down

0 comments on commit f3ee4f6

Please sign in to comment.