39 Commits

Author SHA1 Message Date
gensis01
846f67fdc3 pipa: peripheralmanager: Move smart cover settings to display 2025-08-27 18:56:33 +05:30
Roman Lubij
1990629baf pipa: peripheralmanager: Implement smart cover toggle
Change-Id: Id3e70c6128995c7e8a1bf1ed2adf054d3afb7d2c
2025-08-27 18:53:57 +05:30
Michael Bestas
25b6123862 pipa: peripheralmanager: Convert to SwitchPreferenceCompat
Change-Id: Ic1cbaba37d499da1855af9c3930f2df426e2d3af
2025-08-14 12:00:00 +00:00
AdarshGrewal
ec4bb6a8c7 pipa: peripheralmanager: Move stylus settings to display 2025-08-12 12:00:00 +00:00
AdarshGrewal
9070df88de pipa: peripheralmanager: Split refresh rate handling from force stylus
* lets just make sylus mode a thing which for 120hz for it to work
2025-08-12 12:00:00 +00:00
CuriousNom
8d704d3082 pipa: peripheralmanager: Revert many keyboard/pen changes
* will be reimplemented later.
2025-08-12 12:00:00 +00:00
Roman Lubij
af04be6e03 pipa: peripheralmanager: implement a switch for toggling the smart cover 2025-06-17 12:00:00 +00:00
Roman Lubij
93c69a9ac4 pipa: peripheralmanager: set angle detection to false by default
- The whole thing is useful for like 2 pipa owners with the official keyboard, so it's better to keep it opt-in by default
2025-06-17 12:00:00 +00:00
Roman Lubij
cb92741ec1 pipa: peripheralmanager: Implement a toggle for kb angle detection 2025-08-18 13:15:26 +00:00
Roman Lubij
5626759888 pipa: peripheralmanager: removed configuration loading logic
it is useless, and a selinux nightmare
2025-08-18 13:15:26 +00:00
Roman Lubij
023c62aa3c pipa: peripheralmanaher: Bump xiaomi-keyboard to 1.1.0
- Angle detection handling improved (WAY less CPU time required)
- misc improvements
2025-08-18 13:15:26 +00:00
Roman Lubij
ee61cb73aa pipa: peripheralmanaher: improve watchdog stuck logic 2025-08-18 13:15:26 +00:00
Roman Lubij
12a554bf3b (DNM) pipa: peripheralmanager: some optimisations
- Use SIMD math where possible
- Make the kb accel thread sleep for longer
2025-08-18 13:15:26 +00:00
Roman Lubij
946ee66c69 (DNM) pipa: peripheralmanager: Reimplement angle detection
Thanks luka177 for the code for retrieving the accelerometer data from the KB. This is mostly WIP overall, but it does seem to work *okay*.
2025-08-18 13:15:26 +00:00
Roman Lubij
f86f874c61 xiaomi-keyboard: Improve the watchdog
We should no longer be getting a logspam of the watchdog thread being stuck for over 50 years
2025-08-18 13:15:26 +00:00
Abdulwahab Isam
02b7280407 [DNM][TMP] pipa: keybaord watchdog test
Change-Id: I576664b053ca49cb9ef5fcbf635b5e6edda402a7
Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-04-28 18:41:48 +03:00
Abdulwahab Isam
e58955d62e pipa: PeripheralManager: disable keyboard when device is locked
Change-Id: If28600c72be57fc36ef4a871d69e67f05d7e0b7e
Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-04-03 07:25:38 +03:00
Abdulwahab Isam
1bd780c5ee pipa: enhance xiaomi-pen utility with error handling
- Update copyright year to 2023-2025
- Add version information
- Implement proper error handling for device operations
- Add status output for better diagnostics
- Add comments for improved readability
- Return appropriate error codes on failure

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 06:02:32 +03:00
Abdulwahab Isam
b8af5dac53 pipa: add license header to xiaomi-keyboard.cpp
- Add standard LineageOS license header
- Add SPDX identifier
- Match copyright format with Java files (2023-2025)
- No functional changes to implementation

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:58:17 +03:00
Abdulwahab Isam
95d08296e3 pipa: peripheralmanager: update Android.bp and Manifest files for consistency
- Update copyright year to 2023-2025 to match other components
- Standardize license header format to SPDX
- No functional changes to build definitionspipa:

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:54:51 +03:00
Abdulwahab Isam
8a7c57d40a pipa: enhance StylusSettingsFragment with improved reliability
- Update copyright year to 2023-2025
- Standardize license header format to SPDX
- Add robust exception handling for fragment lifecycle
- Implement consistent logging with timestamps
- Add debug flag via system property
- Align TAG values with other components
- Fix null pointer access for preference switching

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:52:29 +03:00
Abdulwahab Isam
601d2fd23f pipa: update StylusSettingsActivity for consistency
- Update copyright year to 2023-2025
- Standardize license header format to SPDX
- Add class documentation with JavaDoc
- Add basic logging for activity creation
- Standardize TAG naming convention

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:51:23 +03:00
Abdulwahab Isam
d42cfa9e8d pipa: enhance PenUtils with improved logging and reliability
- Add robust exception handling for device operations
- Implement consistent logging with timestamps
- Use system properties for debug flag configuration
- Standardize naming conventions for constants
- Improve documentation with JavaDoc comments
- Update copyright year to 2023-2025

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:50:27 +03:00
Abdulwahab Isam
54616309b8 pipa: enhance BootCompletedReceiver with improved logging
- Add configurable debug flag via system property
- Implement consistent logging with timestamps
- Add exception handling for individual services
- Improve logging details for better diagnostics
- Update copyright year to match other components

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:49:04 +03:00
Abdulwahab Isam
3b7ef13276 pipa: improve keyboard Android integration
- Add robust exception handling throughout the codebase
- Implement state tracking to prevent redundant operations
- Enhance logging with timestamps and severity levels
- Improve device detection reliability
- Add detailed documentation with JavaDoc comments

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:47:29 +03:00
Abdulwahab Isam
865e43385b pipa: refactor: improve keyboard driver reliability and maintenance
- Reduce resource usage with smaller buffers and optimized code
- Add watchdog thread for automatic recovery from hangs
- Implement configuration file support for runtime settings
- Add dynamic keyboard detection with fallback path
- Improve connection handling with debouncing and backoff
- Enhance power management with proper sleep/wake handling
- Add proper signal handling and resource cleanup

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:42:47 +03:00
Abdulwahab Isam
a1919b0c02 pipa: remove Angle detection code from keyboard
too much logic and kinda overkill for our usecase

