phhusson / treble_app

An app which will do various stuff for Treble ROMs
68 stars 93 forks source link

add Xiaomi features #20

Closed eremitein closed 4 years ago

eremitein commented 4 years ago
eremitein commented 4 years ago

[additional info]

ls -lZ /proc/touchpanel/wakeup_gesture
-rw-r--r-- 1 root root u:object_r:sysfs:s0 4096 1970-02-07 06:30 /proc/touchpanel/wakeup_gesture
ls -lZd /proc/touchpanel
lrwxrwxrwx 1 root root u:object_r:proc:s0 41 2019-11-21 12:49 /proc/touchpanel -> /sys/devices/soc/78b7000.i2c/i2c-3/3-0038

after "chown system /proc/touchpanel/wakeup_gesture" and "setenforce 0" dt2w began work

11-21 12:53:51.784 3594 3594 I auditd : type=1400 audit(0.0:16799): avc: denied { write } for comm=".phh.treble.app" name="wakeup_gesture" dev="sysfs" ino=28072 scontext=u:r:system_app:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1

eremitein commented 4 years ago

also need add rules for node "/proc/tp_wakeup_gesture", but i can't test because have another touch panel

phhusson commented 4 years ago

To be clear, this works on stock kernel, it's not a community kernel?

eremitein commented 4 years ago

To be clear, this works on stock kernel, it's not a community kernel?

no, works on custom kernel

i can't test on stock, because for "fts_ts" touchscreen in stock kernel used fw blob and node not exist

need a user with "goodix-ts" touchpanel

phhusson commented 4 years ago

well if it's only custom kernel, I'm not interested in this change. Doesn't stock ROM support dt2w?

Le dim. 24 nov. 2019 à 16:48, Victor Bo notifications@github.com a écrit :

To be clear, this works on stock kernel, it's not a community kernel?

no, works on custom kernel

i can't test on stock, because for "fts_ts" touchscreen in stock kernel used fw blob and node not exist

need a user with "goodix-ts" touchpanel

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phhusson/treble_app/pull/20?email_source=notifications&email_token=AAAA4OXSQO5EOXKB65HWXV3QVKO6JA5CNFSM4JQVSHY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAOJQA#issuecomment-557900992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAA4OS76JSN3ISP6WAILZDQVKO6JANCNFSM4JQVSHYQ .

eremitein commented 4 years ago

well if it's only custom kernel, I'm not interested in this change. Doesn't stock ROM support dt2w?

you need all information?) ok, it's a very long story, not a short "yes" or "no". it's "yes&no" at same time - stock have dt2w but not for all cases

look, daisy exist with two variants of touch panel - fts_ts and goodix-ts. stock have dt2w by default for fts_ts (closed fw blob w/o node) - until 10.0.10.0 firmware. stock have dt2w but it disabled by default for goodix-ts - need manually turn on via node.

btw what's your risk if you add this feature?)

for justice - stock not have "hand wave/out of pocket" gestures, but you added it for all supported devices. why not adding support dt2w for all supported nodes?)

eremitein commented 4 years ago

or maybe better create global option Doze features > Enable DT2W? put all nodes there and if node exist then show option? because many phones using same touch panels and same nodes too

what you think about this?

phhusson commented 4 years ago

look, daisy exist with two variants of touch panel - fts_ts and goodix-ts. stock have dt2w by default for fts_ts (closed fw blob w/o node) - until 10.0.10.0 firmware.

I don't understand, what do you mean with "closed fw blob"? All touchscreen have closed-source firmware.

stock have dt2w but it disabled by default for goodix-ts - need manually turn on via node.

btw what's your risk if you add this feature?) I don't want to support custom kernel-specific features. If you tell me those files also exist on stock rom as well, ok

you need all information?) ok, it's a very long story, not a short "yes" or "no". it's "yes&no" at same time - stock have dt2w but not for all cases

I don't get it, considering what you just said, stock does have dt2w for all cases?

for justice - stock not have "hand wave/out of pocket" gestures, but you added it for all supported devices. why not adding support dt2w for all supported nodes?) That doesn't require any hardware support except for a proximity sensor. This has just nothing to do with it.

phhusson commented 4 years ago

or maybe better create global option Doze features > Enable DT2W? put all nodes there and if node exist then show option? because many phones using same touch panels and same nodes too

what you think about this?

That'd be better for the user that's for sure, but that's going to be a mess of a code... And how do you know which value to write to /proc/tp_wakeup_gesture ? I seem to remember OnePlus also has that file, but it's not 1 you want to write to it, it's like 8

eremitein commented 4 years ago

I don't get it, considering what you just said, stock does have dt2w for all cases?

stock kernel + fts_ts = have dt2w by default always on, not possible controlling it via proc/sysfs - node not found (after 10.0.10.0 fw Xiaomi disabled dt2w on the system level)

stock kernel + goodix-ts = have dt2w, but it's disabled by default, need to send 1 to the node /proc/tp_wakeup_gesture (miui "sakura" have option in setting to do this)

That'd be better for the user that's for sure, but that's going to be a mess of a code... And how do you know which value to write to /proc/tp_wakeup_gesture ? I seem to remember OnePlus also has that file, but it's not 1 you want to write to it, it's like 8

oh, my mistake. i don't knew about that nuances

phhusson commented 4 years ago

Isn't Xiaomi using this nowadays? https://github.com/LineageOS/android_hardware_qcom_power/commit/12c244bb35c8534b9815d5c085c0d31a86f62fd4

eremitein commented 4 years ago

Isn't Xiaomi using this nowadays?

i don't know. what is it and how i can confirm is it using?

phhusson commented 4 years ago

Could you check if with https://github.com/phhusson/treble_app/commit/ceebcc8ed4d48389c93f7be1eadeeebca2ea38b7 it still works with you?

eremitein commented 4 years ago

Could you check if with ceebcc8 it still works with you?

I can check after ~12 hours, need an access to my devnotebook

eremitein commented 4 years ago

Could you check if with ceebcc8 it still works with you?

yeah, it works)

eremitein commented 4 years ago

only one thing - even if kernel not have dt2w node then option still shown

phhusson commented 4 years ago

My added code path doesn't work on the OEM kernel with dt2w but not the nodes you use?

Le lun. 2 déc. 2019 à 23:51, Victor Bo notifications@github.com a écrit :

only one thing - even if kernel not have dt2w node then option still shown

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/phhusson/treble_app/pull/20?email_source=notifications&email_token=AAAA4OQKHCPAF7PDBVVGT23QWWGNXA5CNFSM4JQVSHY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFWUP7Y#issuecomment-560809983, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAA4ORBSDRLFQ4CYLLEM33QWWGNXANCNFSM4JQVSHYQ .

eremitein commented 4 years ago

My added code path doesn't work on the OEM kernel with dt2w but not the nodes you use?

i can't test /proc/tp_wakeup_gesture node with OEM kernel, need a daisy-user with goodix ts

you patch works fine for node /proc/touchpanel/wakeup_gesture, but even if i changed to kernel without this node - option still shown in menu

i guess, due to that https://github.com/phhusson/treble_app/commit/ceebcc8ed4d48389c93f7be1eadeeebca2ea38b7#diff-5e959f723d6de9de9c671bb344324c0bL8 //you removed "&& File(Xiaomi.dtPanel).exists()"