Skip to content

Commit f3ee4f6

Browse files
committedFeb 2, 2020
notification/flashlight: fixes for pixel4 events
1 parent e9fae23 commit f3ee4f6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
 

‎drivers/misc/notification/notification.c

+5-8
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void ntf_add_listener(void (*f)(char* event, int num_param, char* str_param)) {
9898
}
9999
EXPORT_SYMBOL(ntf_add_listener);
100100

101-
static bool screen_on = false, screen_on_early = false, screen_off_early = false;
101+
static bool screen_on = true, screen_on_early = false, screen_off_early = false;
102102
static long last_input_event = 0;
103103

104104
// ======= SCREEN ON/OFF
@@ -389,13 +389,10 @@ bool ntf_wake_by_user(void) {
389389
}
390390
EXPORT_SYMBOL(ntf_wake_by_user);
391391

392-
void set_last_input_event(const char * caller) {
393-
//I("%s caller %s",__func__,caller);
394-
last_input_event = get_global_mseconds();
395-
}
396392
void ntf_input_event(const char* caller, const char *param) {
397393
// input event happened, stop stuff, store timesamp, set wake_by_user
398-
set_last_input_event(__func__);
394+
//pr_info("%s called by %s",__func__,caller);
395+
last_input_event = get_global_mseconds();
399396
wake_by_user = true;
400397
smart_set_last_user_activity_time();
401398
ntf_notify_listeners(NTF_EVENT_INPUT,1,(char *)param);
@@ -417,9 +414,9 @@ void ntf_vibration(int length) {
417414
ntf_notify_listeners(NTF_EVENT_NOTIFICATION, 1, NTF_EVENT_NOTIFICATION_ARG_HAPTIC);
418415
}
419416
}
420-
#if 1
417+
#if 0
421418
// htc u12
422-
// if (length==TD_VALUE_HTC_U12_FINGERPRINT) register_fp_vibration();//ntf_input_event(__func__,"fp");
419+
if (length==TD_VALUE_HTC_U12_FINGERPRINT) register_fp_vibration();//ntf_input_event(__func__,"fp");
423420
#endif
424421
}
425422
EXPORT_SYMBOL(ntf_vibration);

‎drivers/misc/notification/ntf_timer.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,13 @@ static void ntf_listener(char* event, int num_param, char* str_param) {
632632
flash_stop_blink();
633633
}
634634
}
635-
if (!strcmp(event,NTF_EVENT_WAKE_BY_USER)) {
635+
if (!strcmp(event,NTF_EVENT_WAKE_BY_USER)) { // SCREEN ON BY USER
636636
flash_stop_blink();
637637
}
638-
if (!strcmp(event,NTF_EVENT_INPUT)) {
638+
if (!strcmp(event,NTF_EVENT_LOCKED) && !num_param) { // UNLOCKED / faceunlock
639+
flash_stop_blink();
640+
}
641+
if (!strcmp(event,NTF_EVENT_INPUT)) { // INPUT
639642
if (ntf_wake_by_user()) {
640643
flash_stop_blink();
641644
}

0 commit comments

Comments
 (0)
Please sign in to comment.