Signed-off-by: Abdulwahab Isam <abdoi94.iq@gmail.com>
2025-03-24 05:42:40 +03:00
Abdulwahab Isam
2e40c7e868 Revert "pipa: peripheralmanager: Set refresh rates for pen usage"
This reverts commit 268c593ac2.
2025-02-08 13:25:22 +03:00
KakatkarAkshay
268c593ac2 pipa: peripheralmanager: Set refresh rates for pen usage
* Pen only works on 60/120 Hz.
* Set Refresh rate to 120 Hz if the refresh rate in use is 90/144 Hz.

Change-Id: Ie7c5697b6f2a6da33cfcb94378499cbf6b3983bd
Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
2025-01-26 03:46:38 +03:00
Peter Kalauskas
c68237b0f5 pipa: peripheralmanager: Enable use_resource_processor for all sysui deps
This will make the build faster

Change-Id: I03a5248f2efca6f738ea72be35af3ec5eed087f7
2025-01-26 03:46:38 +03:00
Luka Panio
9938f176f0 pipa: peripheralmanager: Initial xiaomi-keyboard implementation
* xiaomi-keyboard handles keyboard and tablet angle calculation
 * This allows to correctly turn off the keyboard when flipped back.

Change-Id: I9287d2d4c2b0b3fc2ab40d4daf7577521ec8662a
2025-01-26 03:46:38 +03:00
Davide Garberi
cd9f1f5701 pipa: peripheralmanager: Rework pen settings
Change-Id: I95c338cf28969e5fbcafe985f080821574ec12e7
2025-01-26 03:46:38 +03:00
Luka Panio
81b53db4d5 pipa: peripheralmanager: Change pen disable value to 2
* We enable pen with cmd 18, that enables pen with id 2,
  so disable pen with id 2, rather than 0.

Change-Id: I00ba986898908abe95eed73db8369b617f96aa2b
2025-01-26 03:46:38 +03:00
Davide Garberi
c957c83ab9 pipa: peripheralmanager: Move xiaomi-pen binary to vendor
* Set properties consequently

Change-Id: Ifd30044c42ddf18b81cb6a05c0228c6f2946f3d7
2025-01-26 03:46:38 +03:00
luka177
2ff61846e5 pipa: peripheralmanager: Allow recognizing third party styluses
Change-Id: I3d4ba746126e0cb8d273cd62feb7fce4487c6f3b
2025-01-26 03:46:38 +03:00
Davide Garberi
d7dd8ca379 pipa: peripheralmanager: Don't specify the TOUCH_ID
* With our kernel implementation, this gets considered
   as the mode we want to write into, instead of the
   touch id like it's supposed to be

Change-Id: I7fdd89779f6daa1c75ec70599f5dea7ee2ff9fe8
2025-01-26 03:46:38 +03:00
Fabian Leutenegger
49d19762a9 pipa: Check intent type before starting peripheral manager service
Change-Id: I9e0f65d54d11be7f22687acde4b5129b4395acaa
2025-01-26 03:46:38 +03:00
Fabian Leutenegger
4ffd8bd262 pipa: Add Xiaomi Pen support to Xiaomi Peripheral Manager
Change-Id: I2698b754dd062d581f059456670639c71658f3fc
2025-01-26 03:46:38 +03:00
Fabian Leutenegger
bf214c5b8a pipa: Add Xiaomi Peripheral Manager
* right now keyboardutils just does disable the keyboard input device after boot

Change-Id: I7020b043e9e643d125e9641b18f3f0e71d8343b1
2025-01-26 03:46:38 +03:00