Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pie] [xiaomi] Use persist.sys.phh.xiaomi.dt2w prop to control DT2W #139

Merged
merged 1 commit into from
Mar 26, 2020

Conversation

cheah
Copy link
Contributor

@cheah cheah commented Dec 29, 2019

On stock kernel, the /proc gesture nodes are created to control DT2W
whyred: https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/tulip-p-oss/drivers/input/touchscreen/lct_tp_gesture.c#L98
daisy: https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/daisy-p-oss/drivers/input/touchscreen/gt917d/gt9xx.c#L1795

We can write "1" to these /proc nodes to enable DT2W and "0" to disable it

Related PR: phhusson/treble_app#21

@phhusson
Copy link
Owner

You'll need to tell me on what it has been tested. I've been told that some device have /dev/input dt2w control but not /proc.
Also, please note that opensource Xiaomi kernel DO NOT MATCH the actual production kernels.

I'd like to keep the /dev/input at least as fallback if no node has been found

@cheah
Copy link
Contributor Author

cheah commented Jan 16, 2020

Testes on whyred as well.
I'll amend the related PRs to keep the /dev/input first.

@cheah cheah changed the title [xiaomi] Use /proc nodes to control DT2W WIP: [xiaomi] Use /proc nodes to control DT2W Jan 24, 2020
@cheah cheah changed the title WIP: [xiaomi] Use /proc nodes to control DT2W [Pie] [xiaomi] Use /proc nodes to control DT2W Jan 24, 2020
@cheah
Copy link
Contributor Author

cheah commented Jan 24, 2020

Done.
Tested on whyred with both OSS kernel and stock kernel on P Vendor.

@phhusson
Copy link
Owner

phhusson commented Mar 8, 2020

FWIW I can confirm my Mi 9 (cepheus) doesn't have any of those /proc nodes, so I confirm the /dev/input is needed

As for proc_dt2w_gesture, please don't do it with genfscon, but do it in rw-system.sh with chcon.

genfscon conflicts are not resolved, which means that if vendor has a genfscon proc proc_dt2w_gesture with another label/context, the device will simply not boot (or reboot to bootloader in stock AOSP, reboot to recovery in my GSI)

@phhusson
Copy link
Owner

phhusson commented Mar 8, 2020

Except for that, good for me. Feel free to bother me more to have this merged

@cheah
Copy link
Contributor Author

cheah commented Mar 21, 2020

Hi @phhusson, thanks for the tips about genfscon conflicts! However I have no idea how to fix this now since we can't chcon on /proc 😞 Maybe we should just forget the whole idea about setting DT2W thru proc node?

@phhusson
Copy link
Owner

phhusson commented Mar 21, 2020 via email

@cheah
Copy link
Contributor Author

cheah commented Mar 21, 2020

Ok, what do you think about this: cheah@e016ce1? If it looks good to you then I'll update the PR and TrebleApp.

This way we can even remove the sepolicy for allow system_app input_device since it's no longer needed.

@cheah
Copy link
Contributor Author

cheah commented Mar 22, 2020

TrebleApp will look like this: cheah/treble_app@7b6789b

@cheah cheah force-pushed the fix-xiaomi-dt2w branch from 93e199d to 921ac55 Compare March 22, 2020 13:11
@cheah
Copy link
Contributor Author

cheah commented Mar 22, 2020

Fixed based on comments and also ran it thru shfmt & shellcheck. Please help to take a look again 😄

PR for Android 10 branch: #146
TrebleApp: phhusson/treble_app#21

@cheah cheah changed the title [Pie] [xiaomi] Use /proc nodes to control DT2W [Pie] [xiaomi] Use persist.sys.phh.xiaomi.dt2w prop to control DT2W Mar 22, 2020
@cheah
Copy link
Contributor Author

cheah commented Mar 25, 2020

@phhusson bump in case you missed it 🙂

@cheah cheah force-pushed the fix-xiaomi-dt2w branch from 921ac55 to 58dd996 Compare March 26, 2020 01:52
@cheah cheah requested a review from phhusson March 26, 2020 01:55
@phhusson phhusson merged commit 7e2b58b into phhusson:android-9.0 Mar 26, 2020
@cheah cheah deleted the fix-xiaomi-dt2w branch March 26, 2020 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants