Compare commits

...

762 Commits

Author SHA1 Message Date
Damillora 1d8311df96 disable sms and voice because i'm building this for my wifi-only device 2022-06-23 16:00:25 +00:00
Pierre-Hugues HUSSON e96c8929e0
Merge pull request #309 from AndyCGYan/logkit-11
Kill QCOM LogKit app
2022-05-17 12:37:56 +02:00
Andy CrossGate Yan 4865734e0d Kill QCOM LogKit app
Known to bootloop UMX U696CL, and is useless anyway

Change-Id: Ibc8ed1228e0c0b71825d889498f2b1b4ebd59fa6
2022-05-17 10:11:40 +00:00
Andy CrossGate Yan e549a28273 Disable FP gestures for LG Stylo 7 5G
Change-Id: Ib1013963d41997e6ba5b6a645355beb8637d6f01
2021-12-03 13:31:50 +01:00
Pierre-Hugues Husson 7071ee8fbf Launch oplus-alert-slider only once, there is no need to restart it, and it would end up restarting forever on non-oplus device 2021-11-26 16:40:54 +01:00
Pierre-Hugues HUSSON 26d58a8562
Merge pull request #279 from Vgdn1942/patch-2
Use name instead device
2021-10-07 20:21:22 +02:00
Василий Ковалёв f514e1c231
Use name instead device
On some devices, device and name use different values, which prevents the safetynet test from passing
2021-10-07 20:56:42 +03:00
Pierre-Hugues HUSSON d0355b6dd5
Merge pull request #278 from notmyst33d/android-11.0
Fix screen recoder on Redmi Note 9
2021-09-04 22:25:59 +02:00
Myst33d 043a42433b Fix screen recoder on Redmi Note 9 2021-09-04 21:58:39 +06:00
Pierre-Hugues HUSSON e02d5eeb46
Merge pull request #277 from DarkJoker360/11-willow-hax
Audio fixes for Redmi Note 8/8T + cleanup
2021-09-03 12:53:02 +02:00
DarkJoker360 29b13b352a Cleanup audio hacks for Redmi Note 8/8T
* Already done by previous audio hacks.

Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
2021-09-03 12:49:32 +02:00
DarkJoker360 8f61607113 Enable audio fixes for Redmi Note 8T
Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
2021-09-03 12:49:00 +02:00
Pierre-Hugues HUSSON 5c1dae99cf
Merge pull request #272 from DarkJoker360/cheryl-bt-11
Fix bluetooth on cheryl
2021-08-26 14:21:36 +02:00
DarkJoker360 d8d6d29f36 Fix bluetooth on cheryl
Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
2021-08-26 13:48:14 +02:00
Pierre-Hugues HUSSON dfd02ff557
Merge pull request #271 from notmyst33d/android-11.0
Fix UI lags on Redmi Note 9
2021-08-20 19:41:16 +02:00
Myst33d 81af8dbf47
Fix UI lags on Redmi Note 9
Tested on MIUI 12.5.1.0 vendor
2021-08-20 17:36:52 +06:00
Pierre-Hugues Husson a76bab59db Forgot to request oplus alert slider code to be compiled 2021-08-11 11:09:13 +02:00
Pierre-Hugues Husson 642749e3a2 Add oppo-touchpanel for OnePlus Nord2 2021-08-10 19:09:11 -04:00
Pierre-Hugues Husson c117a13dad Oplus fingerprint HAL needs to set some persist.vendor properties
On stock rom, those properties' SELinux context is set in /system
To prevent SELinux conflicts, just allow all vendor props
2021-08-10 17:23:50 -04:00
Pierre-Hugues Husson 2fc868bc4a New Oplus way to get project number 2021-08-10 17:23:42 -04:00
Pierre-Hugues Husson 2b6440d5ac Need to set selinux context for oplus hal too 2021-08-10 16:11:03 -04:00
Pierre-Hugues HUSSON 5beb9d0966
Merge pull request #270 from hwti/patch-2
Make phh-securize.sh work with current Magisk
2021-08-09 20:14:12 +02:00
Pierre-Hugues Husson 2d96bc5545 Add ugly support for OnePlus alert slider (tested on OP Nord2) 2021-08-09 19:50:29 +02:00
Loïc Yhuel b0ddecfc39
Make phh-securize.sh work with current Magisk
Magisk 21.0 changed the mount path, we have to get it with "magisk --path" now.
This is used to get where the system partition is mounted.

The phh-su bind-mount is on /system/xbin/su, even with Magisk.
But we still have to unmount it, in order to remove the empty "su" file on the system partition.
2021-08-09 05:01:46 +02:00
Pierre-Hugues Husson f0cac6df49 Add MTK IMS services 2021-08-08 21:37:14 +02:00
Pierre-Hugues Husson 17976104b2 Typo, fixup of 90fe6e4b, Thanks Sarthak 2021-08-08 20:22:34 +02:00
Pierre-Hugues Husson 90fe6e4b62 Include new OPPO Hal s/vendor.oppo/vendor.oplus/g 2021-08-08 20:15:33 +02:00
Pierre-Hugues HUSSON 1d31a4c127
Merge pull request #269 from FlokoROM-GSI/android-11.0-renoir
Fix sound for Xiaomi Mi 11 Lite 5G
2021-07-31 17:55:33 +02:00
AndroPlus 663cbedfee Fix sound for Xiaomi Mi 11 Lite 5G 2021-07-31 18:29:47 +09:00
Pierre-Hugues HUSSON c9d731c0f1
Merge pull request #267 from bibarub/android-11.0
use 'a2dp' audio module instead of 'bluetooth_qti' when needed
2021-07-05 20:44:41 +02:00
bibarub 417839ab4a
use 'a2dp' audio module instead of 'bluetooth_qti' when needed 2021-07-05 21:39:10 +03:00
Pierre-Hugues Husson e9d96cc60e Alternate audio policy for Samsung devicese 2021-06-07 13:43:33 -04:00
Pierre-Hugues Husson 0669df7523 When selecting alternate audio policy, check if we can grab the policy made for QSSI 2021-06-07 13:41:21 -04:00
Pierre-Hugues Husson 5e6061d5fd On ZF8, take stock rom audio policy, rather than the worse ones intended for GSI or QSSI 2021-06-07 12:47:49 -04:00
Pierre-Hugues Husson 2f79cf8662 Don't empty /vendor/etc/audio when very full, when prop is changed too 2021-06-07 12:33:35 -04:00
Pierre-Hugues Husson 475de0067d Some devices have a lot of stuff in /vendor/etc/audio, not just a CAF audio policy, like ZF8 has their whole vendor audio configuration there. Dont empty this dir in that case 2021-06-03 16:44:44 -04:00
Pierre-Hugues Husson 7a9ce0e848 Add support for treble app to control HCT touchscreen gestures HAL 2021-06-03 16:09:38 -04:00
Pierre-Hugues HUSSON 4f6b0d28a7
Merge pull request #264 from eremitein/treble-app-call
add treble app to the allow-in-power-save list
2021-05-30 23:00:52 +02:00
Victor Bo 2eb8896467 add treble app to the allow-in-power-save list 2021-05-30 16:57:31 -04:00
Pierre-Hugues HUSSON 438255bb25
Merge pull request #250 from sarthakroy2002/patch-1
Fix Brightness, FP and Headphone jack issue of Realme Narzo 20 and Re…
2021-05-13 10:07:09 +02:00
Sarthak Roy d06e747b50
Fix Brightness, FP and Headphone jack issue of Realme Narzo 20 and Realme X7 Pro 5G 2021-05-13 12:16:42 +05:30
Pierre-Hugues HUSSON e5c0da0939
Merge pull request #249 from R0rt1z2/patch-1
BQ Aquaris M10 HD fixes
2021-05-11 19:19:09 +02:00
Roger Ortiz 57d109cbf2 freezerhd: fix screen orientation 2021-05-11 20:01:31 +02:00
Roger Ortiz 3fbee899b6
freezerhd: ignore audio effects as well 2021-05-11 17:58:54 +01:00
Pierre-Hugues Husson 07e17110ca On some Oppo devices, we can NOT load firmware. Oppo engineers realized that and kept the line in rc script, but simply commented it out. so check this 2021-05-11 06:20:40 -04:00
Pierre-Hugues HUSSON 80281b21ab
Merge pull request #248 from TTTT555/patch-2
begonia: Drop deprecated props
2021-05-02 18:46:09 +02:00
TTTT555 815a378701
begonia: Drop deprecated props
* these fixes are not needed since A10/A11 vendor (and only cause errors)
2021-05-02 18:15:07 +02:00
Pierre-Hugues Husson 659278a853 Stop whitelisting Xiaomi devices manually. The kl name is pretty explicit about fingerprint sensor, we should be safe 2021-05-01 14:17:43 +02:00
Pierre-Hugues HUSSON aef3ba2919
Merge pull request #246 from gsuzeda/patch-2
Update rw-system.sh
2021-04-30 10:11:56 +02:00
Uzeda cebf48f92f
Update rw-system.sh 2021-04-30 03:50:36 -03:00
Pierre-Hugues Husson 8d45b8ea38 [teracube2e] Add support for dt2w 2021-04-16 13:27:41 +02:00
Pierre-Hugues HUSSON 24c3a48b98
Merge pull request #243 from 00p513-dev/android-11.0
Add amyROM makefile
2021-04-15 16:24:58 +02:00
Pierre-Hugues HUSSON d02b16585a
Merge pull request #242 from KaMyKaSii/patch-1
Poco M3 fix fingerprint gesture
2021-04-09 20:20:15 +02:00
Pierre-Hugues HUSSON 9a7fdc991b
Merge pull request #244 from PeterCxy/patch-unihertz-keylayout
add keylayout for Unihertz devices
2021-04-08 21:47:19 +02:00
Peter Cai aa0d782b8c add keylayout for Unihertz devices
* Unihertz devices have a dedicated PTT button, which I mapped to
  CAMERA, making it useful (kind of) by default and remappable via
  third-party apps.
* Additionally, declare capacitive buttons as VIRTUAL so that vibration
  is applied when they are pressed.
2021-04-08 20:21:57 +08:00
Amy Grace e8d7cb9255 Add amyROM makefile 2021-04-07 09:17:24 +01:00
Pierre-Hugues Husson 91783c3bde Clean up ota.sh for better lifecycle (supports exclusively dynamic partitions) 2021-03-28 18:57:44 +02:00
Pierre-Hugues Husson d9140dbd8d [lptools] partition was freed, thus name was zero-ed, leading to a partition with an empty name rather than expected dst name 2021-03-28 18:57:09 +02:00
Pierre-Hugues Husson 00d5b05ee9 Samsung has another path for alternate audio policy 2021-03-28 18:56:14 +02:00
Pierre-Hugues Husson 6d5747d010 Add a fake audio policy 2021-03-28 18:55:25 +02:00
Pierre-Hugues Husson 29480cdbb8 Declare all color modes available, they dont seem to depend much on hardware capabilities 2021-03-21 22:56:46 +01:00
Pierre-Hugues Husson 926613d464 [simg2img_simple] Abandon splice if it's too slow. 2021-03-20 21:55:07 +01:00
Pierre-Hugues Husson abec25d226 Pump up lptools
- Add `free` command to know how big a partition can be created
- `create` command now properly return errors
- Add lptools_static, suitable for use from recovery
- Add clear-cow and unlimited-group to help expand current group's
  beyond original expectations
2021-03-20 19:59:15 +01:00
Pierre-Hugues Husson 29154150b0 Change brand name. This works around Samsung limitations on sensor hal 2021-03-20 19:59:15 +01:00
KaMyKaSii dcbc76966a
Poco M3 fix fingerprint gesture 2021-03-19 15:49:08 -03:00
Pierre-Hugues HUSSON 03b1c9d3d8
Merge pull request #241 from notsyncing/android-11.0
NX669J: Use audio config from QSSI
2021-03-16 17:29:59 +01:00
notsyncing d190d02990 NX669J: Use audio config from QSSI
AOSP doesn't care about QSSI, and it will always try to load from
/vendor/etc/audio/sku_{ro.boot.product.vendor.sku}, while the stock ROM
loads from /vendor/etc/audio/sku_{ro.boot.product.vendor.sku}_qssi.

This fixes speaker and headphone audio for Nubia Red Magic 6.
2021-03-16 19:40:45 +08:00
Pierre-Hugues Husson 2057f5d25a Disable fdsan for real. Setting it to 0 won't disable it, because setting it to 0 will set it to DEFAULT value, which is fatal in userdebug. So best we can do to disable it is to set it to warn_once. See bionic's android_fdsan_set_error_level_from_property 2021-03-11 16:26:52 +01:00
Pierre-Hugues Husson 04ee9f055e Remove wrongly included debugging stuff 2021-03-08 18:39:54 +01:00
Pierre-Hugues HUSSON 23baa924dc
Merge pull request #239 from VDavid003/android-11.0
Fix vendor hostapd detection for manifest fragments
2021-03-08 13:48:13 +01:00
VDavid003 a3f96351d7
Fix vendor hostapd detection for manifest fragments
This fixes tethering on phones that have hostapd defined in a manifest fragment
2021-03-08 13:32:33 +01:00
Pierre-Hugues HUSSON f7e7a1607c
Merge pull request #238 from DarkJoker360/11-2btnnav
Build NavigationBarMode2ButtonOverlay
2021-03-06 11:13:57 +01:00
DarkJoker360 f8ff2ea2ad Build NavigationBarMode2ButtonOverlay
This got removed from PRODUCT_PACKAGES in frameworks/base, but it seems
like it still exists.

Change-Id: I8fe80c9c5a386ae1877f7c117ddc76ff366304a3
2021-03-06 09:33:22 +01:00
Pierre-Hugues HUSSON d341ec23ff
Merge pull request #236 from sarthakroy2002/android-11.0
Fixed Bugs of Realme 7, Realme 6i(EU) and Realme Narzo 10
2021-03-05 15:51:16 +01:00
Sarthak Roy 6b93fc5f03
Fixed Bugs of Realme 7, Realme 6i(EU) and Realme Narzo 10 2021-03-05 19:19:56 +05:30
Pierre-Hugues Husson a52cbb93d5 Revert "Fix not booting on A6+"
This reverts commit 33d1b1c196.
2021-03-05 14:34:49 +01:00
Pierre-Hugues Husson b0b0b7cfe2 Revert "typo"
This reverts commit c1ef009983.
2021-03-05 14:34:35 +01:00
Pierre-Hugues Husson c1ef009983 typo 2021-03-05 14:19:55 +01:00
Pierre-Hugues HUSSON 45a730c9c3
Merge pull request #235 from roynatech2544/android-11.0
Fix not booting on A6+
2021-03-04 08:59:28 +01:00
roynatech2544 33d1b1c196
Fix not booting on A6+ 2021-03-04 16:57:50 +09:00
Pierre-Hugues HUSSON 27d759a485
Merge pull request #233 from DarkJoker360/11-emui9-fp2
Address more Huawei fp denials
2021-03-01 10:22:02 +01:00
DarkJoker360 9e81647de7 Address more Huawei fp denials 2021-03-01 09:58:41 +01:00
Pierre-Hugues Husson 61d163657a Disable secondary watchdogs.
AOSP's watchdogd doesn't support multiple watchdogs.
This shouldn't be an issue, since AOSP GSI obviously doesn't support it
and AOSP GSI is part of certification.
HOWEVER, some people use modified kernel/vendors that may break such
assumptions. Anyway we can just disable it.

See https://github.com/phhusson/treble_experimentations/issues/1730#issuecomment-784222396
2021-02-23 15:00:54 +01:00
Pierre-Hugues Husson b74ad8ea7e Rename all calls to resetprop to resetprop_phh to prevent conflict with Magisk, see d8056f8032 2021-02-22 10:04:28 +01:00
Pierre-Hugues HUSSON f87c653336
Merge pull request #232 from eremitein/fixgms
fix gapps build
2021-02-16 08:33:44 +01:00
Victor Bo 1057669e03 fix gapps build
remove commit trash after
  b2eea56e6c

  FAILED:
  build/make/core/aapt2.mk:33: error: overriding commands for target
  `out/target/common/obj/APPS/SettingsProvider__auto_generated_rro_product_intermediates/flat-res/vendor/partner_gms/overlay/gms_overlay/frameworks/base/packages/SettingsProvider/res/values_defaults.arsc.flat',
  previously defined at build/make/core/aapt2.mk:27
  23:03:05 ckati failed with: exit status 1
2021-02-16 00:37:28 -05:00
Pierre-Hugues HUSSON 57bec6f2ca
Merge pull request #231 from eremitein/adb_selinux
Adb selinux
2021-02-15 19:00:33 +01:00
Victor Bo d6aed01c48 sepolicy/init: fix adb in some cases
logs:
  02-06 17:28:44.560     1     1 I auditd  : type=1400
  audit(0.0:11): avc: denied { read } for comm="init"
  name="adbd" dev="mmcblk0p31" ino=11 scontext=u:r:init:s0
  tcontext=u:object_r:adbd_exec:s0 tclass=lnk_file permissive=0

  thanks HamiDo for hotfix
2021-02-15 12:54:48 -05:00
Victor Bo 19d8a296fa sepolicy/treble_app: add rule fix cam2api option
logs:
      17 00:47:48.796     1     1 W /system/bin/init: type=1107
      audit(0.0:357): uid=0 auid=4294967295 ses=4294967295
      subj=u:r:init:s0 msg='avc: denied { set } for
      property=persist.vendor.camera.eis.enable pid=4411 uid=1000
      gid=1000 scontext=u:r:system_app:s0
      tcontext=u:object_r:vendor_default_prop:s0 tclass=property_service
      permissive=0'

      01-17 00:47:48.796     1     1 W /system/bin/init: type=1107
      audit(0.0:356): uid=0 auid=4294967295 ses=4294967295
      subj=u:r:init:s0 msg='avc: denied { set } for
      property=persist.vendor.camera.HAL3.enabled pid=4411 uid=1000
      gid=1000 scontext=u:r:system_app:s0
      tcontext=u:object_r:vendor_default_prop:s0 tclass=property_service
      permissive=0'
2021-02-15 12:53:43 -05:00
Pierre-Hugues HUSSON 9868877f23
Merge pull request #229 from nitanmarcel/patch-1
Add Redmi/joyeuse to changeKeyLayout
2021-02-11 11:15:46 +01:00
Pierre-Hugues Husson b2eea56e6c Include usb.host package feature. This shouldnt arm devices without actual hardware support 2021-02-09 16:01:58 +01:00
Nitan Alexandru Marcel e936f0b83a
Add Redmi/joyeuse to changeKeyLayout
Fixes random touches on Redmi Note 9 Pro `joyeuse` when fingerprint is pressed
2021-02-09 12:36:12 +02:00
Pierre-Hugues Husson 7afda0d79f Fix build for s/google/partner_gms/ 2021-02-05 11:39:34 -05:00
Pierre-Hugues Husson 3d054e214d Add olive and angelica for Xiaomi fingerprint uinput blocklist 2021-02-02 22:04:42 +01:00
Pierre-Hugues Husson 9e6e2b6556 Mute console for everyone, not just secure usecase 2021-02-02 22:03:11 +01:00
Pierre-Hugues Husson 72c62260b9 Fix backlight on some Samsung devices
Some Samsung Q vendor devices have HWC rather than lights hal control.
In those cases, backlight is controlled through another SELinux context.
We used to correct this SELinux context for all devices, however this is
no longer needed, and actually breaks those devices.

So, change SELinux context, only if uid/gid is wrong
2021-01-30 22:59:23 +01:00
Pierre-Hugues HUSSON c7438a5be6
Merge pull request #227 from kzubec/patch-2
Update rw-system.sh
2021-01-22 15:40:38 +01:00
kzubec 36881fc8a6
Update rw-system.sh 2021-01-22 16:45:55 +03:00
Pierre-Hugues HUSSON 09baacad99
Merge pull request #225 from DarkJoker360/11-emui9-fp
Address Huawei fingerprint denials
2021-01-22 10:53:15 +01:00
DarkJoker360 49a4d5ce06 Address Huawei fingerprint denials
* Fixes fingerprint enrollment issues on P vendor devices.
2021-01-22 10:46:46 +01:00
Pierre-Hugues Husson 43f324824a Fix video crashing on apps targetting Android 11, on some Mediatek devices (like Redmi 9) 2021-01-21 10:00:15 -05:00
Pierre-Hugues Husson aae160672f Add a totally manual ADB, triggerable using /cache/phh-adb. This should help debugging early startup issues 2021-01-19 23:46:40 +01:00
Pierre-Hugues Husson e444a5f575 Disable fdsan by default. This is already disabled by default on user build. Some HALs do not work properly with fdsan 2021-01-10 22:26:15 +01:00
Pierre-Hugues HUSSON 43f0b25585
Merge pull request #220 from JensBee/patch-1
Scan in /odm/etc/vintf for fingerprint sensor data
2021-01-08 13:12:49 +01:00
Pierre-Hugues Husson 0a0d3a10b2 Add persist.sys.phh.restart_ril to automatically restart MTK RIL. Also toggling it on will restart QC RIL 2020-12-29 20:27:25 +01:00
Jens Bertram a853420626
Scan in /odm/etc/vintf for fingerprint sensor data
The manifest.xml for specifying the fingerprint sensor for the Fairphone 3 (SW-version 8901.3.A.0066.20201119) is located at /odm/etc/vintf/. This path is currently not scanned for manifest files. This proposed change includes this missing path an enables to use the fingerprint sensor on the FP3.
2020-12-17 21:55:49 +01:00
Pierre-Hugues HUSSON e63e4d7cd9
Merge pull request #218 from PeterCxy/patch-qin-2-pro-sensors
rw-system: disable sensor direct report for Qin 2 Pro
2020-12-16 14:03:07 +01:00
Peter Cai d93e046538 rw-system: disable sensor direct report on SPRD Pie vendor 2020-12-16 21:01:15 +08:00
Pierre-Hugues HUSSON 8e6f252902
Merge pull request #219 from PeterCxy/patch-sprd-ims
sepolicy: add spreadtrum IMS services
2020-12-16 13:47:48 +01:00
Peter Cai 70950fd8ee sepolicy: add spreadtrum IMS services 2020-12-16 19:42:09 +08:00
Pierre-Hugues HUSSON 93019de565
Merge pull request #216 from siddhrsh/patch-2
Added Realme C3 brightness& audio jack
2020-12-12 11:02:37 +01:00
Pierre-Hugues HUSSON a19ac6062f
Merge pull request #215 from siddhrsh/patch-1
Realme C2 Headphones jack fix
2020-12-12 11:01:30 +01:00
Siddhesh Koyande d07aa9e60c
Added Realme C3 brightness& audio jack 2020-12-12 10:49:49 +05:30
Siddhesh Koyande c756d26c2b
Realme C2 Headphones jack fix 2020-12-12 08:27:23 +05:30
Pierre-Hugues Husson 8ff15241fd Disable root console on uart, and kernel logs on uart when secure 2020-12-11 14:51:01 +01:00
Pierre-Hugues Husson 843c0ec80a Add persist.sys.phh.backlight.scale to control brightness scale from treble app 2020-12-06 00:58:01 +01:00
Pierre-Hugues Husson 30071d0420 Use ext4 share duplicate blocks, it is sadly needed to attain acceptable partition size, because of duplication made by apexes 2020-12-05 22:21:06 +01:00
Pierre-Hugues Husson 5607a9be21 Use dev/input for jack detection on Realme C11 2020-11-30 11:00:38 +01:00
Pierre-Hugues Husson f121aba763 Allow more blockdev --setrw 2020-11-30 11:00:38 +01:00
Pierre-Hugues Husson 30b84072fc Allow treble_app to set persist.vendor.vilte_support (to 0) 2020-11-29 09:36:05 -05:00
Pierre-Hugues Husson 147dca859c Realme C11 has same quirks for dt2w and brightness as previous Realme MTK devices 2020-11-29 08:08:50 -05:00
Pierre-Hugues Husson 3489a71cf2 Allow init to create system_file symlinks for A-only, see https://github.com/phhusson/treble_experimentations/issues/1553 2020-11-08 13:13:10 +01:00
Pierre-Hugues Husson 6ce1b9108d Galaxy S9 is stupid and still dont understand that android version/spl isnt relevant, so cheat android version/spl for them 2020-11-08 00:36:09 +01:00
Pierre-Hugues Husson 28b4d559a6 Set a property to find focaltech gesture node 2020-10-26 22:46:16 +01:00
Pierre-Hugues Husson d1a638f4f8 Allow treble_app to access mediatek radio hal to detect it 2020-10-26 22:45:37 +01:00
Pierre-Hugues Husson 0ed42b1d02 Allow treble app to set more props 2020-10-25 21:11:27 +01:00
Pierre-Hugues Husson 018f36087d uevent cmd: allow filtering events 2020-10-25 21:11:27 +01:00
Pierre-Hugues Husson 1450230c31 Make rw-system debug easier, but just having to create /cache/phh-log (obviously works only if device has a cache partition), and having perms make it accessible from system app (treble app) 2020-10-25 21:11:27 +01:00
Pierre-Hugues HUSSON 1edc6980c7
Merge pull request #212 from tboy1991/android-11.0
Add redmi9 lancelot/galahad brightness and fingerprint fix
2020-10-18 21:41:07 +02:00
tboy1991 0b075d62bf Update rw-system.sh 2020-10-17 16:34:18 +02:00
Pierre-Hugues Husson c67aa14ca5 Add android.software.controls to get controls in power long-press 2020-10-14 17:51:01 +02:00
tboy1991 dd952c5f1b Update rw-system.sh
Adds redmi9 lancelot/galahad brightness and fingerprint as enter fix
2020-10-13 18:48:21 +02:00
Pierre-Hugues Husson 2515e7d58a Fix CAF audio policy on non-boot 2020-10-13 17:19:48 +02:00
Pierre-Hugues Husson ab62dcf481 On Allview V3 Viper, mnld (who handles GPS) crashes with double-mutex unlock. Fix this by forcing it to older SDK 2020-10-06 19:55:11 +02:00
Pierre-Hugues Husson 95bcf66d67 Some devices require their vendor mounted to /persist even if fstab says otherwise
See https://github.com/phhusson/treble_experimentations/issues/668
2020-10-05 22:13:44 +02:00
Pierre-Hugues HUSSON bfa3c9b7dc
Merge pull request #207 from dev-harsh1998/android-11.0
treble: vndk: restart the surfaceflinger
2020-10-04 10:19:16 +02:00
Harshit Jain dcf70913db
treble: vndk: restart the surfaceflinger
* not surfacecflinger
2020-10-04 12:30:36 +05:30
Pierre-Hugues Husson 78f5247606 Fix A2DP on some Qualcomm Q vendors by disable A2DP offload harder
Also there is a mismatch between framework which expects property to be
false/true and treble app setting it to 0/1
2020-10-02 20:04:12 +02:00
Pierre-Hugues Husson 7435a2a66e Mark fingerprint sensor as a secure biometric auth, so that fingerprint sensor can be used in apps 2020-10-02 11:56:34 +02:00
Pierre-Hugues Husson 7662a1675c Disable HWC presentOrValidate on vndk 26/27 2020-09-30 22:38:44 +02:00
Pierre-Hugues HUSSON 7f176889ee
Merge pull request #206 from SamarV-121/k
rw-system: Update extra vndk dir path
2020-09-30 11:57:22 +02:00
ѕαмαя νιѕρυтє b79124f41b rw-system: Update extra vndk dir path
Signed-off-by: SamarV-121 <samarvispute121@gmail.com>
2020-09-30 09:55:09 +00:00
Pierre-Hugues Husson 41f0817f3f Up vendor minijail override, using vndk v28 minijail 2020-09-29 10:45:45 +02:00
Pierre-Hugues Husson bbee56d39f ROG Phone III has an additional C2 in vendor. It requires updated seccomp policy 2020-09-27 20:12:39 +02:00
Pierre-Hugues Husson c18b157a8d libsoftkeymasterdevice.so is a new path for vndk v26 2020-09-27 20:12:09 +02:00
Pierre-Hugues Husson 0ced2d3486 Fix dynamic ro.sf.lcd_density being ignored
On Qualcomm devices, ro.sf.lcd_density is set by a shell script in
/vendor, which will be called after surfaceflinger is started.
Thus surfaceflinger won't read any value, and will consider the default
value which is 213.

To fix this, restart surfaceflinger when ro.sf.lcd_density is changed.
2020-09-27 20:00:44 +02:00
Pierre-Hugues Husson e08b947cc2 [twrp.sh] List usb controlers instead of fixing address 2020-09-27 19:58:40 +02:00
Pierre-Hugues Husson 6acd9f4763 Fix oppo-fp build 2020-09-27 19:57:46 +02:00
Pierre-Hugues Husson 510e08cefd Fix lptools build for Android 11 2020-09-27 19:57:32 +02:00
Pierre-Hugues Husson 5bcb2e09a8 Now an android.hardware.healthd is required. Include healthd which provides a backup implementation 2020-09-27 19:57:19 +02:00
Pierre-Hugues Husson 8bbe19ca57 Now overlays are done as RRO. DEVICE overlay will be in /vendor/overlay which we dont control. Change this to PRODUCT overlay so our overlay is taken into account 2020-09-27 19:56:20 +02:00
Pierre-Hugues Husson 1c3f1d6e4e in-tree VNDK integration is dead, it will be out-of-tree 2020-09-27 19:55:23 +02:00
Pierre-Hugues Husson 7c0c6c918c Disable EXT4 Share "feature" (this was already disabled in Android 10, but not on Android 11) 2020-09-11 10:33:49 +02:00
Pierre-Hugues Husson 0ce5feb194 This flag was added by mistake it's not needed (since it works on other targets) and prevents building Android 11 2020-09-11 10:33:20 +02:00
Pierre-Hugues Husson 6e496dafb0 Force privapp permissions thingy to "log". It s not like we care about this feature 2020-08-18 16:56:53 +02:00
Pierre-Hugues Husson 81c17b3aa3 Add Realme 6 for lcd brightness & fingerprint tricks 2020-08-13 15:51:42 +02:00
Pierre-Hugues Husson 6428935728 Fake Oppo engineer app instead of camera app, and force non-gsi Camera mode 2020-08-05 20:38:43 +02:00
Pierre-Hugues Husson d26d561dba Add fingerprint gestures on zf6 2020-08-05 20:38:43 +02:00
Pierre-Hugues HUSSON 4d3d3b1c08
Merge pull request #200 from darkestDark/android-10.0
libminijail.so error, check only vndk to mount
2020-08-05 20:09:12 +02:00
darkestDark 9221314a7e
libminijail.so error
check for vndk only to mount
2020-08-05 20:04:01 +02:00
darkestDark b88e2c8900
libminijail.so error
check for vndk only to mount
2020-08-05 20:02:24 +02:00
Pierre-Hugues HUSSON 016e9918fc
Merge pull request #197 from kjssad/add-d2tw-rmx1941
Add RMX1941 DT2W fix
2020-07-02 18:41:20 +02:00
kjssad 4134ef2653
Add RMX1941 DT2W fix 2020-07-02 16:28:48 +00:00
Pierre-Hugues HUSSON edd1355309
Merge pull request #193 from DarkJoker360/android-10.0
Address charger denials on Huawei devices
2020-06-24 22:06:01 +02:00
Pierre-Hugues Husson 9800e43980 Some devices have mask_brightness with proper selinux, wrong perms... 2020-06-24 11:11:02 +02:00
Pierre-Hugues Husson c0ff9f49f0 Yet another c2 broken device 2020-06-23 21:40:55 +02:00
DarkJoker360 4388860aed Address charger denials on Huawei devices
Thanks to phh and Hamido for the help
2020-06-23 16:45:08 +02:00
Pierre-Hugues Husson d4ecf50aa0 Add libstagefright_foundation from vendor to vndk hack for Q vendors as well 2020-06-22 18:12:17 +02:00
Pierre-Hugues Husson 01390142b9 Autodetect best group, not everyone uses main 2020-06-21 00:21:52 +02:00
Pierre-Hugues Husson 97b340689d Add Redmagic 5G DT2Z KL 2020-06-20 20:11:04 +02:00
Pierre-Hugues Husson 46c5eb1273 Don't enable CPU feature runtime detection for everyone
Sadly CPUs impacted with needs_a53_835769_fix/needs_a53_843419_fix can't use runtime codepath
Enable CPU feature runtime detection on known-problematic CPUs
2020-06-20 00:31:29 +02:00
Pierre-Hugues Husson 9bff86b3a9 Enable ART automatic CPU feature detection. Also fix some devices using a wrong kryo name 2020-06-20 00:19:13 +02:00
Pierre-Hugues Husson 2e19ed17dc Try to fix a race condition where init.svc could /not/ be restarting at the time of checking 2020-06-18 20:24:21 +02:00
Pierre-Hugues Husson 0f3b53a395 Include "Google" app to fix "Hey, Google" 2020-06-18 19:59:12 +02:00
Pierre-Hugues Husson 0c42bbf8c4 Switch to SW keymaster on Moto One Macro, and enable devinputjack 2020-06-18 15:00:14 +02:00
Pierre-Hugues Husson 4943b6a93e Fix minijail issue on pie vendors 2020-06-17 16:34:17 +02:00
Pierre-Hugues Husson 51dc96a900 Another ccodec=0... 2020-06-17 13:36:50 +02:00
Pierre-Hugues Husson 282728cf70 Fix denial preventing Moto One Macro to boot, because init cant mount /mnt/product/persist 2020-06-17 13:36:15 +02:00
Pierre-Hugues Husson 33afc851c4 Yet another sick C2 MTK... 2020-06-11 18:02:21 +02:00
Pierre-Hugues HUSSON e530d6a7e5
Merge pull request #191 from AndyCGYan/sepolicy-phhsu
Quick fixup
2020-06-11 16:19:47 +02:00
Andy CrossGate Yan d357dec2d4 Quick fixup
Building is different from on-the-fly testing
2020-06-11 13:59:47 +00:00
Pierre-Hugues HUSSON 2c023e8446
Merge pull request #190 from AndyCGYan/sepolicy-phhsu
More rights
2020-06-11 15:39:09 +02:00
Andy CrossGate Yan 44fe1f36aa More rights
"Here's Sammy!"
2020-06-11 21:34:36 +08:00
Pierre-Hugues HUSSON 434e42303e
Merge pull request #189 from R-L-T-Y/android-10.0-picasso
xiaomi at it again! changes for redmi picasso
2020-06-09 09:02:22 +02:00
R-L-T-Y bffd528e03
xiaomi at it again! changes for redmi picasso 2020-06-09 13:12:45 +08:00
Pierre-Hugues Husson 0666c17ef1 moto fp gestures for fpc 2020-06-08 18:51:33 +02:00
Pierre-Hugues Husson 179f0cf042 Give more headroom on arm_a 2020-06-07 13:21:02 +02:00
Pierre-Hugues Husson 32ca6fcb5f Some Pie vendor are also affected by minijail issue 2020-06-06 19:33:00 +02:00
Pierre-Hugues Husson 936ed40b56 Some Samsung dt2w use other key value 2020-06-06 19:33:00 +02:00
Pierre-Hugues Husson 2874f15cf2 Add capacitive back and recent keys for Samsung 2020-06-06 18:41:52 +02:00
Pierre-Hugues Husson 4bd26f7fc7 Some Samsung devices also have HOME as gpio key 2020-06-06 18:24:24 +02:00
Pierre-Hugues Husson 506be53b02 Add ota.sh to (try to) OTA 2020-06-06 18:12:37 +02:00
Pierre-Hugues Husson 545be46423 Allow phh-su to blockdev --setrw dm partitions to mount / read-write on logical partition devices 2020-06-06 13:13:25 +02:00
Pierre-Hugues Husson 2295229a28 Expose CAF resolution switching (tested on RazerPhone) 2020-06-05 20:34:22 +02:00
Pierre-Hugues Husson 66108419f9 Tell realme fingerprint dirver we are running unlocked bootloader 2020-06-05 17:43:52 +02:00
Pierre-Hugues Husson 65af98b518 Detect looping mediacodec earlier 2020-06-03 20:21:50 +02:00
Pierre-Hugues Husson 7576b8f0fe Fix mediacodec on vndk-27
Since android-10.0.0_r37, mediacodec seccomp policy now has two
includes. In AOSP 8.1, minijail is vendor-side.
AOSP 8.1's minijail has a bug, which can't read multiple includes.
All of this together means mediacodec is broken.

This fixes it by overriding vendor's minijail to a working one, in the
hope that vendors didn't change anything in their own minijail

https://issuetracker.google.com/issues/158068181
2020-06-03 16:52:59 +02:00
Pierre-Hugues Husson 5c712afafa Add FOD for Vsmart Live 2020-06-03 14:13:33 +02:00
Pierre-Hugues Husson 00b3c4399a Disable integration for gapps go too, to remove white screen in setup wizard 2020-06-03 12:31:07 +02:00
Pierre-Hugues Husson ff835cbd53 Add motorola fingerprint navigation keymap for moto one action 2020-06-02 23:04:09 +02:00
Pierre-Hugues Husson 0359b91442 Add persist.sys.phh.vsmart.dt2w for vsmart double-tap-to-wake 2020-06-01 19:29:55 +02:00
Pierre-Hugues Husson afb17027d2 Add a tablet SoC in ccodec 0 band 2020-05-30 16:38:56 +02:00
Pierre-Hugues Husson 34170ee087 vendor policy requires a _29_0 type to apply 2020-05-29 12:52:56 +02:00
Pierre-Hugues Husson 089d3c34ca Add netflix ID for Redmi Note 9S 2020-05-29 10:13:16 +02:00
Pierre-Hugues Husson d917563900 Add smcinvoke dev type. Should fix widevine on Redmi Note 9S 2020-05-29 10:12:28 +02:00
Pierre-Hugues Husson 05b863b07a Add netflix id on Mi9, this gives 720p/1080p when securized 2020-05-28 11:44:25 +02:00
Pierre-Hugues Husson de8d6e38d3 Add talkback (space has been freed by removing FilesGoogle) 2020-05-26 14:14:16 +02:00
Pierre-Hugues Husson 35f64c5260 Also remove FilesGoogle 2020-05-26 13:49:44 +02:00
Pierre-Hugues Husson 4aad458648 Remove gmsexpress-set overlay
gmsexpress enables com.android.theme.icon.squircle
we want circle by default
2020-05-25 14:10:37 +02:00
Pierre-Hugues Husson 9a6dacedfc Curtana is redmi, no longer xiaomi 2020-05-25 13:45:22 +02:00
Pierre-Hugues Husson 05b0386382 <2GB arm64_ab gapps system 2020-05-24 22:07:19 +02:00
Pierre-Hugues Husson 1d86604109 Curtana is just as broken as other Xiaomi devices 2020-05-24 20:18:20 +02:00
Pierre-Hugues Husson 874d0d8b47 Disable GMS demo SetupWizard integration because it is broken
It references com.android.setupwizard.FLOW_CHOICE, which is no longer
supported by the SetupWizard
2020-05-24 20:12:23 +02:00
Pierre-Hugues Husson 5a29d9607e Alternate audio profile was broken?!? 2020-05-24 20:03:14 +02:00
Pierre-Hugues Husson 9f53b904c5 Force bluetooth library to be AOSP's
Some vendors set ro.bluetooth.library_name.
This shouldn't matter because GSIs targetting Pie ignore those
properties from vendor.
Sadly we're targetting Oreo, so vendor can set it.

https://github.com/AndroidDumps/redmi_curtana_dump/blob/qssi-user-10-QKQ1.191215.002-V11.0.4.0.QJWINXM-release-keys/system/system/build.prop#L167
https://github.com/AndroidDumps/redmi_curtana_dump/blob/qssi-user-10-QKQ1.191215.002-V11.0.4.0.QJWINXM-release-keys/vendor/build.prop#L103
2020-05-24 19:26:19 +02:00
Pierre-Hugues Husson 7a830b3d3e gmsexpress-based gapps-go. arm64_ab fits in 2GB. arm_a doesn't fit on Redmi Go though 2020-05-24 19:26:19 +02:00
Pierre-Hugues Husson bcb48d0ba8 arm a is even tighter, so give only 8MB headroom 2020-05-24 19:26:19 +02:00
Pierre-Hugues HUSSON 46b853461c
Merge pull request #182 from fourofspades/Issue_#1141_TabletMode
Added shell script to remove telephony.
2020-05-23 11:47:41 +02:00
Pierre-Hugues Husson 258e730ad7 Reduce reversed size from 64MB to 32MB 2020-05-21 17:12:38 +02:00
Pierre-Hugues Husson 3d84e3da97 Also set chmod/chown for fod samsung files 2020-05-21 17:12:38 +02:00
Pierre-Hugues HUSSON 41af81fe4f
Merge pull request #188 from siddhrsh/patch-4
Update rw-system.sh
2020-05-20 21:44:12 +02:00
siddhrsh ff01f63493
Update rw-system.sh
Added realme c2 brightness and navigation command
2020-05-21 01:10:03 +05:30
Pierre-Hugues Husson 1f6fcb7322 Fix various FOD-related props and files SELinux permission 2020-05-20 19:59:45 +02:00
Pierre-Hugues HUSSON edc584e3c3
Merge pull request #187 from timbortnik/disable-storageproxyd
disable-storageproxyd
2020-05-19 09:57:12 +02:00
Tim Bortnik 4f7be9c2b5 disable-storageproxyd 2020-05-19 00:02:05 +03:00
Pierre-Hugues Husson deb3e53411 Add a CLI tool to dump list of cameras on Samsung Q vendor 2020-05-14 19:35:29 +02:00
Pierre-Hugues Husson cfe638aa94 Some devices have multiple panels, including some with 0 brightness. Take the one with the highest brightness 2020-05-14 18:31:37 +02:00
Pierre-Hugues Husson b3a5ea6275 Update Samsung HBM to use max brightnmess 2020-05-14 15:47:15 +02:00
Pierre-Hugues HUSSON e9afb88256
Merge pull request #186 from EugW/android-10.0
Fix havoc mk
2020-05-14 15:29:42 +02:00
EugW 89dfb3226b Fix havoc mk 2020-05-14 16:52:26 +05:00
Pierre-Hugues HUSSON 61899854d4
Merge pull request #184 from ponces/android-10.0
Fix exynos grep command to apply setprop correctly
2020-05-14 12:44:46 +02:00
Alberto Ponces ef30da0aae Simplify the exynos grep command even further and remove some whitespace 2020-05-14 11:41:08 +01:00
Pierre-Hugues Husson 4f718dfef2 Add Samsung HBM FOD default value 2020-05-14 11:00:04 +02:00
Alberto Ponces d6da9f1fec Fix exynos grep command to apply setprop correctly 2020-05-13 18:00:23 +01:00
Pierre-Hugues Husson 167c3bb4c1 Add /efs, needed on Galaxy A51 for fingerprint sensor calibration 2020-05-13 13:10:53 +02:00
Pierre-Hugues Husson 67bbd94780 [securize] Take the most recent between ro.vendor and ro.keymaster SPL, because vendor could be correct like -05 2020-05-13 10:13:51 +02:00
Pierre-Hugues Husson fd46dfb49a [su] Give more right to control dynamic partitions 2020-05-13 10:03:26 +02:00
Pierre-Hugues Husson 06badf2f7b Unforce root adb
On Samsung Galaxy A51, adb is forced as root by system in init.recovery...rc
However adb doesn't work as root on Samsung devices, so unset this to have working adb
2020-05-13 10:03:26 +02:00
Pierre-Hugues HUSSON 88003acb57
Merge pull request #183 from hwti/patch-1
Fix phh-securize.sh with Magisk modules
2020-05-10 12:53:02 +02:00
Loïc Yhuel 7698971538
Fix phh-securize.sh with Magisk modules
With Magisk, depending on enabled modules, directories like /system/xbin, /system/app and others could be tmpfs,
with /system/xbin/su and /system/app/me.phh.superuser being bind-mounts.

So we should try to operate on the real system partition.
2020-05-10 01:20:02 +02:00
Pierre-Hugues Husson e3af52cfdf Include lptools in build 2020-05-09 20:02:48 +02:00
Pierre-Hugues Husson 186496633e Add lptools to modify dynamic partitions 2020-05-09 14:24:38 +02:00
Pierre-Hugues Husson c85213c6f1 [simg2img_simple] Don't break when splice doesn't work (over adb for instance) 2020-05-09 14:03:36 +02:00
Mark Gillespie 81f673e8e3 Remove Telephony
https://github.com/phhusson/treble_experimentations/issues/1141
2020-05-08 19:38:03 +01:00
Pierre-Hugues HUSSON 22c1395462
Merge pull request #180 from eremitein/keylayout
rw-system: add 'daisy' stock keylayout files
2020-05-06 11:50:52 +02:00
Victor Bo 13a9b1e26d rw-system: add 'daisy' stock keylayout files
1-2. because gestures not works (exist in some gsi, same as stock -
swipe for notifications)
3. daisy-buttonJack.kl need for headphones volume control by headphones' buttons

	modified:   base.mk
	new file:   files/daisy-buttonJack.kl
	new file:   files/daisy-uinput-fpc.kl
	new file:   files/daisy-uinput-goodix.kl
	modified:   rw-system.sh
2020-05-04 23:44:20 +03:00
Pierre-Hugues Husson 0ae6b5b05c Add properties to use vendor audio policy, and to disable audio effects 2020-05-03 18:05:30 +02:00
Pierre-Hugues Husson bad4131180 Add property to use CAF vendor media_profiles
This is controlled through persist.sys.phh.caf.media_profile
system_server loads this file, so it requires a reboot to apply
2020-05-03 18:01:40 +02:00
Pierre-Hugues Husson 80b949241d We also want telephony.ims 2020-04-28 17:34:06 +02:00
Pierre-Hugues Husson 3371719f20 [Xiaomi DT2W] Call sendevent on any touchscreen
On Redmi Go, there is no gesture_mask or wake_gesture,
no /proc/touchpanel/wakeup_gesture, no /proc/tp_wakeup_gesture, no /proc/tp_gesture
However sendevent works.
FWIW it does have /proc/gesture/onoff, and /proc/gesture/data
2020-04-28 16:55:40 +02:00
Pierre-Hugues Husson 62dcebdd7f Don't use exec_background, it doesnt exist in a-only oreo devices. Not being background is okay here 2020-04-28 16:55:40 +02:00
Pierre-Hugues Husson cd327cc850 More props and files to override to fake real firmware for camera 2020-04-28 16:55:40 +02:00
Pierre-Hugues Husson 091c225863 Fix flashlight on S10 lite
Thanks @mainey
2020-04-25 20:10:25 +02:00
Pierre-Hugues Husson 53df615cca More phhsu perms 2020-04-14 09:50:38 +02:00
Pierre-Hugues Husson 705afa376d McTeeKeymaster is actually in vendor/lib/hw/ not vendor/lib 2020-04-14 09:50:38 +02:00
Pierre-Hugues Husson 6f2d3e5d29 Never forget access to ourselves 2020-04-14 09:50:38 +02:00
Pierre-Hugues Husson 72992a82fd Try another way to remount /system r/w 2020-04-14 09:50:38 +02:00
Pierre-Hugues Husson 9fe8e103e9 Use media_profiles_vendor on Razer Phone to enable 4k video recording 2020-04-13 20:25:57 +02:00
Pierre-Hugues Husson c4a41337e2 Allow 10 users/work profiles 2020-04-13 20:13:16 +02:00
Pierre-Hugues HUSSON 001f229374
Merge pull request #177 from theimpulson/android-10.0
rw-system: Enforce vendor media_profiles on PL2
2020-04-13 20:12:53 +02:00
theimpulson 7db3ec75c4 rw-system: Enforce vendor media_profiles on PL2
*This fixes https://github.com/phhusson/treble_experimentations/issues/379

Signed-off-by: theimpulson <aayushgupta219@gmail.com>
2020-04-13 18:10:55 +00:00
Pierre-Hugues HUSSON 2f8d5331a2
Merge pull request #176 from myst33d/android-10.0
Fix long boot on Oreo vendor for Redmi 6A and Redmi 6
2020-04-10 22:18:08 +02:00
Myst33d #RoccoIsCute 0a96913225
Fix long boot on Oreo vendor for Redmi 6A and Redmi 6 2020-04-10 23:17:52 +06:00
Pierre-Hugues Husson cfaa261e2c Include vr_hwc. This will make for better VR experience, and fixes compatibility warning on huawei devices 2020-04-05 14:00:25 +02:00
Pierre-Hugues Husson 52c2673998 Include oneplus motor command 2020-04-05 13:42:46 +02:00
Pierre-Hugues HUSSON e950266b69
Merge pull request #174 from irfanfadilah/andromeda/fingerprint-fix
[Mi Mix 3 5G/andromeda] Fix Fingerprint Issue
2020-04-05 11:32:38 +02:00
Pierre-Hugues HUSSON 1dfec7b9a9
Merge pull request #175 from irfanfadilah/andromeda/audio-fix
[Mi Mix 3 5G/andromeda] Fix Audio Issue
2020-04-05 11:32:01 +02:00
Irfan Fadilah c6f89d9340
Fix Andromeda Audio Issue
Set `ro.audio.ignore_effects` to `true` for `xiaomi/andromeda`.

Tested on my device by adding it to the `build.prop`.

Ref: https://forum.xda-developers.com/showpost.php?p=82126487&postcount=697
2020-04-05 11:38:51 +07:00
Irfan Fadilah eb50f7592d
Fix Andromeda Fingerprint Issue
Add `uinput-goodix.kl` and `uinput-fpc.kl` to `xiaomi/andromeda`.

Tested on my device by putting both files under `/system/usr/keylayout`.

Ref: https://forum.xda-developers.com/showpost.php?p=82179105&postcount=731
2020-04-05 11:30:36 +07:00
Pierre-Hugues Husson 09a49059a9 Enable navbar by default 2020-04-05 01:40:25 +02:00
Pierre-Hugues Husson a8c3c6124b Add persist.sys.phh.no_vendor_overlay property to ignore vendor overlay 2020-04-05 00:55:24 +02:00
Pierre-Hugues Husson 11a2fd96cc Some devices have broken tsp permissions, even without ear_detect_enable 2020-04-05 00:05:12 +02:00
Pierre-Hugues Husson 01c61a68bb Disable Samsung malwares preinstalled in /odm partition 2020-04-04 23:57:10 +02:00
Pierre-Hugues HUSSON 64cb608f45
Merge pull request #172 from jumper047/patch-4
Sound fix #2 for Redmi Note 8 Pro
2020-04-03 09:13:05 +02:00
jumper047 aea333e6b8
Sound fix #2 for Redmi Note 8 Pro
Miss in previous pull request
2020-04-03 02:50:41 +03:00
Pierre-Hugues HUSSON 4ab8565096
Merge pull request #171 from jumper047/patch-3
Fix "no sound" issue for Redmi Note 8 Pro
2020-04-02 21:19:23 +02:00
jumper047 ff0e381d51
Fix "no sound" issue for Redmi Note 8 Pro 2020-04-02 22:04:43 +03:00
Pierre-Hugues Husson 4bc2f864df Fix pm install through a file provided by su
See https://github.com/phhusson/treble_experimentations/issues/1214
2020-03-30 23:50:57 +02:00
Pierre-Hugues HUSSON 3199a5e850
Merge pull request #168 from AndyCGYan/huaweiare-ilight
Changes to lightsctl-huawei tool
2020-03-30 13:06:12 +02:00
Andy CrossGate Yan 4e2fcbe38d Changes to lightsctl-huawei tool
For https://github.com/phhusson/treble_experimentations/issues/1204

Change-Id: I70655264003190de6c8624e9f63bfea75a09cf61
2020-03-30 18:45:53 +08:00
Pierre-Hugues HUSSON 9e60c42682
Merge pull request #167 from cheah/fix-comparison
Fix value comparison in phh-prop-handler.sh
2020-03-26 16:50:44 +01:00
Michael Cheah 740000e786
Fix value comparison in phh-prop-handler.sh 2020-03-26 23:30:57 +08:00
Pierre-Hugues HUSSON 1f1c9b1d0d
Merge pull request #166 from cheah/refactor-oppo-props
Move Oppo props into phh-prop-handler.sh
2020-03-26 15:49:48 +01:00
Michael Cheah 1db7e1e1fe
Move Oppo props into phh-prop-handler.sh 2020-03-26 22:41:24 +08:00
Pierre-Hugues Husson f7981ef123 Yet another broken sw codec2 2020-03-26 11:45:56 +01:00
Pierre-Hugues HUSSON eeaa31fdd5
Merge pull request #146 from cheah/fix-xiaomi-dt2w-ten
[Android 10] [xiaomi] Use persist.sys.phh.xiaomi.dt2w prop to control DT2W
2020-03-26 09:46:26 +01:00
Michael Cheah 510e1c01d9
[xiaomi] Use persist.sys.phh.xiaomi.dt2w prop to control DT2W 2020-03-26 09:44:58 +08:00
Pierre-Hugues HUSSON 00eefaa01e
Merge pull request #165 from Tuan9304/android-10.0
Fix Brightness Realme C1
2020-03-22 12:10:00 +01:00
Tuan9304 c268d86c30 Move to right line 2020-03-22 17:43:28 +07:00
Tuan9304 79462b1c64 Fix Brightness Realme C1 2020-03-22 13:13:54 +07:00
Pierre-Hugues HUSSON 93335b6e59
Merge pull request #164 from Dunedan/reenable-multi-user
Re-enable multi user for all devices
2020-03-19 21:21:08 +01:00
Daniel Roschka 29ce153a16
Re-enable multi user for all devices
This commit re-enables multiple users for all devices. That's possible
as the system image is too large for Android Go nowadays anyway,
therefore no Android Go builds are available anymore.

This commit also increases the maximum number of users from 4 to 5 as
that's what several hardware already overlays set.
2020-03-19 21:02:42 +01:00
Pierre-Hugues Husson f620ffc0a8 Some CPH devices have two matches. Take first one 2020-03-19 15:21:01 +01:00
Pierre-Hugues Husson b07cbb9e07 Disable annoying strict mode by default 2020-03-19 15:21:01 +01:00
Pierre-Hugues HUSSON f6c5cd7e9a
Merge pull request #163 from Dunedan/show-cell-broadcast-app-links
Enable links to cell broadcast app
2020-03-15 22:44:07 +01:00
Daniel Roschka 66a9c57853
Enable links to cell broadcast app
This enables links from the settings to the cell broadcast app for
configuring the behavior for received cell broadcasts.

While most hardware overlays already enabled this setting, it's nothing
hardware related, so it makes sense to set here globally for any device.

I'll also open a PR in `vendor_hardware_overlay` to remove the setting
from all overlays there.
2020-03-15 21:19:52 +01:00
Pierre-Hugues Husson e83a8c3726 Ignore audio efects on all moto 2020-03-15 13:28:59 +01:00
Pierre-Hugues HUSSON d467acb307
Merge pull request #159 from Dunedan/disable-audio-effects-for-moto-g7play
Disable audio effects for Motorola Moto G7 Play
2020-03-15 13:26:26 +01:00
Pierre-Hugues Husson 47ad176aa5 Fix build on arm32 target 2020-03-14 13:58:02 +01:00
Pierre-Hugues HUSSON 00016d4320
Merge pull request #162 from mrgreywater/android-10.0
fix brightness flickering for Lenovo Z5s
2020-03-13 17:56:51 +01:00
mrgreywater c591f08a11 fix brightness flickering for Lenovo Z5s 2020-03-13 17:15:34 +01:00
Pierre-Hugues HUSSON b060013c57
Merge pull request #161 from mrgreywater/android-10.0
Fix dt2w for Lenovo Z5s
2020-03-13 16:36:09 +01:00
mrgreywater 9e58131492 fix dt2w for Lenovo Z5s 2020-03-13 16:23:57 +01:00
Pierre-Hugues Husson 00e24bf520 Another broken Codec 2
See https://github.com/phhusson/treble_experimentations/issues/1104
2020-03-12 16:54:44 +01:00
Pierre-Hugues Husson 827a578eec Some old mediatek devices require to disable Codec2 sw decoding 2020-03-11 17:28:09 +01:00
Pierre-Hugues Husson cca9f3c06b Add int parameter to xiaomi-display-feature 2020-03-11 13:57:17 +01:00
Pierre-Hugues Husson bfa94e3fd7 Use a FLOSS gallery instead of google photos 2020-03-11 13:57:17 +01:00
Pierre-Hugues HUSSON 4f527e92f6
Merge pull request #160 from tinloaf/fix-fingerprint
Fix fingerprint
2020-03-11 11:44:33 +01:00
Pierre-Hugues Husson a3280e50f1 [Realme U1] Fix keymaster, touchpanel and fingerprint 2020-03-10 23:26:20 +01:00
Pierre-Hugues Husson 0031326e7d Add Oppo fingerprint support, tested on Realme X2 Pro 2020-03-10 23:26:03 +01:00
Lukas Barth 93ce496efc Simplify mount check 2020-03-10 15:28:32 +01:00
Lukas Barth 494da1a8dc Fix missing /data/sec_storage_data 2020-03-10 13:09:09 +01:00
Daniel Roschka 962529890f
Disable audio effects for Motorola Moto G7 Play
This disables audio effects for the Motorola Moto G7 Play (channel) as
enabled audio effects break audio via Bluetooth.

It requires a separate if-statement in `rw-system.sh`, because
`ro.vendor.build.fingerprint` isn't set for the device.

Relates to: https://github.com/phhusson/treble_experimentations/issues/857
2020-03-07 21:16:05 +01:00
Pierre-Hugues Husson 8f96ae3423 Set ro.separate.phone on realme devices. That is another model number, that is used like by fingerprint HAL to define the position of the Facola. Also trigger the audio speaker init for Realme U1 2020-03-06 18:41:32 +01:00
Lukas Barth 51be51649b Fix mounts and permissions for sec_storage on Kirin devices 2020-03-04 16:10:28 +01:00
Pierre-Hugues Husson 04583fa95a Stop whitelisting all oppo devices in the world, and regexp it 2020-03-03 00:58:55 +01:00
Pierre-Hugues Husson 552f710be1 Add persist.sys.phh.oppo.usbotg to toggle usb otg on Oppo/Realme devices 2020-03-01 18:17:18 +01:00
Pierre-Hugues HUSSON 96a1827f2c
Merge pull request #158 from buddi56/android-10.0
Added CPH1859 and CPH1861 for DT2W and Brightness fixes
2020-03-01 17:31:25 +01:00
buddi56 1fb4bcbad6
Fixed mistake 2020-02-29 21:38:16 +05:30
Naveen Kumar 3d3450c5da Adding Brightness and DT2W fix to CPH1859 and CPH1961 2020-02-29 21:33:28 +05:30
Pierre-Hugues Husson 1e340140bf On Realme devices, trick HAL into exposing all cameras 2020-02-29 16:56:52 +01:00
Naveen Kumar dda3824e84 Added CPH1859 and CPH1861 for DT2W and Brightness fixes 2020-02-29 18:05:24 +05:30
Pierre-Hugues Husson 3cf77c937c Add google fingerprint gestures kl 2020-02-27 14:46:38 +01:00
Pierre-Hugues Husson b914331829 Include phh-remotectl system for remote takeover 2020-02-26 23:59:11 +01:00
Pierre-Hugues Husson 2c385ffbe9 Detect other oppo device, realme 1 2020-02-26 15:29:23 +01:00
Pierre-Hugues HUSSON 6f3bf7ffd1
Merge pull request #157 from timbortnik/securize-basicintegrity
Securize basicintegrity
2020-02-23 23:55:50 +01:00
Tim Bortnik f3d3cb40d4 help-pass-basicintegrity-after-securize 2020-02-23 21:12:17 +02:00
Tim Bortnik d72a25793e
Merge pull request #1 from phhusson/android-10.0
Android 10.0 pull from phh
2020-02-23 21:10:21 +02:00
Pierre-Hugues HUSSON dd21e100b2
Merge pull request #152 from jumper047/android-10.0
[Android 10][Begonia] Fix brightness and fingerprint sensor on Redmi Note 8 Pro
2020-02-22 14:54:48 +01:00
Pierre-Hugues Husson 17a2cc66f3 Add props to control Oppo touchpanel
This is needed because /proc/touchpanel is u:object_r:proc:s0
We can't have our own genfscon on it, because we might hit conflicts
2020-02-21 18:02:41 +01:00
Pierre-Hugues Husson 62f63e975d Include realme rmx1931 detection, set specific kl for dt2w in that case 2020-02-21 16:35:07 +01:00
Pierre-Hugues HUSSON 22df6a9302
Merge pull request #156 from DanijelXDA/patch-1
Fix distorted audio bug on GSI images for ginkgo and willow
2020-02-20 22:06:27 +01:00
Danijel Jovanović e0d0c7ae32
Fix distorted audio bug on GSI images for ginkgo and willow 2020-02-20 21:57:00 +01:00
jumper047 98b219ba1b Fix fingerprint behavior 2020-02-20 21:22:39 +03:00
jumper047 f1757adf2e Simplify begonia regexp 2020-02-20 21:21:45 +03:00
Pierre-Hugues HUSSON 0ba57d9364
Disable libpdx_default_transport unconditionally
Because of new VNDK restrictions of Android 10, there is no way that a /vendor/lib/libpdx_default_transport.so work in any way
2020-02-20 18:15:38 +01:00
Myst33d caa9ad2e3b
Disable libpdx_default_transport uncoditionally 2020-02-20 22:28:35 +06:00
Myst33d c198bdb1b6
Fix camera for cactus and cereus 2020-02-20 22:19:11 +06:00
Pierre-Hugues HUSSON 7f566c1c24
Merge pull request #154 from myst33d/android-10.0
Fix distorted sound for cactus and cereus
2020-02-20 14:43:39 +01:00
Myst33d a35833ed12
Fix distorted sound for cactus and cereus 2020-02-20 19:39:40 +06:00
jumper047 e64d63c5e9
Fix begonia regexp 2020-02-20 07:50:02 +03:00
jumper047 da2e7c8937
Fix brightness on Redmi Note 8 Pro 2020-02-19 22:54:17 +03:00
Pierre-Hugues HUSSON 1966aaaa9e
Merge pull request #149 from SamarV-121/patch-1
Enable latch_unsignaled on exynos devices
2020-02-19 14:28:43 +01:00
Sᴀᴍᴀʀ Vɪꜱᴘᴜᴛᴇ 7b8beb01ed
Enable latch_unsignaled on exynos devices
ro.hardware=exynos* on some samsung devices
eg. Samsung Galaxy M20
2020-02-19 18:20:20 +05:30
Mehran Kholdi da0775f9ee Add Redmi 7 - onc(lite) to fingerprint input events blacklist 2020-01-21 22:59:36 +01:00
Peter Cai 3bc733f431 rw-system: disable hardware acceleration in system_server for SPRD devices
* For some reason, the OpenGL implementation on SPRD devices causes
  crashes in system_server on glFinish() due to double-free of mutexes.
  It is not the same case with the MTK skia compatibility bug, because
  this one produces no GL errors, only the final mutex-related crash.
* This crash is only observed in system_server by far. In other
  hardware-accelerated applications, after a lot of tinkering, I could
  not reproduce the same problem. (Even if they somehow do crash, it
  won't bring the entire system down like `system_server`.)
* Since all SPRD devices do not have "high-end gfx", it is reasonable
  to set this `ro.config.avoid_gfx_accel` flag. This will disable the
  use of hardware gfx in system_server, avoiding the crash. Most SPRD
  devices comes with Android Go by default, which has this flag set
  (implied by `ro.config.low_ram`) anyway.
* All devices having the `sprd-adf` module is an SPRD device launched
  with Android 9 or earlier. ADF is deprecated in Android 10 or higher.
2020-01-20 09:25:41 +01:00
Pierre-Hugues HUSSON 7edfd64f30
Merge pull request #145 from cheah/add-flag-for-old-mnc-format
Set persist.sys.phh.radio.use_old_mnc_format for polaris and whyred
2020-01-16 23:34:05 +01:00
washinson 21cbb9b4c4 Fix dualsim for some Huawei phones (#143)
* Fix dualsim for some Huawei phones

Huawei P20 Lite doesn't have /odm/phone.prop, we must use /vendor/phone.prop
2020-01-14 10:40:43 +01:00
Michael Cheah a406582117
Set persist.sys.phh.radio.use_old_mnc_format for polaris and whyred 2020-01-11 19:36:06 +08:00
Pierre-Hugues HUSSON 2a42bd0ed2
Merge pull request #141 from eremitein/android-10.0
[daisy] revert camera in DnD fix
2020-01-07 20:57:50 +01:00
Pierre-Hugues Husson 54e5742154 Fix typo, see MR 137 2020-01-07 19:26:09 +01:00
Victor Bo 89c0602a99 rw-system: set latch_unsignaled for 'daisy' too
modified:   rw-system.sh
2020-01-07 06:20:38 +05:00
Victor Bo 26416f43df [daisy] revert camera in DnD fix
* camera works fine in DnD mode without this fix in v204 and in v121 too
    not need this fix for daisy anymore

	modified:   rw-system.sh
2020-01-07 06:12:30 +05:00
Pierre-Hugues HUSSON bf3df8faaa
Merge pull request #140 from PeterCxy/patch-sprd-adf
fix adf display devices on Spreadtrum devices for Android 10
2020-01-02 16:24:21 +01:00
Peter Cai 7e0e808d09
fix adf display devices on Spreadtrum devices for Android 10
* Somehow, when running GSI 10, Spreadtrum's adf driver do not show up
  with the correct name in /dev. I am not sure how this happens, but it
  seemed that a few `mknod`s fixed the problem. This was tested on
  Xiaomi Qin 2 Pro.
2020-01-02 09:44:18 +08:00
Pierre-Hugues HUSSON ae1bda5715
Merge pull request #137 from J0SH1X/patch-1
Fix Redmi 8 brightness scale
2019-12-24 21:57:20 +01:00
J0SH1X 666cc1ce4b
Fix Redmi 8 brightness scale 2019-12-24 20:52:47 +01:00
Pierre-Hugues HUSSON 18b20430fb
Merge pull request #135 from lead4good/android-10.0
fix: mia3 brightness scale
2019-12-22 15:32:51 +01:00
lead4good 4a58bf9c70 fix: mia3 brightness scale 2019-12-22 11:55:41 +01:00
Pierre-Hugues Husson 1cba9701de Add lightsctl-seh for new light control hal of samsung 2019-12-16 21:01:24 +01:00
Pierre-Hugues HUSSON 33e906838c
Merge pull request #133 from XavierWrz/patch-2
Fix for broken OpenGL ES on old Snapdragon devices
2019-12-13 18:16:45 +01:00
Pierre-Hugues Husson 1cb1975ec1 Test cmd for vendor.goodix.extend.service 2019-12-13 10:08:16 +01:00
Whatz 0d78085110
Possible fix for OpenGL bug
Working in moto e5, please feedback
2019-12-10 13:17:16 -03:00
Pierre-Hugues HUSSON 67154089dd
Merge pull request #132 from lead4good/android-10.0
fix: add sound support for xiaomi a3
2019-12-09 08:50:16 +01:00
Frieder Paape 18d605c436
fix: add sound support for xiaomi a3 2019-12-09 08:43:16 +01:00
Pierre-Hugues Husson ae85f36fcb Add support for Huawei's phone.prop
Reference is https://github.com/LineageOS/android_device_huawei_kirin970-common/blob/lineage-16.0/init/init_kirin970.cpp
2019-12-09 00:54:05 +01:00
Pierre-Hugues Husson ad57918dbc Use system-provided remount command, and remove properly superuser app 2019-12-08 21:36:47 +01:00
Pierre-Hugues Husson 9f9ede3158 Reset system props as well. Also fix SPL keymaster priority 2019-12-08 21:07:32 +01:00
Pierre-Hugues HUSSON b3b7aea404
Merge pull request #130 from XavierWrz/patch-1
Fixing animations issues in Moto E5/Moto E5 Plus
2019-12-08 18:42:29 +01:00
Whatz fdc9e8cfb1
Fixing animations issues in Moto E5/Moto E5 Plus 2019-12-08 14:30:35 -03:00
Pierre-Hugues Husson 060b3f9954 Workaround broken OpenGL ES on old Snapdragon devices
Thanks @XavierWrz
2019-12-08 17:09:40 +01:00
Pierre-Hugues Husson aca36f1b1c Detect whether vendor has an hostapd by checking manifest 2019-12-06 21:34:44 +01:00
Pierre-Hugues Husson e0c0285eb2 Fix huawei touchscreen hal for treble app (used for glove mode) 2019-12-04 23:42:44 +01:00
Pierre-Hugues Husson 2069acbbc1 Add android.hidl.manager@1.0 lib. This is used by treble app to detect hostapd presence 2019-12-04 23:42:15 +01:00
Pierre-Hugues Husson 21d7520d20 Fix fingerprint gestures on huawei pie vendor 2019-12-04 23:24:51 +01:00
Pierre-Hugues Husson 60c6c8f9ed Reset LD_PRELOAD. Mediatek puts annoying non-working libcoredump in there, ignore it 2019-12-04 20:38:40 +01:00
Pierre-Hugues HUSSON 23f8d4bdc2
Merge pull request #129 from YaAlex3/android-10.0
Fix backlight on Redmi 7A (pine) [Ten]
2019-12-02 23:05:34 +01:00
Alexander 48b76745c4
Fix backlight on Redmi 7A (pine) 2019-12-03 00:46:39 +03:00
Pierre-Hugues Husson 946ead6db3 Detect touchscreen with dt2w node 2019-12-01 17:07:01 +01:00
Pierre-Hugues Husson b701c84f58 Allow treble_app to control /dev/input/eventX (useful to enable dt2w) 2019-12-01 17:06:37 +01:00
Pierre-Hugues Husson 07632a8291 Fix fingerprint on Honor View 10 2019-11-30 20:39:23 +01:00
Pierre-Hugues HUSSON d7b17ebf53
Merge pull request #126 from redmi8a/android-10.0
Fix backlight on Redmi 8A (olivelite)
2019-11-21 07:35:50 +01:00
Milan Kragujević bcd754334a
Fix backlight on Redmi 8A (olivelite) 2019-11-20 23:53:12 +01:00
lead4good 5201b0f2cb fix sound for redmi note 8 (ginko) 2019-11-18 22:25:57 +01:00
Pierre-Hugues Husson 562ee1f897 Tell pe gapps we are a phone 2019-11-11 23:29:51 +01:00
Pierre-Hugues Husson 2f33d5286e ugly: vndk somehow replaces vendor files if both exist. this is especially problematic on libstagefright_foundation (found on CAF and Exynos devices) 2019-11-07 22:46:16 +01:00
Pierre-Hugues Husson 1ba43f4ce5 Simplify matching for lenovo dt2w 2019-11-04 22:56:29 +01:00
Pierre-Hugues Husson dcb6f64f42 Add support for Lenovo Z5 dt2w 2019-11-01 18:30:18 +01:00
Pierre-Hugues Husson 09f46d0192 Support Nokia 4.2 assistant button 2019-10-26 21:07:58 +02:00
Andy CrossGate Yan 3a32e685d1 Add privapp-permissions whitelist for PhhTrebleApp 2019-10-26 21:07:46 +02:00
Pierre-Hugues Husson e4f8a3340f Ignore swizzle to fix crash on Oreo PowerVR devices 2019-10-22 15:26:22 +02:00
Pierre-Hugues Husson cf6e53c1fe Revert "Add qemu.hw.mainkeys as vendor legal API"
This reverts commit 9549703b4a.

Some vendors already declare this property as u:object_r:qemu_hw_mainkeys_prop:s0, so this commit prevents booting those
2019-10-22 14:37:09 +02:00
Pierre-Hugues Husson 186e81291d trustkernel keymaster also requires whitelisted ro.product.brrand. This property has disappeared in Android 10, so set it for teed 2019-10-22 14:19:47 +02:00
Pierre-Hugues Husson 99926b69a9 Add support for pe gapps 2019-10-21 21:44:52 +02:00
Pierre-Hugues Husson 6d6083b754 Set TARGET_GAPPS_ARCH 2019-10-21 17:42:05 +02:00
Pierre-Hugues Husson 9549703b4a Add qemu.hw.mainkeys as vendor legal API 2019-10-20 22:49:45 +02:00
Pierre-Hugues Husson 99cdd37534 Fix media.swcodec on a-only devices
On a-only, if init reads system/etc/init/mediaswcodec-treble.rc before
apex is available, init will see the /apex/...mediaswcodec file isn't
there and will ignore the process.
Kick-start media.swcodec service on boot when apex is ready
2019-10-20 21:51:32 +02:00
Pierre-Hugues Husson 2f8c5dca48 Give lmkd ptrace capability, to bypass hidepid (AOSP uses `readproc` group, but I cant because of A-only) 2019-10-16 15:52:59 +02:00
Pierre-Hugues Husson 82d65bd4c3 Add asus-motor, to be called from cameraserver to control ZF6 cam 2019-10-01 13:32:49 +02:00
Pierre-Hugues Husson a1527b0b28 Don't include sas stuff on non-sas target 2019-09-26 22:24:54 +02:00
Pierre-Hugues Husson fdf58ff7ed No longer needs hardcoded device, it is generated 2019-09-23 08:31:13 +02:00
Pierre-Hugues Husson ab568ff772 Revert "Fix mediacodec selinux context AOSP regression"
This reverts commit 46d65aac9b.

This segfaults secilc/init on pretty much all devices
2019-09-18 10:18:17 +02:00
Pierre-Hugues Husson 84b33286ba No need to run apexd bootstrap in su policy, it is already expected to be started by init 2019-09-18 10:15:24 +02:00
Pierre-Hugues Husson 46d65aac9b Fix mediacodec selinux context AOSP regression 2019-09-16 23:15:03 +02:00
Pierre-Hugues Husson 312698d889 Copy O/O-MR1 behaviour of copying wpa/p2p supp config file 2019-09-16 17:41:30 +02:00
Pierre-Hugues Husson 3f66bf29ae Ignore device's /product partition on SaS 2019-09-15 13:26:27 +02:00
Pierre-Hugues Husson db487d1446 [vndk 26] Read liblog.so from vndk (has additional symbols required on huawei) 2019-09-15 00:57:05 +02:00
Pierre-Hugues Husson 1e15460c80 Force ro.vndk.version 26 when we detect vndk 26 2019-09-15 00:56:40 +02:00
Pierre-Hugues Husson 120df2523a Fixed build for a-only (now called System-as-System) 2019-09-14 21:17:03 +02:00
Pierre-Hugues Husson dae86834b2 Don't override LD_CONFIG_FILE (needed for apex with different config) 2019-09-13 22:32:12 +02:00
Pierre-Hugues Husson 85b94fec63 Load zygote file (we remove the one from ramdisk in secilc) 2019-09-13 22:30:46 +02:00
Pierre-Hugues Husson 5aa82fd371 New shiny thing broke adb again 2019-09-12 21:21:48 +02:00
Pierre-Hugues Husson 926096b97f (re)Add /bt_firmware. this is still required by 8.1 CAF devices like Razer Phone 2019-09-12 21:21:31 +02:00
Pierre-Hugues Husson d3f427ccd3 Various a-only fixes:
Create apex folder
Create mnt/storage/full
Create /product symlink
Start apex
Override zygote
2019-09-12 20:58:32 +02:00
Pierre-Hugues Husson 2e4d8bcb0a Allow tee to access rpmb (denials seen on Moto E5 preventing keymaster from working) 2019-09-12 20:58:18 +02:00
Pierre-Hugues Husson f7c23ba986 Set first_api_level, this helps disable bpf requirements 2019-09-12 20:57:42 +02:00
Pierre-Hugues Husson cbc8d1e1af On samsung vndk >= 28 we want to force disable fingerprint weird behaviour 2019-09-12 20:57:30 +02:00
Pierre-Hugues Husson 0fff673bd3 also override 64b keymaster3device 2019-09-12 20:57:07 +02:00
Pierre-Hugues Husson 27df9cf112 Remove vndk 27 config file 2019-09-12 20:55:36 +02:00
Pierre-Hugues Husson 94cc413043 Use regenerated ld.config.26.txt (compared to automatically generated, authorize all vendor => vndk libs, and authorize vndk => runtime apex) 2019-09-12 20:49:27 +02:00
Pierre-Hugues Husson d93868102c Stop setting LD_CONFIG_FILE, with apex, multiple config files might be used. Instead use bionic overload from ro.vndk.version 2019-09-12 20:47:53 +02:00
Pierre-Hugues Husson a6aa52f7b1 [temp] hardcode init.treble-environ.rc (how does that new build system work?) 2019-09-12 20:46:25 +02:00
Pierre-Hugues Husson ea6d0badb5 New products to derive from 2019-09-12 20:45:28 +02:00
Pierre-Hugues Husson c0eab65abc Force binder32 2019-09-12 20:44:16 +02:00
Pierre-Hugues Husson ef3212b963 [temp] Include treble_arm64_bvN adapted for Q 2019-09-09 01:16:15 +02:00
Pierre-Hugues Husson 1c31b0512a [temp] Set ueventd to permissive, needed to boot huawei, because it hits "unlabeled" file when trying to access some files in /firmware 2019-09-09 01:15:54 +02:00
Pierre-Hugues Husson 51ee6f155e fsck.exfat file context is now handled by aosp 2019-09-09 01:15:17 +02:00
Pierre-Hugues Husson ebf0acec02 Allow building vndk tests 2019-09-09 01:14:29 +02:00
Pierre-Hugues Husson a5d9f5a7f6 Android 10 by default thinks the device cant have a lockscreen... 2019-09-09 01:14:12 +02:00
Pierre-Hugues Husson 91ff330807 tmpfs domain is no longer created by the macro 2019-09-09 01:13:44 +02:00
Pierre-Hugues Husson 7b69b370d1 Additional lib to be edited to boot keymaster 2019-09-09 01:13:30 +02:00
Pierre-Hugues Husson 9f6a970491 Add mediatek proc_ged (else it boots but no graphics) 2019-09-09 01:12:51 +02:00
Pierre-Hugues Husson b010be5db0 Allow treble app to write "battery info" 2019-08-22 11:36:42 +02:00
Pierre-Hugues Husson 66cf09d963 [Samsung chmods] Need to set selinux too in input/enabled 2019-08-22 11:36:17 +02:00
Pierre-Hugues Husson d45861e585 If we have both vendor and boot security_patch, prefer vendor security_patch 2019-08-22 10:59:08 +02:00
Pierre-Hugues Husson ef0936947e We need to restart samsung hal when doing chown 2019-08-22 00:45:53 +02:00
Pierre-Hugues Husson edaab46a82 Also copy vendor security patch level 2019-08-22 00:45:39 +02:00
Pierre-Hugues Husson 70c0e57764 [phh-securize] remove self script 2019-08-22 00:45:27 +02:00
Pierre-Hugues Husson c80de8d3fe Add phh-securize.sh to switch to `user` build, copy vendor fingerprint, and tighten adb security 2019-08-22 00:35:41 +02:00
Pierre-Hugues Husson 2b4b3d6398 [su] Allow write on any file/dir 2019-08-22 00:34:13 +02:00
Pierre-Hugues Husson f2b061da52 Add persist.sys.phh.mainkeys property to persist qemu.hw.mainkeys 2019-08-22 00:22:51 +02:00
Pierre-Hugues Husson 31241609bb More rights to su 2019-08-21 22:40:53 +02:00
Pierre-Hugues Husson fda319aa57 SaR is more annoying to resize because there is no such thing as /dev/root, but mknod it so we can do it 2019-08-21 22:40:36 +02:00
Pierre-Hugues Husson d6d8b0ee5c More chmods for /sys Samsung 2019-08-21 22:00:44 +02:00
Pierre-Hugues Husson 0922844a1a Use Samsung key layouts on all samsung devices 2019-08-20 00:03:14 +02:00
Pierre-Hugues Husson e2e1e60953 Restart Samsung fingerprint HAL on boot 2019-08-14 23:36:04 +02:00
Pierre-Hugues Husson 9b00a5140f Also chown `cmd` 2019-08-14 23:35:52 +02:00
Pierre-Hugues Husson 7508b08c11 If /sys/class/sec/tsp rules are obviously completely broken, unbreak them a little 2019-08-12 22:50:17 +02:00
Pierre-Hugues Husson 1709734aae Samsung running pie vendor have fixed fingerprint remaning 2019-08-11 22:59:32 +02:00
Pierre-Hugues Husson 9d438701da Restart Samsung lights HAL late in the boot process.
Lights HAL doesn't work on Snapdragon Samsun S10 series for an unknown
reason when started too early, and we don't control its start time.

So just restart it later.
2019-08-10 13:16:40 +02:00
Pierre-Hugues Husson 4293be815c Mark successful boot before the 30s sleep 2019-08-10 13:15:53 +02:00
Pierre-Hugues Husson c7d378a359 More rights 2019-08-09 23:39:36 +02:00
Pierre-Hugues Husson c323b7e9b9 Revert "Force lawnchair instead of AOSP launcher"
This reverts commit 4b1aea0437.

This broke navigation gestures, with no easy fix
2019-08-06 15:51:21 +02:00
Pierre-Hugues HUSSON 6b9054e07c
Merge pull request #117 from vincentvidal/android-9.0
Fix typo
2019-07-19 11:12:40 +02:00
Vincent Vidal a151119615 Fix typo 2019-07-19 10:18:26 +02:00
Pierre-Hugues Husson 1048ea4fd2 Trigger secondary adbd only if we managed to disable first one 2019-07-17 20:12:47 +02:00
Pierre-Hugues Husson 5dc6a4573a Add bluetooth in the list of features to check HIDL manifest for, to trigger packagemange feature 2019-07-17 20:12:47 +02:00
Pierre-Hugues Husson 95036eb2f6 Fix reading vndk if setting prop from vndk failed on recent enough vendors 2019-07-17 20:12:47 +02:00
Pierre-Hugues Husson 31386d8037 Update sepolicy to allow more stuff based on S10e testing 2019-07-17 20:12:47 +02:00
Pierre-Hugues Husson f7c1c61c74 [Samsung] Disable security.proca (kills su when run) 2019-07-17 20:12:47 +02:00
Pierre-Hugues Husson 4b1aea0437 Force lawnchair instead of AOSP launcher 2019-07-03 09:21:17 +02:00
Pierre-Hugues HUSSON 6110dd3f78
Merge pull request #113 from eremitein/android-9.0
fp-gestures: don't change if exists
2019-06-20 23:31:12 +02:00
Pierre-Hugues Husson 7c94ba9902 Add lightsctl-huawei to test huawei brightness control 2019-06-14 00:14:40 +02:00
Pierre-Hugues Husson 9fcb8428ac Add `persistprops` to edit persistent properties offline 2019-06-14 00:14:40 +02:00
Pierre-Hugues Husson 9b40bccd82 If ro.hw.oemName isn't set, set it from sku
cf https://github.com/phhusson/treble_experimentations/issues/533
2019-06-12 15:41:25 +02:00
Victor Bo ef78cb7a99 fp-gestures: don't change if exists
bad idea to delete users changes after reboot
no need to anger users:)

	modified:   rw-system.sh
2019-06-11 05:03:54 +00:00
Pierre-Hugues Husson 05e6d4b94f Add oneplus-motor command 2019-06-10 23:54:23 +02:00
Pierre-Hugues Husson 1a2c9165c8 Update phhgsi_arm64_a system.img size to match Huawei P9
Fixes https://github.com/phhusson/treble_experimentations/issues/546
2019-06-10 10:42:35 +02:00
Pierre-Hugues HUSSON 28c40a5e3f
Merge pull request #112 from AndyCGYan/fix-redmik20pro
Fixes for Xiaomi Redmi K20 Pro (raphael)
2019-06-06 08:16:58 -07:00
AndyCGYan 91cd65dcdc Build xiaomi-motor
Serves as a manual/intermediate solution to https://github.com/phhusson/treble_experimentations/issues/539

Change-Id: Ia334f7d106b121014c791b0edb06b59a0eef3580
2019-06-06 06:48:26 +00:00
AndyCGYan 1747067d80 Fix sound on raphael
https://github.com/phhusson/treble_experimentations/issues/541

Change-Id: I3f5b6d0fb67e2a14a7f16f43ac9ee2e32076ea9b
2019-06-06 06:45:47 +00:00
Pierre-Hugues Husson 819cbe360d Helper to debug xiaomi motorized camera 2019-06-03 10:08:48 +02:00
Pierre-Hugues HUSSON 7052b96cea
Merge pull request #111 from darkestDark/darkestDark-patch-1
Prevent Brightness Flickering Bug on Redmi Note 7
2019-06-03 09:10:08 +02:00
darkestDark 2c29f204fc
Prevent Brightness Flickering Bug on Redmi Note 7
Add the Device to the List, which gets the prop persist.sys.qcom-brightness set.
2019-06-03 06:53:40 +02:00
Pierre-Hugues Husson 47062277a4 Add cereus in the no sound effects list
https://forum.xda-developers.com/showpost.php?p=79568310&postcount=1998
2019-05-22 20:43:18 +02:00
Pierre-Hugues Husson f95b7236bd In addition to null-mounting soundfx, also set property to disable effects (should both have the same effects) 2019-05-22 20:41:25 +02:00
Pierre-Hugues Husson 453790be16 Add tulip in qcom backlight 2019-05-20 23:35:16 +02:00
Pierre-Hugues Husson fdb303e941 Add tulip in fingerprint input events blacklist 2019-05-20 23:32:56 +02:00
Pierre-Hugues Husson 8441ef413f Fix https://github.com/phhusson/treble_experimentations/issues/121 2019-05-18 21:08:13 +02:00
Pierre-Hugues HUSSON b730a1c14b
Merge pull request #109 from folokorom-gsi/android-9.0-grus
Add Xiaomi Mi 9 SE for soundfx mess
2019-05-18 13:08:54 +02:00
AndroPlus d7a9514ccd Add Xiaomi Mi 9 SE for soundfx mess 2019-05-18 19:06:32 +09:00
Pierre-Hugues Husson 31eac57426 Additional way to find a specific msm model (seen on Redmi Go) 2019-05-16 22:04:58 +02:00
Pierre-Hugues HUSSON 85d4e98941
Merge pull request #103 from tytydraco/android-9.0
Disable broken led:torch_2 trigger on Mi A2 / Mi 6X
2019-05-06 22:10:38 +02:00
Pierre-Hugues HUSSON 46b9a683ff
Merge pull request #108 from cheah/disable-fp-button-whyred
Disable fingerprint button on whyred
2019-05-06 15:58:04 +02:00
Michael Cheah 99e13e7d1a
Disable fingerprint button on whyred 2019-05-06 21:53:00 +08:00
Pierre-Hugues Husson d06769c042 Add G6 Play for soundfx mess 2019-05-05 19:45:48 +02:00
Pierre-Hugues Husson 164e73b49c Nubia RedMagic needs backlight thingy 2019-05-04 18:04:21 +02:00
Pierre-Hugues Husson 75a2e0f64f Set audio rotation on Samsung + Razer 2019-05-03 23:47:33 +02:00
Pierre-Hugues HUSSON 04ed4ac7fd
Merge pull request #104 from penn5/patch-7
Add wayne to audio.camerasound.force
2019-04-24 11:00:11 +02:00
penn5 6f767efce1
Add wayne to audio.camerasound.force
fixes https://github.com/phhusson/treble_experimentations/issues/161
2019-04-24 09:47:32 +01:00
Pierre-Hugues Husson 4e4f1cd715 Add a64_ab device (hello arm pie vendors) 2019-04-24 08:56:27 +02:00
Tyler Nijmeh c1c1e8600b Disable broken led:torch_2 trigger on Mi A2 / Mi 6X
At the moment, both led:switch_1 and led:torch_2 are both linked to the
front facing camera torch. Xiaomi's stock Pie vendor for devices jasmine
and wayne (Mi A2 and Mi 6X, respectively) mistakingly hooks these nodes
incorrectly, causing the front facing camera torch to default to a
brightness level of 90. However, after a single photo is taken, the
torch turns off temporarily until either A) the camera is closed and
reopened or B) the camera app requests the flash to trigger.

To circumvent the issue with Xiaomi's stock pie vendor blobs, we can
disable the led:torch_2 trigger, and allow led:switch_1 to handle it.

Test: Run the desired command on boot and observe the default front
facing camera torch state.

Test: Ensure Snapchat and Open Camera default to flash being disabled
for the front facing camera torch.

Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
2019-04-22 16:20:05 -07:00
Brian Wang 4f40b50e9f Decrease system partition size for arm_a images so it fits in for more devices 2019-04-18 21:42:11 +02:00
Pierre-Hugues Husson eaacc3accc Remove global libeffects sed. Breaks many devices, and is actually needed only on moto 2019-04-08 13:29:07 +02:00
Pierre-Hugues Husson afae0a4d6f Add few debug commands 2019-03-31 19:41:09 +02:00
Pierre-Hugues Husson f00f7f4402 Samsung pie vendors arent happy with my edits. Disable them until it is fixed 2019-03-31 18:57:41 +02:00
Pierre-Hugues Husson 3f4e811d2e Remove mtk/ussd fix from vndk-detect. It is plain wrong (property doesnt exist) 2019-03-31 17:37:37 +02:00
Pierre-Hugues Husson db12985a31 Set ussd fix on mtk-ril 2019-03-31 17:37:13 +02:00
Pierre-Hugues Husson 63eaf64710 Fix sound on cepheus 2019-03-20 23:57:06 +01:00
Pierre-Hugues Husson b1a230c0e5 Pedantic shellcheck 2019-03-20 23:57:06 +01:00
Pierre-Hugues Husson d3ac3f55d5 Cepheus also has an AI key 2019-03-20 23:57:06 +01:00
Pierre-Hugues Husson 8cc37bb205 Rewrite qualcomm chi to read real manufacturer. makes enabling aux cams easier 2019-03-20 23:57:06 +01:00
Pierre-Hugues Husson d322b4157b Switch from ASSIST to VOICE_ASSIST 2019-03-20 23:57:06 +01:00
Pierre-Hugues Husson 76c81a45ed Allow treble_app to set camera-HAL related properties 2019-03-20 23:57:06 +01:00
Pierre-Hugues Husson 52d4d73146 Include sim toolkit app 2019-03-14 12:59:54 +01:00
Pierre-Hugues Husson 5d34610de1 Call service only if we got it 2019-03-07 22:28:19 +01:00
Sᴀᴍᴀʀ Vɪꜱᴘᴜᴛᴇ 69f230df9c Fix low brightness issue on realme 2 pro 2019-03-04 22:05:34 +01:00
Pierre-Hugues Husson c97cc4c507 shfmt -i4 -w 2019-03-04 22:01:39 +01:00
Pierre-Hugues Husson a8b1cfb7cb Add pettyl and james in the list of borked moto devices 2019-03-04 21:56:20 +01:00
Pierre-Hugues Husson 5574bc3d91 shellcheck 2019-03-04 21:54:48 +01:00
Pierre-Hugues Husson c03cb0fad4 Also check pie path for android.hardware.boot hal 2019-03-04 21:47:25 +01:00
Pierre-Hugues Husson 1cf540004d Also check pie manifest 2019-03-02 15:38:45 +01:00
Pierre-Hugues Husson 4cec494b21 Fix audio hal crash on moto 2019-03-02 14:46:33 +01:00
Pierre-Hugues Husson 908dd917b6 Fix incoming SMS and mobile data on MT6379 2019-02-26 23:15:51 +01:00
Pierre-Hugues Husson 21f2aacfd7 Reenable in-call mute fix for huawei 2019-02-17 13:18:57 +01:00
Pierre-Hugues Husson 63bacaf3bf Add Moto evert/jeter/aljeter for soundfx workaround 2019-02-14 17:29:15 +01:00
Pierre-Hugues Husson 2b623795c1 yet another error... 2019-02-14 10:29:23 +01:00
Pierre-Hugues HUSSON a2bc4e2e73
Merge pull request #95 from suwakowww/9.0-fpkey-sakura
Add sakura to fpkey patch
2019-02-13 10:45:04 +00:00
suwakowww eace5d9fac add sakura to fpkey patch 2019-02-13 14:30:09 +08:00
Pierre-Hugues HUSSON 05a001d7ef
Merge pull request #93 from v555574/android-9.0
Fixed Snapdragon 425 detection on Asus.
2019-02-11 13:19:36 +00:00
v555574 1173f56c80 Fixed Snapdragon 425 detection on Asus. 2019-02-11 16:06:02 +04:00
Pierre-Hugues HUSSON effd0207fd
Merge pull request #89 from eremitein/android-9.0
[xiaomi mi a2 lite] fix fingerprint gestures
2019-02-07 00:34:38 +01:00
Victor Bo 22004cf22b
[xiaomi mi a2 lite] fix fingerprint gestures
fix for fingerprint gestures like an another Xiaomi devices
2019-02-07 04:21:46 +05:00
Pierre-Hugues Husson f225a4336a typo 2019-02-06 00:52:54 +01:00
Pierre-Hugues HUSSON 9492b953b4
Merge pull request #86 from TadiT7/pie
Dehardcode status_bar_height in NoCutout overlay
2019-02-05 00:55:12 +01:00
Tadi 17c3643d02 Dehardcode status_bar_height in NoCutout overlay 2019-02-05 00:46:07 +01:00
Pierre-Hugues HUSSON 554a4eca13
Merge pull request #83 from penn5/patch-5
Fix camera in DND on Daisy
2019-02-05 00:21:08 +01:00
Pierre-Hugues HUSSON e13ff81289
Merge pull request #77 from penn5/patch-2
Fix offline charging on huameme
2019-01-30 20:04:36 +01:00
Hackintosh 5 888725c0ed Fix camera in DND on Daisy
It's an ugly workaround...
2019-01-30 14:58:34 +00:00
Pierre-Hugues Husson 01f68a446b Add vibrator-lge debug toy 2019-01-29 22:22:15 +01:00
Pierre-Hugues Husson 1423f94c17 Fix headphone and ril on Samsung qualcomm devices 2019-01-26 11:37:05 +01:00
Dil3mm4 cbf5a7891f Add MTK for USSD Fix 2019-01-26 11:37:05 +01:00
Pierre-Hugues Husson 4484ddd7f8 Try to fix Samsung boot with safedex 2019-01-26 11:37:04 +01:00
Pierre-Hugues Husson 7282bfa7ab Qualcomm samsung devices dont use devinput 2019-01-25 16:51:31 +01:00
Pierre-Hugues Husson 9716bf8591 Be compatible with AOSP master BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE
In that case, don't enforce system image size
We will need to implement after build checks to ensure we still work on
older devices
2019-01-17 15:49:46 +01:00
Pierre-Hugues Husson 70874ebb27 Merge branch 'wh0dat-patch-1' of https://github.com/wh0dat/device_phh_treble into android-9.0 2019-01-17 00:45:16 +01:00
Pierre-Hugues HUSSON 1b45c55c52
Merge pull request #79 from timbortnik/mimax3-nitrogen-fixes
xiaomi-mimax3-fix
2019-01-16 19:10:22 +01:00
Tim Bortnik 2acc50decb xiaomi-mimax3-fix 2019-01-15 21:24:21 +02:00
Pierre-Hugues HUSSON 31cfcc61d4
Merge pull request #78 from SKULSHADY/patch-1
Fix Havoc-OS common.mk path
2019-01-15 10:45:49 +01:00
wh0dat c3d94dd9ce
Added support for Motorola / Hannah
Thanks
2019-01-15 02:39:28 -06:00
Hackintosh 5 229c7d998b Fix bug 2019-01-14 17:09:57 +00:00
Anushek 700fd177f5
Fix common.mk path 2019-01-13 13:20:08 +05:30
Hackintosh 5 3edd4b1605 Makefile configuration for huawei charger 2019-01-11 19:05:42 +00:00
Hackintosh 5 e971fe6815 Add files for charge-only-mode on Huawei 2019-01-11 18:24:39 +00:00
Pierre-Hugues Husson 26a5b8fd13 Fix syntax 2019-01-08 14:39:22 +01:00
Pierre-Hugues HUSSON 4456ea4716
Merge pull request #76 from penn5/patch-1
Try to fix NFC on Huameme
2019-01-08 10:19:39 +01:00
Pierre-Hugues Husson 77071ff700 Bigger arm_a system.img 2019-01-07 22:16:32 +01:00
Hackintosh 5 e74f050278 Fix newlines 2019-01-04 16:53:52 +00:00
Hackintosh 5 fb31ebd929 Remove useless implementation and move upwards so that github no longer thinks there are merge conflicts 2019-01-04 16:52:15 +00:00
Hackintosh 5 6f52d92fee Use phh's style
eww
2019-01-04 16:45:59 +00:00
Hackintosh 5 a0c35d242e Fix for some devices 2019-01-04 16:36:15 +00:00
Hackintosh 5 e31f9ceec8 Revert "Add more specific check for correct model"
This reverts commit 91a4066603.
2019-01-04 15:46:51 +00:00
Hackintosh 5 91a4066603 Add more specific check for correct model 2019-01-04 15:28:22 +00:00
penn5 e3c3f6cec2 Add huawei nfc fix
thanks to @haky86 👍
2019-01-04 14:01:47 +00:00
penn5 3c9d658c9b Update base.mk
Copy libnfc-nci-huawei.conf
2019-01-04 14:01:47 +00:00
penn5 8be61ce138 Create libnfc-nci-huawei.conf 2019-01-04 14:01:44 +00:00
Pierre-Hugues Husson 21abdd8ad1 Fix Moto soundfx detection 2019-01-04 01:11:06 +01:00
Pierre-Hugues Husson ffbb81e84e Add (commented) debug mode for rw-system.sh 2019-01-04 01:11:06 +01:00
Pierre-Hugues Husson 251a51e6cf More permissions for phhsu_daemon selinux context 2019-01-04 01:11:06 +01:00
Pierre-Hugues Husson 5570d9a362 Add Moto E5 for soundfx disablers 2019-01-04 01:11:06 +01:00
Pierre-Hugues Husson c36e655745 On Exynos 7870, use old ABI behaviour for RILd 2019-01-04 01:11:06 +01:00
Pierre-Hugues Husson 652a658f83 Add Xiaomi Redmi S2, xiaomi/ysl 2018-12-28 16:33:23 +01:00
Pierre-Hugues Husson 5fd62bb4e7 Add op-fp command to debug op6t fingerprint 2018-12-27 14:46:19 +01:00
Pierre-Hugues Husson 97c4452e48 Also chown /data/misc/wifi/hostapd.conf
It has been seen on some devices (Huawei Y6) that the file is created by
something else than us to wifi:wifi, which means treble_app can't change
that file.
2018-12-27 10:46:21 +01:00
Pierre-Hugues Husson b421352529 Refactor Huawei detections. Hopefully it won't break stuff 2018-12-26 22:54:22 +01:00
Pierre-Hugues HUSSON 7f119746df
Merge pull request #74 from suwakowww/9.0-fix-equuleus
Fix broken sound for equuleus
2018-12-26 10:23:44 +01:00
suwakowww ad9b1b6b9f fix margin 2018-12-26 11:49:49 +08:00
suwakowww bcdbba8a0c fix broken sound for equuleus 2018-12-26 11:47:37 +08:00
Pierre-Hugues HUSSON b1f0485587
Merge pull request #73 from jamuir/android-9.0
Make audio jack work on LG V40 ThinQ
2018-12-21 18:58:10 +01:00
James Muir b0ddf1a61d Make audio jack work on LG V40 ThinQ 2018-12-21 12:18:01 -05:00
Pierre-Hugues HUSSON 789832c99e
Merge pull request #70 from TadiT7/patch-2
Fix the qs glitch on displays under sw372dp
2018-12-20 00:05:06 +01:00
Tadi d398e2bb43
Fix the qs glitch on displays under sw372dp 2018-12-19 23:47:13 +01:00
Pierre-Hugues HUSSON 09698c064e
Merge pull request #69 from TadiT7/intopr
Use 28dp statusbar in NoCutout overlay
2018-12-19 22:22:49 +01:00
Tadi 7f4c2d2a2a
Use 28dp statusbar in NoCutout overlay
All other cutout emulation overlays use this value and all of the known devices with notch are of 2:1 ratio or higher, so it makes ergonomical sense. Also helps with rounded corners.
2018-12-19 21:35:39 +01:00
Pierre-Hugues Husson 69541d380d [Sony Xperia (XZ1)] Fix brightness. Partial support for camera button 2018-12-16 22:04:04 +01:00
Pierre-Hugues Husson 25e6438ba5 Update twrp.sh OTA with xz and sparse image support 2018-12-09 23:24:26 +01:00
Pierre-Hugues Husson 14d7c12a97 Enable old hwui path for msm8917/37/40 2018-12-03 22:40:34 +01:00
Pierre-Hugues Husson dd40ddcf1c Merge branch 'android-9.0-mix3' of https://github.com/AndroPlus-org/device_phh_treble into android-9.0 2018-12-03 22:07:10 +01:00
Pierre-Hugues Husson 92db7539d0 Fix bootanim for some MTK devices 2018-12-03 22:06:32 +01:00
Pierre-Hugues Husson 2a5a8a8428 [phh-su] Makes su usable on devices without permissive context 2018-12-03 22:06:32 +01:00
Pierre-Hugues Husson 71cea41aa0 Install lightsctl and uevent debugging tools by default 2018-12-03 22:06:32 +01:00
Pierre-Hugues Husson 82aeb3d402 Fix adbd on devices with integrity check
Some devices (Like Samsung Galaxy J6) has integrity check.
This means that all files outside of /system are signed by the OEM.
Since we replaced /sbin/adbd, that's an issue.
Workaround this by creating a new service, called adbd_system, which
will called instead of /sbin/adbd when needed
2018-12-03 22:06:32 +01:00
Pierre-Hugues Husson c2b6687a5a Force ro.logd.auditd to true (set to false by Samsung vendor) 2018-12-03 22:06:32 +01:00
Pierre-Hugues Husson 07e05336c5 Commit fail 2018-12-03 22:06:32 +01:00
Pierre-Hugues HUSSON e4d017d370
Merge pull request #67 from suwakowww/9.0-fix-platina
Fix flickering brightness, broken sound and fingerpeint key for platina
2018-12-03 22:02:35 +01:00
suwakowww 3badf7271b revert to single line
I don't know why it will cause boot failed.
2018-11-29 16:04:09 +08:00
suwakowww 8d9236805e Update rw-system.sh
for platina
2018-11-29 08:37:48 +08:00
Pierre-Hugues HUSSON 9624f7053e
Merge pull request #63 from TadiT7/fix90
Fix everything about NoCutout overlay
2018-11-24 16:20:17 +01:00
AndroPlus 8e84551653 Set key as assist for Mi MIX 3 2018-11-23 21:14:55 +09:00
AndroPlus c3faca50d5 Fix fingerprint touch on Mi MIX 3 2018-11-23 20:37:18 +09:00
AndroPlus ebce78113a Add keylayout to use additional button on Mi MIX 3
AI button is useless in AOSP, so use it as camera key instead
2018-11-23 20:35:46 +09:00
Pierre-Hugues Husson c0ba937fd5 Revert "Also set build display id in etc/local.prop"
This reverts commit ab0defc922.

It didn't work
2018-11-21 10:07:08 +01:00
Tadi 56ebc198e8 Fix everything about NoCutout overlay 2018-11-19 19:49:00 +01:00
Pierre-Hugues Husson ab0defc922 Also set build display id in etc/local.prop 2018-11-18 22:36:00 +01:00
Pierre-Hugues Husson a605776eb2 Ignore vendor/etc/audio/* files (fixes audio for stupid CAF-based ROMs) 2018-11-18 22:36:00 +01:00
Pierre-Hugues Husson 296574000c Add phhgsi_a64_a for arm32 devices with 64bits binder 2018-11-18 22:36:00 +01:00
suwakowww 45e3d29136 add redmi note 5 (untested)
reported here: https://github.com/phhusson/treble_experimentations/wiki/Xiaomi-Redmi-Note-5---Note-5-Pro-%28India%29
2018-11-18 21:20:37 +01:00
suwakowww db77967142 add sakura and nitrogen to 12bit backlights 2018-11-18 21:20:37 +01:00
Enes Sastim 10d312ae87 create AEX makefile 2018-11-18 19:43:10 +01:00
Pierre-Hugues HUSSON 29cd139a53
Merge pull request #61 from solinium/android-9.0
add jasmine_sprout fp (experimental)
2018-11-11 22:38:13 +01:00
Alexander Gujral 1b84d4defc
remove camera section 2018-11-11 16:35:44 -05:00
Alexander Gujral c5afa54a51 add jasmine_sprout fp (experimental)
adding jasmine_sprout (Mi A2) for fingerprint files, should be same hardware as wayne
2018-11-11 14:05:07 -05:00
Pierre-Hugues Husson e5c1052d1a Add Xiaomi Mi Mix 3 in soundfx blacklist 2018-11-10 13:51:16 +01:00
Tadi 1d3bc574ef Add universal NoCutoutOverlay 2018-11-08 21:00:11 +01:00
Yunus İşleyen 86bc69de19 [Huawei P20 lite] Add workaround for laggy overview 2018-11-08 19:23:30 +01:00
Pierre-Hugues Husson 31e189a7d0 Add floating_feature.xml overwrite for S9/N9. Currently it declares Stereo feature 2018-11-06 20:58:37 +01:00
Pierre-Hugues Husson 0a49ccd8c0 Add additional mtk path 2018-11-06 20:28:18 +01:00
Pierre-Hugues Husson d13c4ff8d8 [Galaxy S/Note 9] Add workaround for laggy Recent apps (still unclear why) 2018-11-04 23:36:25 +01:00
Pierre-Hugues Husson 67839a24e2 [Galaxy Note 9] Fix improper S-Pen rotation 2018-11-04 18:20:25 +01:00
Asureus a1f4707dec Fix mixed FPC and Goodix sensors in Xiaomi Devices 2018-10-30 22:54:22 +01:00
James Muir 0874fd8bc3 Add missing "="
Fix the base64 encoded of the x509 cert for Google Webview.

You can check this by doing a base64-decode and then using openssl:

  openssl x509 -in gwv.der -inform DER -text -noout
2018-10-10 10:31:21 +02:00
Pierre-Hugues Husson 45587b3091 Pie changed product property. use vendor fingerprint 2018-10-08 22:39:42 +02:00
Pierre-Hugues Husson b10bbe19e6 Add Moto G6 in soundfx list
Fixes https://github.com/phhusson/treble_experimentations/issues/184
2018-10-05 23:04:15 +02:00
suwakowww 6593b10836 add fp key patch for wayne/jasmine
wayme and jasmine has two types fingerprint (fpc and goodix)
2018-10-03 17:36:20 +02:00
Pierre-Hugues Husson 5b04034d90 Include back fingerprint.kl, which has been removed after vendor/hardware_overlay cleanup 2018-10-02 23:56:42 +02:00
Pierre-Hugues Husson 15e037c977 Add uevent tool to dump uevent events 2018-10-01 10:54:12 +02:00
Pablo 3f8686cdd9 Ignore vendor SysuiDarkThemeOverlay.apk
Fixes buggy dark theme on jasmine
2018-09-29 13:39:06 +02:00
Pierre-Hugues Husson 2a042c184f Add "lightctl" tool to debug light HAL from root adb 2018-09-28 20:16:10 +02:00
Pierre-Hugues HUSSON 87b0d3de22
Merge pull request #45 from Dil3mm4/android-9.0 2018-09-27 17:05:37 +02:00
Dil3mm4 f489554e06 Huawei: Changing USB configuration to avoid HiSuite wasn't enough 2018-09-27 15:02:47 +00:00
Dil3mm4 4c768bd042 Huawei: Remove QC properties since Treble App it's now handling them 2018-09-27 15:02:47 +00:00
Dil3mm4 7fef1cb78b Huawei: set persist props to use platform specific fixes 2018-09-27 15:02:47 +00:00
suwakowww ec9d31fc7a Fix camera flash on Mi 6X / A2 (#46)
https://github.com/phhusson/treble_experimentations/issues/169
2018-09-26 12:01:10 +02:00
Pierre-Hugues Husson 1d4c8d2860 Add LG G7 Thinq for dev input jack 2018-09-19 14:55:16 +02:00
Pierre-Hugues Husson 6c4761261b Give back hostapd access to wifi_data_file 2018-09-19 13:46:22 +02:00
Pierre-Hugues Husson 57ba266b91 Ugly: Give TrebleApp write accesss to wifi configuration file
As part of O/O-MR1 vendor support for hostapd, an in-app IHostapd
implementation has been done. This needs to write to
/data/misc/wifi/hostapd.conf
/data/misc/wifi is originally in P writable only by wifi/wifi.
There is no easy way to gain "wifi" group access (though can be done
through platform.xml) from an app.
At the moment, all services requiring access to /data/misc/wifi are
running user "wifi", so this change is okay for the moment.
2018-09-19 10:39:47 +02:00
Pierre-Hugues Husson bb48e2b0fc https://github.com/phhusson/device_phh_treble/pull/39 2018-09-18 17:38:36 +02:00
Pierre-Hugues Husson 3a68ec19bc Declare framework-side hostapd (will be done by treble app) 2018-09-18 16:44:06 +02:00
Pierre-Hugues Husson 7e04bf3113 typo 2018-09-18 16:25:34 +02:00
Pierre-Hugues Husson b544b15e68 Get back to allowing "rild" universally
This requires to drop a checkpolicy, because checkpolicy doesn't allow
multiple identical domains definition, and "rild" will be defined both
in system and vendor.
This isn't optimal, but that's still the best solution I've found.
2018-09-18 11:16:19 +02:00
Pierre-Hugues Husson f446ad7290 Revert "Fix qti in-call audio on P vendor"
This reverts commit ef2dd1fb34.
This commit doesn't fix anything
2018-09-18 11:06:12 +02:00
Pierre-Hugues Husson 23fcb00111 Ignore vendor ims.apk if it uses Oreo APIs 2018-09-17 16:18:55 +02:00
Pierre-Hugues Husson 61f745995c Replace libnfc-nci.conf with Oreo's on Oreo vendor devices
As of pie the previous PRODUCT_COPY_FILES line was ignored because
it got copied from device/generic/common/nfc/libnfc-nci.conf instead
2018-09-17 14:10:29 +02:00
Pierre-Hugues Husson 07a370207f Drop the set -e, it is becoming too complicated to ensure it works 2018-09-17 14:09:59 +02:00
Pierre-Hugues Husson 515a55ee1d Delete Huawei Quickcharge init.rc scripts. It is now handled by Treble app 2018-09-17 14:09:30 +02:00
Pierre-Hugues Husson 051edbe6d7 Include wifi.hostapd hal to be implemented in java 2018-09-17 14:09:30 +02:00
Pierre-Hugues Husson 7c693d79cb When integrating phh-su, include me.phh.superuser 2018-09-17 14:09:30 +02:00
Arseniy Graur c34bc786ac Disable fingerprint "button" on Mi 8 2018-09-16 12:42:26 +02:00
Pierre-Hugues Husson 463ca03eac Disable fingerprint "button" on Mi 8 SE as well
Reported at https://forum.xda-developers.com/showpost.php?p=77620503&postcount=591
2018-09-14 21:09:02 +02:00
Pierre-Hugues Husson 3f1fb0d20b OP6: Keylayout to support dt2w 2018-09-10 00:32:11 +02:00
Pierre-Hugues Husson e064c6f310 Samsung has two android.hardware.power HAL. Take appropriate one.
Samsung includes both stock AOSP android.hardware.power service, and
their own vendor.samsung.hardware.miscpower.

Since the two HALs define the same full-qualified name, hwservicemanager
takes whichever comes last.

Using proper power HAL is needed for Samsung device to have proper sleep
of the touchscreen, and better power handling.
2018-09-09 21:53:31 +02:00
Alessandro Eppacher 229e74b438 Fix Xiaomi sound distortion on all devices
fix to remove entire lib64/soundfx directory, remove lib/soundfx as well
2018-09-08 19:21:29 +02:00
Alessandro Eppacher 64063c77c4 Fix typo in pocophone vendor fingerprint 2018-09-07 08:09:46 +02:00
sanshu ef2dd1fb34 Fix qti in-call audio on P vendor 2018-09-07 08:08:37 +02:00
Pierre-Hugues Husson fa5792249b Use OpenGL skia (!= skiagl) on PowerVR Rogue GE8100
cf https://github.com/phhusson/treble_experimentations/issues/173
2018-09-06 20:46:30 +02:00
Pierre-Hugues Husson 99633e904d Support reading /sys/board_properties/virtualkeys.xxx for virtual keys on touchscreen 2018-09-05 18:39:13 +02:00
Enes Sastim d925fea5f3 fix sound for polaris 2018-09-05 10:22:41 +02:00
Pierre-Hugues Husson 4dec3cf5e0 Include Xiaomi Mi 6X in 12bits backlight devices 2018-09-04 20:16:39 +02:00
Pierre-Hugues Husson c23e5cc98c Empty /vendor/lib64/soundfx on some Xiaomi devices, because it breaks sound rendering 2018-09-04 20:16:39 +02:00
Pierre-Hugues Husson f53a56ee1d Disable fingerprint buttons on Mi Mix 2S (cf bug #144) 2018-09-03 15:06:54 +02:00
Pierre-Hugues Husson 7afea6fe95 Override keylayouts on S9/Note9 to include assistant button, and hard press on home to wake up 2018-09-03 14:58:26 +02:00
Pierre-Hugues Husson 9fe3ec0ada Allow to add multiple inherit entries 2018-08-30 14:25:17 +02:00
Enes Sastim 31f2441e0e Havoc-P 2018-08-30 11:07:55 +02:00
Pierre-Hugues Husson 30e7c4af92 Fix FDE + MTK RIL fix 2018-08-29 20:36:21 +02:00
Pierre-Hugues Husson 3e655b7c4b Edit mtk-ril to fix incoming call
https://github.com/phhusson/treble_experimentations/issues/57#issuecomment-416998086
2018-08-29 18:30:35 +02:00
Pierre-Hugues Husson 5efefba2bc Add brightness fix for mipad 4 2018-08-29 16:34:14 +02:00
Pierre-Hugues Husson 95622e6a7b Fix MTK RIL by disablimg IMS and EPDG
This isn't ideal from a user point-of-view because the device will
reboot on first boot.

Thanks a lot @Dinolek !
2018-08-28 14:53:16 +02:00
Shadowghost 82b15278ba Update lineage.mk for LineageOS 16.0 2018-08-28 08:45:01 +02:00
Pierre-Hugues Husson 465f92f67f Include an XML to describe how to load interfaces java libs 2018-08-27 23:23:37 +02:00
Pierre-Hugues Husson bdda647078 empty mount vendor's dark theme 2018-08-27 10:25:27 +02:00
Pierre-Hugues Husson b038cf4143 Some devices declare boot hal, but doesn't have it. Put bootctl at the end until I get a better fix 2018-08-27 10:24:23 +02:00
Pierre-Hugues Husson 8d4e78370e Include current interfaces as framework jar, to be used by apps 2018-08-27 00:38:11 +02:00
Pierre-Hugues Husson be0b90541d We need to be setuid to allow transitions 2018-08-21 23:23:49 +02:00
Pierre-Hugues Husson b284445668 Allow vendor_init to load kernel modules 2018-08-21 12:07:18 +02:00
Pierre-Hugues Husson 17e27d8149 Add option to pass a path to an mk in generate.sh 2018-08-20 22:24:32 +02:00
Pierre-Hugues Husson 34e58e0456 Oops, delete useless changer 2018-08-20 21:10:00 +02:00
Pierre-Hugues Husson 59b9ac8d75 At the end of the day, Samsung keystore seem fine 2018-08-20 21:06:32 +02:00
Pierre-Hugues Husson 69a4b69ff7 Revert "Include consumerir feature, disable dynamically if not present"
This reverts commit 1936b6256e.

Many devices are not booting because of this, saying the feature is
present, but not the HAL.
I'm unsure why yet, but this feature is not worth the trouble.
2018-08-20 10:58:38 +02:00
Pierre-Hugues Husson 20d38353ee Some P goodies 2018-08-19 16:42:45 +02:00
Pierre-Hugues Husson 36c254eca4 Add qti.ims.ext context (will it conflict when it is in /vendor?) 2018-08-19 16:42:21 +02:00
Pierre-Hugues Husson 5f6b88c758 HACK: Allow access to 27 sphal on vndk 26. system will try to load 27's android.hidl.memory instead of 26's 2018-08-19 12:35:34 +02:00
Pierre-Hugues Husson cafafc5934 Fix QtiAudio 2018-08-17 23:43:53 +02:00
Pierre-Hugues Husson cef477ef5b As of P init, /mnt is noexec. Mount our own tmpfs 2018-08-17 13:33:31 +02:00
Pierre-Hugues Husson 572aad9d57 typo 2018-08-16 17:29:55 +02:00
Pierre-Hugues Husson df25576594 exfat fsck/mkfs selinux label 2018-08-16 17:14:13 +02:00
Pierre-Hugues Husson 3f96b1903b Include exfat if source is present 2018-08-16 17:00:28 +02:00
Pierre-Hugues Husson 986fa4cd0b Set usb aio compat for everyone
Too many different devices have this problem:
- Galaxy S9
- Razer phone
- Amlogic
2018-08-16 14:59:26 +02:00
Pierre-Hugues Husson b2586b17f6 Enable swipe up gesture (disabled by default) 2018-08-16 13:57:01 +02:00
Pierre-Hugues Husson ca106f5bec Fix boot on Huawei View 10 2018-08-15 12:26:01 +02:00
Pierre-Hugues Husson 59615488b1 Keystore is broken on S9 2018-08-14 20:02:41 +02:00
Pierre-Hugues Husson 6a1961a026 Galaxy S9 doesnt support asynchronous io on functionfs 2018-08-14 20:02:34 +02:00
Pierre-Hugues Husson bb592d860a Use AOSP ld.config.26.txt 2018-08-14 20:02:11 +02:00
Pierre-Hugues Husson d1a0b0b955 p wip 2018-08-12 23:41:19 +02:00
Pierre-Hugues Husson 45a98a37cc P WIP 2018-08-12 21:31:47 +02:00
Pierre-Hugues Husson 341d5d9e59 P WIP 2018-08-07 13:09:49 +02:00
Pierre-Hugues Husson c0fbb023db P WIP 2018-08-07 12:50:47 +02:00
Pierre-Hugues Husson 7b82dab9d2 P WIP 2018-08-07 12:49:42 +02:00
Pierre-Hugues Husson d19317f418 Revert "Decrease size of system partition"
This reverts commit 8eb18c7929.

Keeping this size is getting harder and harder
Sorry old devices...
2018-08-06 18:17:10 +02:00
Pierre-Hugues Husson 64b63dfc5c Fix tether for some Qualcomm devices [selinux part]
Fixes https://github.com/phhusson/treble_experimentations/issues/131
2018-08-02 15:01:10 +02:00
Pierre-Hugues Husson eb2b482ac2 Enable ambiant display for everyone 2018-08-01 00:40:28 +02:00
Pierre-Hugues Husson 6b9cb2af4d [twrp] Support Samsung partitions 2018-07-23 22:16:46 +02:00
Pierre-Hugues Husson 425290a949 typo 2018-07-23 21:37:40 +02:00
Pierre-Hugues Husson 9c37ec0bcd Off-computer updater/flasher for A-only without recovery
How to use:
- Push UNSPARSED system.img to /sdcard
- Create file /cache/phh/flash
- Create block.map:
$ uncrypt /data/media/0/system.img /cache/phh/block.map
- Reboot

This is done by copying /system to a tmpfs, then killing all services,
moving /system to /dev/old-system, unmounting it, then applying
uncrypt's block.map

Tested devices as of today:
- Blackview A20
- Huawei Mate 9
2018-07-23 15:38:12 +02:00
Pierre-Hugues Husson aea7c39d02 Add busybox
From https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-armv7l
2018-07-23 15:38:12 +02:00
Dil3mm4 475fc60e4b Missing renaming on service-cleaner
Related to commit aea1926
2018-07-20 15:39:38 +02:00
Pierre-Hugues Husson aea19262a0 Rename service-claner to phh-on-boot and move bootctl mark-boot-successful to phh-on-boot and add a conditional start 2018-07-18 23:48:33 +02:00
Pierre-Hugues Husson bb82498d1c Fix https://github.com/phhusson/treble_experimentations/issues/68 2018-07-17 18:03:15 +02:00
Dil3mm4 bbc4d30e85 Abolish Huawei HiSuite (and maybe other OEM stuff) (#19)
This is done by specifying default usb configuration
2018-07-15 14:18:35 +02:00
Dil3mm4 db80eb1c21 Differentiate QC values for HI6250 and HI36x0 platform (#18)
The previous set values are not compatible over HI6250 platform.
They were causing thermal issues.
This differentiation is needed to avoid the "hot-pan" occurrence.
Tested on ANE-LX1.
2018-07-09 08:29:30 +02:00
Pierre-Hugues Husson 361aedfd20 night mode is slow on mt6580 as well 2018-07-02 00:22:27 +02:00
Pierre-Hugues Husson 3711fd50e8 Detect Wifi 5G on MTK 2018-07-01 23:06:11 +02:00
Pierre-Hugues Husson 18fb7ed72f Night mode is awfull slow on Cubot X18 Plus. For the moment just blacklist the device, but needs to know whether this is the chipset, or chipset + screen 2018-07-01 23:05:18 +02:00
Pierre-Hugues Husson 9b1ab76f44 Add SELinux policy to access qualcomm audio HAL on Pixel-s 2018-06-29 00:31:19 +02:00
Pierre-Hugues HUSSON 6fedb4d2cb
Merge pull request #16 from notsyncing/android-8.1
Add NfcNci package to PRODUCT_PACKAGES
2018-06-24 15:57:43 +02:00
Song Fuchang 0b87f3f870
Add NfcNci package to PRODUCT_PACKAGES
This fixes NFC on LineageOS on Xiaomi MIX 2S.
2018-06-24 21:46:45 +08:00
Pierre-Hugues Husson c9b139187f Resize userdata on OP6
We'll probably want to do that for other devices as well
But this requires /data to be available at that time.
That's probably true only for FBE devices, not FDE.
Also, we might not want to do that on all devices
So for the moment, do it only on OP6
2018-06-15 15:03:06 +02:00
Pierre-Hugues Husson f099635304 Add config_webview_packages including both AOSP webview and gapps webview 2018-06-15 13:01:16 +02:00
Pierre-Hugues HUSSON efcc37ddb6
Merge pull request #12 from OldDroid/patch-2
Point to the real gapps overlay dir
2018-06-14 19:02:43 +02:00
Alexander Pohl 0fc7b6135b
Point to the real gapps overlay dir 2018-06-14 18:41:25 +02:00
Pierre-Hugues Husson 401eb2215a Add various framework-res values overlay 2018-06-11 22:44:10 +02:00
Pierre-Hugues Husson 7d3f700d19 Include some framework-res overrides for gapps 2018-06-11 22:41:14 +02:00
Pierre-Hugues Husson 19ce2265e5 Detect qcom extended brightness and set a property based on this, to be used by framework 2018-06-10 22:54:14 +02:00
Pierre-Hugues Husson c09149f86b fixSPL: More robust partition matching
OP6 has a partition called boot_aging. It would get matched instead of
boot_a when on slot A
2018-06-08 19:13:08 +02:00
Pierre-Hugues Husson 72e91c7933 Revert "Allowe system_app to access UEvent"
This reverts commit 615c724fee.

This doesn't compile, and actually I intented to target platform_app,
which already have this permission.
2018-06-07 16:46:16 +02:00
Pierre-Hugues Husson 615c724fee Allowe system_app to access UEvent 2018-06-07 14:30:47 +02:00
Pierre-Hugues Husson b01b148356 Mark slot as succesfully booted on boot completed
Fixes #55
2018-06-06 23:47:14 +02:00
Pierre-Hugues Husson 8ccedd2598 Typo for bootctl (thanks Jim_) 2018-06-06 15:28:28 +02:00
Pierre-Hugues Husson e486629583 Include "vintf" tool, useful to debug system/vendor mismatch 2018-06-06 15:28:07 +02:00
Pierre-Hugues Husson 7e5d147712 arm target uses binder32 vndk 2018-06-01 10:12:22 +02:00
Pierre-Hugues Husson ec16488612 SPL override for moar libs 2018-05-31 23:06:15 +02:00
Pierre-Hugues Husson a0ca96eeeb Include gitignore to ignore generated files 2018-05-27 13:52:16 +02:00
Pierre-Hugues Husson 60dd25356d Rename huawei/backlight overlay to huawei, because it will contain other values 2018-05-27 13:52:16 +02:00
Pierre-Hugues Husson a9a6cba4dd Force GPU profiling on Huawei as a work-around for rendering artifacts 2018-05-27 13:52:16 +02:00
Pierre-Hugues Husson 456b7b722a Include devinput overlay if qcom device 2018-05-26 13:32:44 +02:00
Pierre-Hugues Husson 6603eb0180 Build bootctl 2018-05-26 13:30:17 +02:00
Pierre-Hugues Husson 47ab64bbde Replace more softkeymaster, some 8.1 devicesrequires this 2018-05-26 11:26:33 +02:00
Pierre-Hugues Husson 639dd35ed5 [opengapps] Don't set google experimental camera features 2018-05-26 00:28:46 +02:00
Pierre-Hugues Husson 77157661cb Prefer round icon 2018-05-26 00:20:27 +02:00
Pierre-Hugues Husson 1474d2f0d2 De-dup file, this is set by vendor/hardware_overlay 2018-05-26 00:10:05 +02:00
Pierre-Hugues Husson 6db5159dda Let user decide whether he wants to disable LED 2018-05-20 01:20:23 +02:00
Pierre-Hugues Husson a70b26943b Don't fail script if resize2fs fails 2018-05-19 22:10:30 +02:00
Pierre-Hugues Husson 5125a91128 Enable AutoPowerModes
The doc says that this should be enabled only if you a GCM or something
alike. So possibly we don't want this on FOSS/Vanilla variant

Fixes https://github.com/phhusson/treble_experimentations/issues/40
2018-05-19 19:09:46 +02:00
Pierre-Hugues Husson 1b5659be4f Fix restart only when started 2018-05-19 18:43:25 +02:00
Pierre-Hugues Husson b139f72be4 Fix trustkernel keystore/gatekeerp
TEE requires that ro.product.model is either original, or "AOSP on armxx"
sed in-place
I had to move from /dev to /mnt, because /dev is nosuid
2018-05-19 16:54:30 +02:00
Pierre-Hugues Husson 63b2403f9f Enable Huawei fast/quick charge. Thanks @Flex1911 and @OldDroid 2018-05-19 15:49:45 +02:00
Pierre-Hugues Husson 1936b6256e Include consumerir feature, disable dynamically if not present 2018-05-19 13:40:50 +02:00
Pierre-Hugues Husson e5bf6a5c2a Allow system_server => su grep 2018-05-19 13:39:22 +02:00
Pierre-Hugues Husson bf886321ea Check if there is a fingerprint HAL before declaring fingerprint feature 2018-05-18 15:09:30 +02:00
Pierre-Hugues Husson a8ead1aa88 Fix Go suffix 2018-05-18 14:59:22 +02:00
Pierre-Hugues Husson 36e63f8a80 Move vndk include in generate.sh, to only include vndk32 in arm 2018-05-18 13:52:14 +02:00
Pierre-Hugues Husson eafd73a5e2 Don't dexpreopt gapps-go 2018-05-17 23:32:26 +02:00
Pierre-Hugues Husson f11d7c0a3a Add gapps-go variant 2018-05-17 22:20:52 +02:00
Pierre-Hugues Husson 1959f79e53 Set service-cleaner as oneshot 2018-05-17 22:20:52 +02:00
Pierre-Hugues Husson d746f760a0 Include more lineage stuff 2018-05-16 22:14:41 +02:00
Pierre-Hugues Husson 6b28c3f740 Set lower arm_a size (seen on Koolnee Rainbow) 2018-05-14 21:06:11 +02:00
Pierre-Hugues Husson 6eaf501e68 Include service-cleaner.sh which kills looping services 30s after boot 2018-05-14 17:25:03 +02:00
Pierre-Hugues Husson 71789c3977 empty-mount trustkernel keystore. It is not working for the moment 2018-05-14 13:39:17 +02:00
Pierre-Hugues Husson 08a31770cf I need an empty system file for later mount bind 2018-05-14 13:36:26 +02:00
Pierre-Hugues Husson 11cbdea0e9 Refactor fixSPL to prevent early exit 2018-05-14 13:34:52 +02:00
Pierre-Hugues Husson 903725538c Use Huawei backlight RRO when detecting a Huawei device 2018-05-02 23:38:24 +02:00
Pierre-Hugues Husson e59aa1bc35 Enable nightmode overlay by default 2018-05-01 23:38:34 +02:00
Pierre-Hugues Husson dbfa3c728e Fix wrong domain 2018-05-01 22:04:56 +02:00
Pierre-Hugues Husson 7527833d72 Give su hwbinder use 2018-05-01 21:44:29 +02:00
Pierre-Hugues Husson 29622ec3e3 Mount bind Huawei's fingerprint.kl 2018-04-30 13:56:06 +02:00
Pierre-Hugues Husson 14764f3afd Include fingerprint.kl suited for AOSP use. Thanks @OpenKirin team 2018-04-30 13:54:39 +02:00
Pierre-Hugues Husson 520fea111e Instead of patching properties, patch libs reading properties to get boot.imgs SPL 2018-04-25 22:18:38 +02:00
Pierre-Hugues HUSSON c2662ea37c
Merge pull request #7 from Zanooda/android-8.1
Bluetooth fix for Kirin 65x
2018-04-24 14:28:10 +02:00
Pierre-Hugues Husson 49d6d91f9c Fix f2fs on Huawei devices (Thanks @Flex1911 and @LuK1337) 2018-04-24 14:12:25 +02:00
Daniel Storozhev 61f0df3e71
Bluetooth fix for Kirin 65x
BTM_BYPASS_EXTRA_ACL_SETUP has to be true for Kirin 650/659 (aka hi6250) devices.
2018-04-23 13:34:39 +02:00
Pierre-Hugues Husson 01566efd3d Allow mediaextractor to read real sdcard 2018-04-16 23:33:58 +02:00
Pierre-Hugues Husson 7171b3215f Support me.phh.treble.qti.audio 2018-04-15 20:35:08 +02:00
Pierre-Hugues Husson 16ea168af4 Blind try at resizing/editing in A/B 2018-04-15 19:19:47 +02:00
317 changed files with 9709 additions and 243 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
.*.swp
treble_*mk
AndroidProducts.mk

4
aex.mk Normal file
View File

@ -0,0 +1,4 @@
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
$(call inherit-product, vendor/aosp/common.mk)
TARGET_BOOT_ANIMATION_RES := 1080

1
amyROM.mk Normal file
View File

@ -0,0 +1 @@
$(call inherit-product, vendor/amy/config/common.mk)

17
apex-setup.rc Normal file
View File

@ -0,0 +1,17 @@
import /system/etc/init/zygote/init.${ro.zygote}.rc
on early-fs
mkdir /mnt/runtime/full 0755 root root
mkdir /mnt/runtime/full/self 0755 root root
mkdir /apex 0777 root root
mount tmpfs tmpfs /apex mode=0755,uid=0,gid=0
restorecon /apex
exec -- /system/bin/apexd --bootstrap
export ANDROID_RUNTIME_ROOT /apex/com.android.runtime
export ANDROID_TZDATA_ROOT /apex/com.android.tzdata
symlink /system/product /product
on fs
exec u:r:su:s0 -- /system/bin/umount -l /product
exec u:r:su:s0 -- /system/bin/rmdir /product
symlink /system/product /product

13
base-sas.mk Normal file
View File

@ -0,0 +1,13 @@
PRODUCT_COPY_FILES += \
device/phh/treble/apex-setup.rc:system/etc/init/apex-setup.rc \
PRODUCT_COPY_FILES += \
system/core/rootdir/init.zygote32.rc:system/etc/init/zygote/init.zygote32.rc \
system/core/rootdir/init.zygote32_64.rc:system/etc/init/zygote/init.zygote32_64.rc \
system/core/rootdir/init.zygote64_32.rc:system/etc/init/zygote/init.zygote64_32.rc \
system/core/rootdir/init.zygote64.rc:system/etc/init/zygote/init.zygote64.rc \
PRODUCT_COPY_FILES += \
frameworks/av/apex/mediaswcodec.rc:system/etc/init/mediaswcodec-treble.rc \
device/phh/treble/environ/init.treble-environ.rc:system/etc/init/init.treble-environ.rc \

174
base.mk
View File

@ -2,16 +2,19 @@
#TODO: Proper detection
PRODUCT_COPY_FILES := \
frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
frameworks/native/data/etc/android.hardware.telephony.ims.xml:system/etc/permissions/android.hardware.telephony.ims.xml \
frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
#Use a more decent APN config
PRODUCT_COPY_FILES += \
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy
DEVICE_PACKAGE_OVERLAYS += device/phh/treble/overlay
PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay
$(call inherit-product, vendor/vndk/vndk.mk)
$(call inherit-product, vendor/hardware_overlay/overlay.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
@ -24,28 +27,181 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
ro.build.version.codename=$(PLATFORM_VERSION_CODENAME) \
ro.build.version.all_codenames=$(PLATFORM_VERSION_ALL_CODENAMES) \
ro.build.version.release=$(PLATFORM_VERSION) \
ro.adb.secure=0
ro.build.version.security_patch=$(PLATFORM_SECURITY_PATCH) \
ro.adb.secure=0 \
ro.logd.auditd=true
#Huawei HiSuite (also other OEM custom programs I guess) it's of no use in AOSP builds
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
persist.sys.usb.config=adb \
ro.cust.cdrom=/dev/null
#VNDK config files
PRODUCT_COPY_FILES += \
device/phh/treble/vndk-detect:system/bin/vndk-detect \
device/phh/treble/vndk.rc:system/etc/init/vndk.rc \
device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \
device/phh/treble/ld.config.27.txt:system/etc/ld.config.27.txt \
#USB Audio
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \
device/phh/treble/files/fake_audio_policy_volume.xml:system/etc/fake_audio_policy_volume.xml \
# NFC:
# Provide default libnfc-nci.conf file for devices that does not have one in
# vendor/etc
PRODUCT_COPY_FILES += \
device/phh/treble/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf
device/phh/treble/nfc/libnfc-nci.conf:system/phh/libnfc-nci-oreo.conf \
device/phh/treble/nfc/libnfc-nci-huawei.conf:system/phh/libnfc-nci-huawei.conf
# LineageOS build may need this to make NFC work
PRODUCT_PACKAGES += \
NfcNci \
PRODUCT_COPY_FILES += \
device/phh/treble/rw-system.sh:system/bin/rw-system.sh \
device/phh/treble/phh-on-data.sh:system/bin/phh-on-data.sh \
device/phh/treble/phh-prop-handler.sh:system/bin/phh-prop-handler.sh \
device/phh/treble/fixSPL/getSPL.arm:system/bin/getSPL
PRODUCT_COPY_FILES += \
device/phh/treble/empty:system/phh/empty \
device/phh/treble/phh-on-boot.sh:system/bin/phh-on-boot.sh
PRODUCT_PACKAGES += \
treble-environ-rc
treble-environ-rc \
PRODUCT_PACKAGES += \
bootctl \
vintf \
# Fix Offline Charging on Huawmeme
PRODUCT_PACKAGES += \
huawei-charger
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,device/phh/treble/huawei_charger/files,system/etc/charger)
PRODUCT_COPY_FILES += \
device/phh/treble/twrp/twrp.rc:system/etc/init/twrp.rc \
device/phh/treble/twrp/twrp.sh:system/bin/twrp.sh \
device/phh/treble/twrp/busybox-armv7l:system/bin/busybox_phh
PRODUCT_PACKAGES += \
simg2img_simple \
lptools
ifneq (,$(wildcard external/exfat))
PRODUCT_PACKAGES += \
mkfs.exfat \
fsck.exfat
endif
PRODUCT_PACKAGES += \
android.hidl.manager-V1.0-java \
android.hardware.wifi.hostapd-V1.0-java \
vendor.huawei.hardware.biometrics.fingerprint-V2.1-java \
vendor.huawei.hardware.tp-V1.0-java \
vendor.qti.hardware.radio.am-V1.0-java \
vendor.qti.qcril.am-V1.0-java \
PRODUCT_COPY_FILES += \
device/phh/treble/interfaces.xml:system/etc/permissions/interfaces.xml
PRODUCT_COPY_FILES += \
device/phh/treble/files/samsung-gpio_keys.kl:system/phh/samsung-gpio_keys.kl \
device/phh/treble/files/samsung-sec_touchscreen.kl:system/phh/samsung-sec_touchscreen.kl \
device/phh/treble/files/samsung-sec_touchkey.kl:system/phh/samsung-sec_touchkey.kl \
device/phh/treble/files/oneplus6-synaptics_s3320.kl:system/phh/oneplus6-synaptics_s3320.kl \
device/phh/treble/files/huawei-fingerprint.kl:system/phh/huawei/fingerprint.kl \
device/phh/treble/files/samsung-sec_e-pen.idc:system/usr/idc/sec_e-pen.idc \
device/phh/treble/files/samsung-9810-floating_feature.xml:system/ph/sam-9810-flo_feat.xml \
device/phh/treble/files/mimix3-gpio-keys.kl:system/phh/mimix3-gpio-keys.kl \
device/phh/treble/files/nokia-soc_gpio_keys.kl:system/phh/nokia-soc_gpio_keys.kl \
device/phh/treble/files/lenovo-synaptics_dsx.kl:system/phh/lenovo-synaptics_dsx.kl \
device/phh/treble/files/oppo-touchpanel.kl:system/phh/oppo-touchpanel.kl \
device/phh/treble/files/google-uinput-fpc.kl:system/phh/google-uinput-fpc.kl \
device/phh/treble/files/moto-uinput-egis.kl:system/phh/moto-uinput-egis.kl \
device/phh/treble/files/daisy-buttonJack.kl:system/phh/daisy-buttonJack.kl \
device/phh/treble/files/daisy-uinput-fpc.kl:system/phh/daisy-uinput-fpc.kl \
device/phh/treble/files/daisy-uinput-goodix.kl:system/phh/daisy-uinput-goodix.kl \
device/phh/treble/files/nubia-nubia_synaptics_dsx.kl:system/phh/nubia-nubia_synaptics_dsx.kl \
device/phh/treble/files/unihertz-mtk-kpd.kl:system/phh/unihertz-mtk-kpd.kl \
device/phh/treble/files/unihertz-mtk-tpd.kl:system/phh/unihertz-mtk-tpd.kl \
device/phh/treble/files/unihertz-mtk-tpd-kpd.kl:system/phh/unihertz-mtk-tpd-kpd.kl \
device/phh/treble/files/unihertz-fingerprint_key.kl:system/phh/unihertz-fingerprint_key.kl \
device/phh/treble/files/zf6-goodixfp.kl:system/phh/zf6-goodixfp.kl \
device/phh/treble/files/zf6-googlekey_input.kl:system/phh/zf6-googlekey_input.kl \
device/phh/treble/files/teracube2e-mtk-kpd.kl:system/phh/teracube2e-mtk-kpd.kl \
SELINUX_IGNORE_NEVERALLOWS := true
# Universal NoCutoutOverlay
PRODUCT_PACKAGES += \
NoCutoutOverlay
PRODUCT_PACKAGES += \
lightsctl \
uevent
PRODUCT_COPY_FILES += \
device/phh/treble/files/adbd.rc:system/etc/init/adbd.rc
#MTK incoming SMS fix
PRODUCT_PACKAGES += \
mtk-sms-fwk-ready
# Helper to debug Xiaomi motorized camera
PRODUCT_PACKAGES += \
xiaomi-motor \
oneplus-motor
PRODUCT_PACKAGES += \
Stk
PRODUCT_PACKAGES += \
resetprop_phh
PRODUCT_COPY_FILES += \
device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
device/phh/treble/files/ota.sh:system/bin/ota.sh \
PRODUCT_COPY_FILES += \
device/phh/treble/remove-telephony.sh:system/bin/remove-telephony.sh \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.secure_lock_screen.xml:system/etc/permissions/android.software.secure_lock_screen.xml \
device/phh/treble/files/android.software.controls.xml:system/etc/permissions/android.software.controls.xml \
PRODUCT_COPY_FILES += \
device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \
PRODUCT_PACKAGES += \
asus-motor
# Privapp-permissions whitelist for PhhTrebleApp
PRODUCT_COPY_FILES += \
device/phh/treble/privapp-permissions-me.phh.treble.app.xml:system/etc/permissions/privapp-permissions-me.phh.treble.app.xml
# Remote debugging
PRODUCT_COPY_FILES += \
device/phh/treble/remote/dbclient:system/bin/dbclient \
device/phh/treble/remote/phh-remotectl.rc:system/etc/init/phh-remotectl.rc \
device/phh/treble/remote/phh-remotectl.sh:system/bin/phh-remotectl.sh \
PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint@2.1-service.oppo.compat \
android.hardware.biometrics.fingerprint@2.1-service.oplus.compat \
PRODUCT_PACKAGES += \
vr_hwc \
curl \
healthd \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
debug.fdsan=warn_once \
# AOSP overlays
PRODUCT_PACKAGES += \
NavigationBarMode2ButtonOverlay
PRODUCT_PACKAGES += \
oplus-alert-slider

View File

@ -21,11 +21,12 @@
#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H
#include <cutils/properties.h>
//#include <cutils/properties.h>
#include <string.h>
static inline const char* BtmDefLocalName()
{
#if 0
static char product_device[PROPERTY_VALUE_MAX];
//Huawei-defined property
property_get("ro.config.marketing_name", product_device, "");
@ -35,11 +36,16 @@ static inline const char* BtmDefLocalName()
// Fallback to ro.product.model
return "";
#endif
return "hello";
}
static inline bool BtmBypassExtraAclSetup() {
static inline int BtmBypassExtraAclSetup() {
#if 0
int8_t prop = property_get_bool("persist.sys.bt_acl_bypass", false);
return prop == true;
#endif
return 1;
}
#define BTM_DEF_LOCAL_NAME BtmDefLocalName()

View File

@ -1,3 +1,6 @@
TARGET_SYSTEM_PROP := device/phh/treble/system.prop $(TARGET_SYSTEM_PROP)
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/phh/treble/bluetooth
TARGET_EXFAT_DRIVER := exfat
DEVICE_FRAMEWORK_MANIFEST_FILE := device/phh/treble/framework_manifest.xml
BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs

265
cmds/Android.bp Normal file
View File

@ -0,0 +1,265 @@
cc_binary {
name: "lightsctl",
srcs: [
"lightsctl.cpp",
],
shared_libs: [
"android.hardware.light@2.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "op-fp",
srcs: [
"op-fp.cpp",
],
shared_libs: [
"vendor.oneplus.fingerprint.extension@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "uevent",
srcs: [
"uevent.cpp",
],
}
cc_binary {
name: "simg2img_simple",
srcs: [
"simg2img_simple.cpp",
],
host_supported: true,
}
cc_binary {
name: "vibrator-lge",
srcs: [
"vibrator-lge.cpp",
],
shared_libs: [
"vendor.lge.hardware.vibrator@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "mtk-sms-fwk-ready",
srcs: [
"mtk-sms-fwk-ready.cpp",
],
shared_libs: [
"vendor.mediatek.hardware.radio@2.6",
"libutils",
"libhidlbase",
],
init_rc: [
"mtk-sms-fwk-ready.rc"
],
}
cc_binary {
name: "xiaomi-display-feature",
srcs: [
"xiaomi-display-feature.cpp",
],
shared_libs: [
"vendor.xiaomi.hardware.displayfeature@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "xiaomi-fp",
srcs: [
"xiaomi-fp.cpp",
],
shared_libs: [
"vendor.xiaomi.hardware.fingerprintextension@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "lightsctl-sec",
srcs: [
"lightsctl-sec.cpp",
],
shared_libs: [
"vendor.samsung.hardware.light@2.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "lightsctl-seh",
srcs: [
"lightsctl-seh.cpp",
],
shared_libs: [
"vendor.samsung.hardware.light@3.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "xiaomi-motor",
srcs: [
"xiaomi-motor.cpp",
],
shared_libs: [
"vendor.xiaomi.hardware.motor@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "oneplus-motor",
srcs: [
"oneplus-motor.cpp",
],
shared_libs: [
"vendor.oneplus.hardware.motorcontrol@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "persistprops",
srcs: [
"persistent_properties.proto",
"persistprops.cpp",
],
static_executable: true,
proto: {
type: "lite",
static: true,
},
static_libs: [
"libprotobuf-cpp-lite"
],
}
cc_binary {
name: "lightsctl-huawei",
srcs: [
"lightsctl-huawei.cpp",
],
shared_libs: [
"vendor.huawei.hardware.light@2.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "asus-motor",
srcs: [
"asus-motor.cpp",
],
}
cc_binary {
name: "goodix-fp",
srcs: [
"goodix-fp.cpp",
],
shared_libs: [
"vendor.goodix.extend.service@2.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "lptools",
cflags: [
"-Werror",
"-Wextra",
],
device_supported: true,
shared_libs: [
"libbase",
"liblog",
"liblp",
"libsparse",
"libfs_mgr",
"libutils",
"libcutils",
"android.hardware.boot@1.1",
"libhidlbase",
],
static_libs: [
"libdm",
],
srcs: [
"lptools.cc",
],
cppflags: [
"-D_FILE_OFFSET_BITS=64",
],
}
cc_binary {
name: "lptools_static",
cflags: [
"-Werror",
"-Wextra",
"-DLPTOOLS_STATIC",
],
device_supported: true,
shared_libs: [
"libcrypto",
],
static_libs: [
"libbase",
"liblog",
"liblp",
"libsparse",
"libfs_mgr",
"libutils",
"libcutils",
"libdm",
"libext4_utils",
],
srcs: [
"lptools.cc",
],
cppflags: [
"-D_FILE_OFFSET_BITS=64",
],
}
cc_binary {
name: "sec-camera-list",
srcs: [
"sec-camera-list.cpp",
],
shared_libs: [
"vendor.samsung.hardware.camera.provider@3.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "oplus-alert-slider",
srcs: [
"oplus-alert-slider.cpp",
],
init_rc: [
"oplus-alert-slider.rc",
],
}

30
cmds/asus-motor.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
typedef struct {
int dir;
int angle;
int speed;
} motorDrvManualConfig_t;
#define ASUS_MOTOR_NAME_SIZE 32
#define ASUS_MOTOR_DATA_SIZE 4
#define ASUS_MOTOR_DRV_DEV_PATH ("/dev/asusMotoDrv")
#define ASUS_MOTOR_DRV_IOC_MAGIC ('M')
#define ASUS_MOTOR_DRV_AUTO_MODE _IOW(ASUS_MOTOR_DRV_IOC_MAGIC, 1, int)
#define ASUS_MOTOR_DRV_MANUAL_MODE _IOW(ASUS_MOTOR_DRV_IOC_MAGIC, 2, motorDrvManualConfig_t)
int main(int argc, char **argv) {
if(argc != 2) return 1;
int fd = open("/dev/asusMotoDrv", O_RDWR);
motorDrvManualConfig_t cfg;
cfg.dir = atoi(argv[1]);
cfg.angle = 180;
cfg.speed = 4;
ioctl(fd, ASUS_MOTOR_DRV_MANUAL_MODE, &cfg);
}

17
cmds/goodix-fp.cpp Normal file
View File

@ -0,0 +1,17 @@
#include <iostream>
#include <vendor/goodix/extend/service/2.0/IGoodixFPExtendService.h>
using ::vendor::goodix::extend::service::V2_0::IGoodixFPExtendService;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IGoodixFPExtendService::getService();
if(argc!=3) return 1;
int a = atoi(argv[1]);
int b = atoi(argv[2]);
auto ret = svc->goodixExtendCommand(a, b);
if(!ret.isOk()) {
std::cerr << "HWBinder call failed" << std::endl;
}
std::cout << "updateStatus returned " << toString(ret) << std::endl;
}

38
cmds/lightsctl-huawei.cpp Normal file
View File

@ -0,0 +1,38 @@
#include <iostream>
#include <vendor/huawei/hardware/light/2.0/ILight.h>
#include <android/hardware/light/2.0/types.h>
using ::vendor::huawei::hardware::light::V2_0::ILight;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ILight::getService();
svc->HWgetSupportedTypes([](auto types) {
for(const auto& type: types) {
std::cout << "Got type " << type << std::endl;
}
});
uint32_t a = (uint32_t)strtoll(argv[1], NULL, 10);
android::hardware::light::V2_0::LightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
state.brightnessMode = android::hardware::light::V2_0::Brightness::USER;
if(argc == 6) {
std::string flashArg(argv[3]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::V2_0::Flash::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::V2_0::Flash::HARDWARE;
state.flashOnMs = atoi(argv[4]);
state.flashOffMs = atoi(argv[5]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
svc->HWsetLight(a, state);
}

59
cmds/lightsctl-sec.cpp Normal file
View File

@ -0,0 +1,59 @@
#include <iostream>
#include <vendor/samsung/hardware/light/2.0/ISecLight.h>
#include <vendor/samsung/hardware/light/2.0/types.h>
using ::vendor::samsung::hardware::light::V2_0::ISecLight;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISecLight::getService();
svc->getSupportedTypes([](auto types) {
for(const auto& type: types) {
std::cout << "Got type " << toString(type) << std::endl;
}
});
if(argc <= 1) return 0;
if(argc != 3 && argc != 6) return 1;
std::string typeArg(argv[1]);
vendor::samsung::hardware::light::V2_0::SecType type;
if(typeArg == "BACKLIGHT")
type = vendor::samsung::hardware::light::V2_0::SecType::BACKLIGHT;
if(typeArg == "KEYBOARD")
type = vendor::samsung::hardware::light::V2_0::SecType::KEYBOARD;
if(typeArg == "BUTTONS")
type = vendor::samsung::hardware::light::V2_0::SecType::BUTTONS;
if(typeArg == "BATTERY")
type = vendor::samsung::hardware::light::V2_0::SecType::BATTERY;
if(typeArg == "NOTIFICATIONS")
type = vendor::samsung::hardware::light::V2_0::SecType::NOTIFICATIONS;
if(typeArg == "ATTENTION")
type = vendor::samsung::hardware::light::V2_0::SecType::ATTENTION;
if(typeArg == "BLUETOOTH")
type = vendor::samsung::hardware::light::V2_0::SecType::BLUETOOTH;
if(typeArg == "WIFI")
type = vendor::samsung::hardware::light::V2_0::SecType::WIFI;
std::cout << "Set request type " << toString(type) << std::endl;
android::hardware::light::V2_0::LightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
state.brightnessMode = android::hardware::light::V2_0::Brightness::USER;
if(argc == 6) {
std::string flashArg(argv[3]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::V2_0::Flash::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::V2_0::Flash::HARDWARE;
state.flashOnMs = atoi(argv[4]);
state.flashOffMs = atoi(argv[5]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
auto ret = svc->setLightSec(type, state);
std::cout << "Set light returned " << toString(ret) << std::endl;
}

62
cmds/lightsctl-seh.cpp Normal file
View File

@ -0,0 +1,62 @@
#include <iostream>
#include <vendor/samsung/hardware/light/3.0/ISehLight.h>
#include <vendor/samsung/hardware/light/3.0/types.h>
using ::vendor::samsung::hardware::light::V3_0::ISehLight;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISehLight::getService();
svc->getSupportedTypes([](auto types) {
for(const auto& type: types) {
std::cout << "Got type " << toString(type) << std::endl;
}
});
if(argc <= 1) return 0;
if(argc != 4 && argc != 7) return 1;
std::string typeArg(argv[1]);
vendor::samsung::hardware::light::V3_0::SehType type;
if(typeArg == "BACKLIGHT")
type = vendor::samsung::hardware::light::V3_0::SehType::BACKLIGHT;
if(typeArg == "KEYBOARD")
type = vendor::samsung::hardware::light::V3_0::SehType::KEYBOARD;
if(typeArg == "BUTTONS")
type = vendor::samsung::hardware::light::V3_0::SehType::BUTTONS;
if(typeArg == "BATTERY")
type = vendor::samsung::hardware::light::V3_0::SehType::BATTERY;
if(typeArg == "NOTIFICATIONS")
type = vendor::samsung::hardware::light::V3_0::SehType::NOTIFICATIONS;
if(typeArg == "ATTENTION")
type = vendor::samsung::hardware::light::V3_0::SehType::ATTENTION;
if(typeArg == "BLUETOOTH")
type = vendor::samsung::hardware::light::V3_0::SehType::BLUETOOTH;
if(typeArg == "WIFI")
type = vendor::samsung::hardware::light::V3_0::SehType::WIFI;
if(typeArg == "SUB_BACKLIGHT")
type = vendor::samsung::hardware::light::V3_0::SehType::SUB_BACKLIGHT;
std::cout << "Set request type " << toString(type) << std::endl;
vendor::samsung::hardware::light::V3_0::SehLightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
state.brightnessMode = android::hardware::light::V2_0::Brightness::USER;
state.extendedBrightness = (uint32_t)strtoll(argv[3], NULL, 0);
if(argc == 7) {
std::string flashArg(argv[4]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::V2_0::Flash::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::V2_0::Flash::HARDWARE;
state.flashOnMs = atoi(argv[5]);
state.flashOffMs = atoi(argv[6]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
auto ret = svc->sehSetLight(type, state);
std::cout << "Set light returned " << toString(ret) << std::endl;
}

59
cmds/lightsctl.cpp Normal file
View File

@ -0,0 +1,59 @@
#include <iostream>
#include <android/hardware/light/2.0/ILight.h>
#include <android/hardware/light/2.0/types.h>
using ::android::hardware::light::V2_0::ILight;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ILight::getService();
svc->getSupportedTypes([](auto types) {
for(const auto& type: types) {
std::cout << "Got type " << toString(type) << std::endl;
}
});
if(argc <= 1) return 0;
if(argc != 3 && argc != 6) return 1;
std::string typeArg(argv[1]);
android::hardware::light::V2_0::Type type;
if(typeArg == "BACKLIGHT")
type = android::hardware::light::V2_0::Type::BACKLIGHT;
if(typeArg == "KEYBOARD")
type = android::hardware::light::V2_0::Type::KEYBOARD;
if(typeArg == "BUTTONS")
type = android::hardware::light::V2_0::Type::BUTTONS;
if(typeArg == "BATTERY")
type = android::hardware::light::V2_0::Type::BATTERY;
if(typeArg == "NOTIFICATIONS")
type = android::hardware::light::V2_0::Type::NOTIFICATIONS;
if(typeArg == "ATTENTION")
type = android::hardware::light::V2_0::Type::ATTENTION;
if(typeArg == "BLUETOOTH")
type = android::hardware::light::V2_0::Type::BLUETOOTH;
if(typeArg == "WIFI")
type = android::hardware::light::V2_0::Type::WIFI;
std::cout << "Set request type " << toString(type) << std::endl;
android::hardware::light::V2_0::LightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
state.brightnessMode = android::hardware::light::V2_0::Brightness::USER;
if(argc == 6) {
std::string flashArg(argv[3]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::V2_0::Flash::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::V2_0::Flash::HARDWARE;
state.flashOnMs = atoi(argv[4]);
state.flashOffMs = atoi(argv[5]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
auto ret = svc->setLight(type, state);
std::cout << "Set light returned " << toString(ret) << std::endl;
}

309
cmds/lptools.cc Normal file
View File

@ -0,0 +1,309 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <getopt.h>
#include <inttypes.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/types.h>
#include <sysexits.h>
#include <unistd.h>
#include <iostream>
#include <optional>
#include <regex>
#include <string>
#include <vector>
#include <chrono>
#include <android-base/parseint.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <cutils/android_get_control_file.h>
#include <fs_mgr.h>
#include <liblp/builder.h>
#include <liblp/liblp.h>
#include <fs_mgr_dm_linear.h>
#include <libdm/dm.h>
#ifndef LPTOOLS_STATIC
#include <android/hardware/boot/1.1/IBootControl.h>
#include <android/hardware/boot/1.1/types.h>
#endif
using namespace android;
using namespace android::fs_mgr;
class FileOrBlockDeviceOpener final : public PartitionOpener {
public:
android::base::unique_fd Open(const std::string& path, int flags) const override {
// Try a local file first.
android::base::unique_fd fd;
#ifdef __ANDROID__
fd.reset(android_get_control_file(path.c_str()));
if (fd >= 0) return fd;
#endif
fd.reset(open(path.c_str(), flags));
if (fd >= 0) return fd;
return PartitionOpener::Open(path, flags);
}
};
static FileOrBlockDeviceOpener opener;
std::unique_ptr<MetadataBuilder> makeBuilder() {
auto builder = MetadataBuilder::New(opener, "super", 0);
if(builder == nullptr) {
std::cout << "Failed creating super builder" << std::endl;
}
return builder;
}
void saveToDisk(std::unique_ptr<MetadataBuilder> builder) {
auto newMetadata = builder->Export();
int nSlots = 2;//pt->geometry.metadata_slot_count;
for(int slot=0; slot < nSlots; slot++) {
std::cout << "Saving the updated partition table " << UpdatePartitionTable(opener, "super", *newMetadata, slot) << " for slot " << slot << std::endl;
}
}
inline bool ends_with(std::string const & value, std::string const & ending)
{
if (ending.size() > value.size()) return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}
std::string findGroup(std::unique_ptr<MetadataBuilder>& builder) {
auto groups = builder->ListGroups();
auto partitionName = "system" + ::android::base::GetProperty("ro.boot.slot_suffix", "");
for(auto groupName: groups) {
auto partitions = builder->ListPartitionsInGroup(groupName);
for (const auto& partition : partitions) {
if(partition->name() == partitionName) {
return groupName;
}
}
}
std::string maxGroup = "";
uint64_t maxGroupSize = 0;
for(auto groupName: groups) {
auto group = builder->FindGroup(groupName);
if(group->maximum_size() > maxGroupSize) {
maxGroup = groupName;
maxGroupSize = group->maximum_size();
}
}
return maxGroup;
}
int main(int argc, char **argv) {
if(argc<=1) {
std::cerr << "Usage: " << argv[0] << " <create|remove|resize|rename>" << std::endl;
exit(1);
}
auto builder = makeBuilder();
auto group = findGroup(builder);
std::cout << "Best group seems to be " << group << std::endl;
if(strcmp(argv[1], "create") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " create <partition name> <partition size>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto size = strtoll(argv[3], NULL, 0);
auto partition = builder->FindPartition(partName);
if(partition != nullptr) {
std::cerr << "Partition " << partName << " already exists." << std::endl;
exit(1);
}
partition = builder->AddPartition(partName, group, 0);
auto result = builder->ResizePartition(partition, size);
std::cout << "Growing partition " << result << std::endl;
if(!result) return 1;
saveToDisk(std::move(builder));
std::string dmPath;
CreateLogicalPartitionParams params {
.block_device = "/dev/block/by-name/super",
.metadata_slot = 0,
.partition_name = partName,
.timeout_ms = std::chrono::milliseconds(10000),
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0);
} else if(strcmp(argv[1], "remove") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " remove <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName);
}
builder->RemovePartition(partName);
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "resize") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " resize <partition name> <newsize>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto size = strtoll(argv[3], NULL, 0);
auto partition = builder->FindPartition(partName);
std::cout << "Resizing partition " << builder->ResizePartition(partition, size) << std::endl;
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "replace") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " replace <original partition name> <new partition name>" << std::endl;
std::cerr << "This will delete <new partition name> and rename <original partition name> to <new partition name>" << std::endl;
exit(1);
}
auto src = argv[2];
auto dst = argv[3];
auto srcPartition = builder->FindPartition(src);
if(srcPartition == nullptr) {
srcPartition = builder->FindPartition(src + ::android::base::GetProperty("ro.boot.slot_suffix", ""));
}
auto dstPartition = builder->FindPartition(dst);
if(dstPartition == nullptr) {
dstPartition = builder->FindPartition(dst + ::android::base::GetProperty("ro.boot.slot_suffix", ""));
}
std::string dstPartitionName = dst;
if(dstPartition != nullptr) {
dstPartitionName = dstPartition->name();
}
std::vector<std::unique_ptr<Extent>> originalExtents;
const auto& extents = srcPartition->extents();
for(unsigned i=0; i<extents.size(); i++) {
const auto& extend = extents[i];
auto linear = extend->AsLinearExtent();
if(linear != nullptr) {
auto copyLinear = std::make_unique<LinearExtent>(linear->num_sectors(), linear->device_index(), linear->physical_sector());
originalExtents.push_back(std::move(copyLinear));
} else {
auto copyZero = std::make_unique<ZeroExtent>(extend->num_sectors());
originalExtents.push_back(std::move(copyZero));
}
}
builder->RemovePartition(srcPartition->name());
builder->RemovePartition(dstPartitionName);
auto newDstPartition = builder->AddPartition(dstPartitionName, group, 0);
for(auto&& extent: originalExtents) {
newDstPartition->AddExtent(std::move(extent));
}
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "map") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " map <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
std::string dmPath;
CreateLogicalPartitionParams params {
.block_device = "/dev/block/by-name/super",
.metadata_slot = 0,
.partition_name = partName,
.timeout_ms = std::chrono::milliseconds(10000),
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0);
} else if(strcmp(argv[1], "unmap") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " unmap <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName);
}
exit(0);
} else if(strcmp(argv[1], "free") == 0) {
if(argc != 2) {
std::cerr << "Usage: " << argv[0] << " free" << std::endl;
exit(1);
}
auto groupO = builder->FindGroup(group);
uint64_t maxSize = groupO->maximum_size();
uint64_t total = 0;
auto partitions = builder->ListPartitionsInGroup(group);
for (const auto& partition : partitions) {
total += partition->BytesOnDisk();
}
uint64_t groupAllocatable = maxSize - total;
uint64_t superFreeSpace = builder->AllocatableSpace() - builder->UsedSpace();
if(groupAllocatable > superFreeSpace || maxSize == 0)
groupAllocatable = superFreeSpace;
printf("Free space: %" PRIu64 "\n", groupAllocatable);
exit(0);
} else if(strcmp(argv[1], "unlimited-group") == 0) {
builder->ChangeGroupSize(group, 0);
saveToDisk(std::move(builder));
return 0;
} else if(strcmp(argv[1], "clear-cow") == 0) {
#ifndef LPTOOLS_STATIC
// Ensure this is a V AB device, and that no merging is taking place (merging? in gsi? uh)
auto svc1_1 = ::android::hardware::boot::V1_1::IBootControl::tryGetService();
if(svc1_1 == nullptr) {
std::cerr << "Couldn't get a bootcontrol HAL. You can clear cow only on V AB devices" << std::endl;
return 1;
}
auto mergeStatus = svc1_1->getSnapshotMergeStatus();
if(mergeStatus != ::android::hardware::boot::V1_1::MergeStatus::NONE) {
std::cerr << "Merge status is NOT none, meaning a merge is pending. Clearing COW isn't safe" << std::endl;
return 1;
}
#endif
uint64_t superFreeSpace = builder->AllocatableSpace() - builder->UsedSpace();
std::cerr << "Super allocatable " << superFreeSpace << std::endl;
uint64_t total = 0;
auto partitions = builder->ListPartitionsInGroup("cow");
for (const auto& partition : partitions) {
std::cout << "Deleting partition? " << partition->name() << std::endl;
if(ends_with(partition->name(), "-cow")) {
std::cout << "Deleting partition " << partition->name() << std::endl;
builder->RemovePartition(partition->name());
}
}
saveToDisk(std::move(builder));
return 0;
}
return 0;
}

View File

@ -0,0 +1,12 @@
#include <iostream>
#include <unistd.h>
#include <vendor/mediatek/hardware/radio/2.6/IRadio.h>
using ::vendor::mediatek::hardware::radio::V2_6::IRadio;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IRadio::getService(argv[1]);
if(svc != nullptr)
svc->setSmsFwkReady(1);
}

View File

@ -0,0 +1,3 @@
on property:sys.boot_completed=1
exec u:r:phhsu_daemon:s0 root -- /system/bin/mtk-sms-fwk-ready slot1
exec u:r:phhsu_daemon:s0 root -- /system/bin/mtk-sms-fwk-ready slot2

32
cmds/oneplus-motor.cpp Normal file
View File

@ -0,0 +1,32 @@
#include <iostream>
#include <unistd.h>
#include <vendor/oneplus/hardware/motorcontrol/1.0/IOPMotorControl.h>
using ::vendor::oneplus::hardware::motorcontrol::V1_0::IOPMotorControl;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IOPMotorControl::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IMotor" << std::endl;
return -1;
}
if(argc<2) {
std::cerr << "Usage: " << argv[0] << " <read|down|up>" << std::endl;
return -1;
}
std::string cmd(argv[1]);
if(cmd == "read") {
int ret = svc->readMotorData(1, 16);
std::cout << "Read motor data 1/16 returned " << ret << std::endl;
return 0;
} else if(cmd == "down") {
int ret = svc->writeMotorData(1, 0, 1);
std::cout << "Down motor control data 1/0/1 returned " << ret << std::endl;
return 0;
} else if(cmd == "up") {
int ret = svc->writeMotorData(1, 1, 1);
std::cout << "Down motor control data 1/1/1 returned " << ret << std::endl;
return 0;
}
}

16
cmds/op-fp.cpp Normal file
View File

@ -0,0 +1,16 @@
#include <iostream>
#include <vendor/oneplus/fingerprint/extension/1.0/IVendorFingerprintExtensions.h>
using ::vendor::oneplus::fingerprint::extension::V1_0::IVendorFingerprintExtensions;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IVendorFingerprintExtensions::getService();
if(argc!=2) return 1;
int v = atoi(argv[0]);
auto ret = svc->updateStatus(v);
if(!ret.isOk()) {
std::cerr << "HWBinder call failed" << std::endl;
}
std::cout << "updateStatus returned " << ret << std::endl;
}

View File

@ -0,0 +1,54 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <linux/input.h>
int read_tristate() {
int fd = open("/proc/tristatekey/tri_state", O_RDONLY);
char p[16];
int ret = read(fd, p, sizeof(p) - 1);
p[ret] = 0;
return atoi(p);
}
int main() {
int fd = -1;
for(int i=0; i<255; i++) {
char path[256];
snprintf(path, 256, "/dev/input/event%d", i);
fd = open(path, O_RDWR);
if(fd == -1) continue;
char name[256];
ioctl(fd, EVIOCGNAME(256), name);
printf("Got input name %s\n", name);
if(strcmp(name, "oplus,hall_tri_state_key") == 0) {
break;
}
close(fd);
fd = -1;
}
if(fd == -1) return 0;
ioctl(fd, EVIOCGRAB, 1);
struct input_event ev;
while(read(fd, &ev, sizeof(ev)) != 0) {
if(!(ev.code == 61 && ev.value == 0)) continue;
int state = read_tristate();
if(state == 1) {
}
printf("State %d\n", read_tristate());
if(state == 1) {
system("service call audio 31 i32 2 s16 android");
} else if(state == 2) {
system("service call audio 31 i32 1 s16 android");
} else if(state == 3) {
system("service call audio 31 i32 0 s16 android");
}
}
}

View File

@ -0,0 +1,4 @@
service phhoplus-alert-slider /system/bin/oplus-alert-slider
seclabel u:r:phhsu_daemon:s0
oneshot
class main

View File

@ -0,0 +1,27 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
message PersistentProperties {
message PersistentPropertyRecord {
optional string name = 1;
optional string value = 2;
}
repeated PersistentPropertyRecord properties = 1;
}

55
cmds/persistprops.cpp Normal file
View File

@ -0,0 +1,55 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "device/phh/treble/cmds/persistent_properties.pb.h"
#include <algorithm>
#include <iostream>
int main(int argc, char **argv) {
int fd = open("persistent_properties", O_RDWR);
off_t size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
char *data = (char*) malloc(size);
int ret = read(fd, data, size);
PersistentProperties props;
bool parsed = props.ParseFromArray(data, size);
std::cout << "Currently has " << props.properties_size() << " props." << std::endl;
for(auto prop: props.properties()) {
std::cout << prop.name() << ":" << prop.value() << std::endl;
}
if(argc == 1) {
close(fd);
return 0;
}
if(argc != 3) {
std::cout << "Usage: " << argv[0] << " [prop value]" << std::endl;
return -1;
}
std::string property(argv[1]);
std::string value(argv[2]);
auto p = props.mutable_properties();
auto it = std::find_if(p->begin(), p->end(), [=](const auto& v) { return v.name() == property; });
if(it == p->end()) {
std::cout << "Property not found, adding it" << std::endl;
auto *record = p->Add();;
record->set_name(property);
record->set_value(value);
} else {
std::cout << "Property found, replacing it" << std::endl;
it->set_value(value);
}
size_t write_size = props.ByteSize();
char *write_buffer = (char*) malloc(write_size);
props.SerializeToArray(write_buffer, write_size);
ftruncate(fd, 0);
lseek(fd, 0, SEEK_SET);
write(fd, write_buffer, write_size);
close(fd);
}

15
cmds/sec-camera-list.cpp Normal file
View File

@ -0,0 +1,15 @@
#include <iostream>
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
using ::vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISehCameraProvider::getService("legacy/0");
auto cb = [](::android::hardware::camera::common::V1_0::Status status, ::android::hardware::hidl_vec<::android::hardware::hidl_string> ids) {
for(auto id: ids) {
std::cerr << "id = " << id << std::endl;
}
};
svc->sehGetCameraIdList(cb);
}

111
cmds/simg2img_simple.cpp Normal file
View File

@ -0,0 +1,111 @@
#define _GNU_SOURCE
#include <fcntl.h>
#include <unistd.h>
#include <sys/sendfile.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct sparse_header {
uint32_t magic; /* 0xed26ff3a */
uint16_t major_version; /* (0x1) - reject images with higher major versions */
uint16_t minor_version; /* (0x0) - allow images with higer minor versions */
uint16_t file_hdr_sz; /* 28 bytes for first revision of the file format */
uint16_t chunk_hdr_sz; /* 12 bytes for first revision of the file format */
uint32_t blk_sz; /* block size in bytes, must be a multiple of 4 (4096) */
uint32_t total_blks; /* total blocks in the non-sparse output image */
uint32_t total_chunks; /* total chunks in the sparse input image */
uint32_t image_checksum; /* CRC32 checksum of the original data, counting "don't care" */
/* as 0. Standard 802.3 polynomial, use a Public Domain */
/* table implementation */
} sparse_header_t;
#define SPARSE_HEADER_MAGIC 0xed26ff3a
#define CHUNK_TYPE_RAW 0xCAC1
#define CHUNK_TYPE_FILL 0xCAC2
#define CHUNK_TYPE_DONT_CARE 0xCAC3
#define CHUNK_TYPE_CRC32 0xCAC4
typedef struct chunk_header {
uint16_t chunk_type; /* 0xCAC1 -> raw; 0xCAC2 -> fill; 0xCAC3 -> don't care */
uint16_t reserved1;
uint32_t chunk_sz; /* in blocks in output image */
uint32_t total_sz; /* in bytes of chunk input file including chunk header and data */
} chunk_header_t;
/* Following a Raw or Fill or CRC32 chunk is data.
* For a Raw chunk, it's the data in chunk_sz * blk_sz.
* For a Fill chunk, it's 4 bytes of the fill data.
* For a CRC32 chunk, it's 4 bytes of CRC32
*/
static int disable_splice = 0;
void nsendfile(int out_fd, int in_fd, size_t count) {
char buf[1024*1024];
while(count) {
ssize_t res = -1;
if(!disable_splice) {
res = splice(in_fd, NULL, out_fd, NULL, count, 0);
}
if(count > 16*1024 && res < 1024)
disable_splice = 1;
if(res==-1) {
ssize_t sizeToRead = sizeof(buf);
if(count < sizeToRead) sizeToRead = count;
res = read(in_fd, buf, sizeToRead);
if(write(out_fd, buf, res) != res) exit(114);
}
if(res == 0 || res == -1) exit(112);
count -= res;
}
}
int main() {
sparse_header_t hdr;
if(read(0, &hdr, sizeof(hdr)) != sizeof(hdr)) exit(1);
if(hdr.magic != SPARSE_HEADER_MAGIC) exit(2);
if(hdr.blk_sz != 4096) exit(6);
if(hdr.major_version != 1) exit(11);
if(hdr.minor_version != 0) exit(12);
if(hdr.file_hdr_sz != 28) exit(13);
if(hdr.chunk_hdr_sz != 12) exit(14);
char block[4096];
for(unsigned i=0; i<hdr.total_chunks; i++) {
chunk_header_t chunk;
if(read(0, &chunk, sizeof(chunk)) != sizeof(chunk)) exit(3);
if(chunk.chunk_type == CHUNK_TYPE_RAW) {
if(chunk.total_sz != sizeof(chunk_header_t) + (chunk.chunk_sz * hdr.blk_sz)) exit(7);
nsendfile(1, 0, hdr.blk_sz * chunk.chunk_sz);
} else if(chunk.chunk_type == CHUNK_TYPE_FILL) {
if(chunk.total_sz != 4 + sizeof(chunk_header_t)) exit(7);
uint32_t fill;
if(read(0, &fill, sizeof(fill)) != sizeof(fill)) exit(5);
//memset takes a char, not a int32, hence the check
if(fill != 0) exit(6);
memset(block, fill, hdr.blk_sz);
for(unsigned i=0; i<chunk.chunk_sz; i++)
if(write(1, block, hdr.blk_sz) != hdr.blk_sz) exit(8);
} else if(chunk.chunk_type == CHUNK_TYPE_DONT_CARE) {
if(chunk.total_sz != sizeof(chunk_header_t)) exit(9);
memset(block, 0, hdr.blk_sz);
for(unsigned i=0; i<chunk.chunk_sz; i++)
if(write(1, block, hdr.blk_sz) != hdr.blk_sz) exit(10);
} else if(chunk.chunk_type == CHUNK_TYPE_CRC32) {
if(chunk.total_sz != 4 + sizeof(chunk_header_t)) exit(7);
uint32_t crc32;
if(read(0, &crc32, sizeof(crc32)) != sizeof(crc32)) exit(5);
/* ignore crc32 */
} else {
exit(4);
}
}
fsync(1);
return 0;
}

62
cmds/uevent.cpp Normal file
View File

@ -0,0 +1,62 @@
typedef unsigned short int sa_family_t;
#define __KERNEL_STRICT_NAMES
#include <sys/types.h>
#include <linux/netlink.h>
#include <sys/socket.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
//From a uevent patch for hal
#define HOTPLUG_BUFFER_SIZE 1024
#define HOTPLUG_NUM_ENVP 32
#define OBJECT_SIZE 512
#ifndef NETLINK_KOBJECT_UEVENT
#error Your kernel headers are too old, and do not define NETLINK_KOBJECT_UEVENT. You need Linux 2.6.10 or higher for KOBJECT_UEVENT support.
#endif
int main(int argc, char **argv, char **envp) {
//Start listening
int fd;
struct sockaddr_nl ksnl;
memset(&ksnl, 0x00, sizeof(struct sockaddr_nl));
ksnl.nl_family=AF_NETLINK;
ksnl.nl_pid=getpid();
ksnl.nl_groups=0xffffffff;
fd=socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
if (fd==-1) {
printf("Couldn't open kobject-uevent netlink socket");
perror("");
exit(1);
}
if (bind(fd, (struct sockaddr *) &ksnl, sizeof(struct sockaddr_nl))<0) {
fprintf (stderr, "Error binding to netlink socket");
close(fd);
exit(1);
}
while(1) {
char buffer[HOTPLUG_BUFFER_SIZE + OBJECT_SIZE];
int buflen;
buflen=recv(fd, &buffer, sizeof(buffer), 0);
if (buflen<0) {
exit(1);
}
if(argc>=2) {
if(!strstr(buffer, argv[1])) continue;
}
printf("%s\n", buffer);
char *pos = buffer + strlen(buffer);
char *end = buffer + buflen;
while(pos < end) {
int l = strlen(pos);
printf("\t%s\n", pos);
pos += l+1;
}
}
}

48
cmds/vibrator-lge.cpp Normal file
View File

@ -0,0 +1,48 @@
#include <iostream>
#include <vendor/lge/hardware/vibrator/1.0/IVibratorEx.h>
using ::vendor::lge::hardware::vibrator::V1_0::IVibratorEx;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IVibratorEx::getService();
auto supportsAmplitude = svc->supportsAmplitudeControl();
if(supportsAmplitude.isOk())
std::cerr << "supportsAmplitudeControl? " << supportsAmplitude << std::endl;
/*
public int on(int timeoutMs) throws RemoteException {
public int off() throws RemoteException {
public int setAmplitude(byte amplitude) throws RemoteException {
public void perform(int effect, byte strength, performCallback _hidl_cb) throws RemoteException {
public int playEffectWithStrength(ArrayList<Byte> effectData, int effectIndex, int strength) throws RemoteException {
*/
if(strcmp(argv[1], "on") == 0) {
int v = 100;
if(argc>=3)
v = atoi(argv[2]);
auto ret = svc->on(v);
if(ret.isOk()) {
android::hardware::vibrator::V1_0::Status r = ret;
std::cout << "vibrator on returned " << (int)r << std::endl;
} else {
std::cerr << "Binder failed request" << std::endl;
}
} else if(strcmp(argv[1], "amplitude") == 0) {
int v = 127;
if(argc>=3)
v = atoi(argv[2]);
auto ret = svc->setAmplitude(v);
if(ret.isOk()) {
android::hardware::vibrator::V1_0::Status r = ret;
std::cout << "vibrator amplitude returned " << (int)r << std::endl;
} else {
std::cerr << "Binder failed request" << std::endl;
}
} else {
std::cerr << "Not supported (yet)" << std::endl;
}
}

View File

@ -0,0 +1,40 @@
#include <iostream>
#include <unistd.h>
#include <vendor/xiaomi/hardware/displayfeature/1.0/IDisplayFeature.h>
using ::vendor::xiaomi::hardware::displayfeature::V1_0::IDisplayFeature;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IDisplayFeature::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IDisplayFeature" << std::endl;
return -1;
}
if(argc != 3) {
fprintf(stderr, "Usage: %s <ADAPT|ENHANCE|STANDARD|EYECARE|MONOCHROME|SUNLIGHT|NIGHTLIGHT|HIGHLIGHT> <value>\n", argv[0]);
return -2;
}
int mode = -1;
std::string modeArg(argv[1]);
if(modeArg == "ADAPT")
mode = 0;
if(modeArg == "ENHANCE")
mode = 1;
if(modeArg == "STANDARD")
mode = 2;
if(modeArg == "EYECARE")
mode = 3;
if(modeArg == "MONOCHROME")
mode = 4;
if(modeArg == "SUNLIGHT")
mode = 8;
if(modeArg == "NIGHTLIGHT")
mode = 9;
if(modeArg == "HIGHLIGHT")
mode = 11;
else
mode = atoi(argv[1]);
svc->setFeature(0, mode, atoi(argv[2]), 255);
}

21
cmds/xiaomi-fp.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <iostream>
#include <unistd.h>
#include <vendor/xiaomi/hardware/fingerprintextension/1.0/IXiaomiFingerprint.h>
using ::vendor::xiaomi::hardware::fingerprintextension::V1_0::IXiaomiFingerprint;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IXiaomiFingerprint::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IDisplayFeature" << std::endl;
return -1;
}
if(argc != 3) {
fprintf(stderr, "Usage: %s <command> <value>\n", argv[0]);
return -2;
}
uint32_t cmd = (uint32_t)strtoll(argv[1], NULL, 16);
uint32_t value = (uint32_t)strtoll(argv[2], NULL, 16);
svc->extCmd(cmd, value);
}

38
cmds/xiaomi-motor.cpp Normal file
View File

@ -0,0 +1,38 @@
#include <iostream>
#include <unistd.h>
#include <vendor/xiaomi/hardware/motor/1.0/IMotor.h>
using ::vendor::xiaomi::hardware::motor::V1_0::IMotor;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IMotor::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IMotor" << std::endl;
return -1;
}
if(argc<2) {
std::cerr << "Usage: " << argv[0] << " <init|release|popup|takeback|takebackShortly>" << std::endl;
return -1;
}
std::string cmd(argv[1]);
if(cmd == "init") {
svc->init();
} else if(cmd == "release") {
svc->release();
} else if(cmd == "popup") {
if(argc!=3) {
std::cerr << "Usage: " << argv[0] << " " << argv[1] << " <cookie>" << std::endl;
return -1;
}
svc->popupMotor(atoi(argv[2]));
} else if(cmd == "takeback") {
if(argc!=3) {
std::cerr << "Usage: " << argv[0] << " " << argv[1] << " <cookie>" << std::endl;
return -1;
}
svc->takebackMotor(atoi(argv[2]));
} else if(cmd == "takebackShortly") {
svc->takebackMotorShortly();
}
}

0
empty Normal file
View File

3
empty-permission.xml Normal file
View File

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<permissions>
</permissions>

View File

@ -1,4 +1,4 @@
# set up the global environment
on init
export BOOTCLASSPATH %BOOTCLASSPATH%
export SYSTEMSERVERCLASSPATH %SYSTEMSERVERCLASSPATH%
export BOOTCLASSPATH /apex/com.android.runtime/javalib/core-oj.jar:/apex/com.android.runtime/javalib/core-libart.jar:/apex/com.android.runtime/javalib/okhttp.jar:/apex/com.android.runtime/javalib/bouncycastle.jar:/apex/com.android.runtime/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.test.base.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.media/javalib/updatable-media.jar
export SYSTEMSERVERCLASSPATH /system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar

8
files/adbd.rc Normal file
View File

@ -0,0 +1,8 @@
service adbd_system /system/bin/adbd --root_seclabel=u:r:su:s0
class core
socket adbd stream 660 system system
disabled
seclabel u:r:adbd:s0
on property:sys.usb.state=adb && property:sys.phh.five=true
start adbd_system

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<feature name="android.software.controls" />
</permissions>

30
files/daisy-buttonJack.kl Normal file
View File

@ -0,0 +1,30 @@
# Copyright (c) 2019, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
key 226 HEADSETHOOK
key 257 VOLUME_UP
key 258 VOLUME_DOWN

11
files/daisy-uinput-fpc.kl Normal file
View File

@ -0,0 +1,11 @@
##################################
#
#add for fpc fingerprints
#
##################################
key 195 SYSTEM_NAVIGATION_UP
key 196 SYSTEM_NAVIGATION_DOWN
key 197 SYSTEM_NAVIGATION_LEFT
key 198 SYSTEM_NAVIGATION_RIGHT
key 353 DPAD_CENTER

View File

@ -0,0 +1,11 @@
##################################
#
#add for goodix fingerprints
#
##################################
key 195 SYSTEM_NAVIGATION_UP
key 196 SYSTEM_NAVIGATION_DOWN
key 197 SYSTEM_NAVIGATION_LEFT
key 198 SYSTEM_NAVIGATION_RIGHT
key 353 DPAD_CENTER

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="/vendor/etc/audio_policy_volumes.xml"/>
<xi:include href="/vendor/etc/default_volume_tables.xml"/>
</audioPolicyConfiguration>

View File

@ -0,0 +1,4 @@
key 106 SYSTEM_NAVIGATION_LEFT
key 108 SYSTEM_NAVIGATION_DOWN
key 103 SYSTEM_NAVIGATION_UP
key 105 SYSTEM_NAVIGATION_RIGHT

View File

@ -0,0 +1,7 @@
key 28 HOME VIRTUAL
key 105 APP_SWITCH
key 106 APP_SWITCH
key 118 WAKEUP
key 174 BACK
key 108 SYSTEM_NAVIGATION_DOWN
key 103 SYSTEM_NAVIGATION_UP

View File

@ -0,0 +1 @@
key 542 WAKEUP

32
files/mimix3-gpio-keys.kl Normal file
View File

@ -0,0 +1,32 @@
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 102 HOME
key 528 FOCUS
key 766 CAMERA
key 689 VOICE_ASSIST

14
files/moto-uinput-egis.kl Normal file
View File

@ -0,0 +1,14 @@
#
# ETS320 Touch sensor driver
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2
# as published by the Free Software Foundation.
#
# ets320 "finger present"
key 618 SYSTEM_NAVIGATION_DOWN
key 619 SYSTEM_NAVIGATION_UP
key 620 SYSTEM_NAVIGATION_LEFT
key 621 SYSTEM_NAVIGATION_RIGHT

View File

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 236 ASSIST

View File

@ -0,0 +1 @@
key 0x44 POWER

View File

@ -0,0 +1,28 @@
# Copyright (c) 2015, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
key 62 WAKEUP

2
files/oppo-touchpanel.kl Normal file
View File

@ -0,0 +1,2 @@
key 62 WAKEUP

72
files/ota.sh Normal file
View File

@ -0,0 +1,72 @@
#!/system/bin/sh
set -e
if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
echo "OTA is supported only for devices with dynamic partitions!"
exit 1
fi
flavor=$(getprop ro.product.product.name)
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/date)
if [ -z "$nextVersion" ];then
echo "Couldn't find any OTA for $flavor"
exit 1
fi
url=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/url)
size=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/size)
if [ "$(getprop ro.product.build.date.utc)" = "$nextVersion" ];then
echo "Installing $nextVersion onto itself, aborting"
exit 1
fi
if ! curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/known_releases |grep -q $(getprop ro.product.build.date.utc);then
echo "Warning! The build you are currently running is unknown. Type YES to confirm you want to apply OTA from $url"
read answer
if ! [ "$answer" = YES ];then
exit 1
fi
fi
if [ -b /dev/tmp-phh ] && ! tune2fs -l /dev/tmp-phh |grep 'Last mount time' |grep -q n/a;then
echo "Warning! It looks like you modified your system image! Flashing this OTA will revert this!"
echo "Type YES to acknowledge"
read answer
if ! [ "$answer" = YES ];then
exit 1
fi
fi
lptools remove system_phh
free=$(lptools free |grep -oE '[0-9]+$')
if [ "$free" -le "$size" ];then
echo "Warning! There doesn't seem to be enough space on super partition."
echo "Do you want me to try to make more space? Type YES"
read answer
if ! [ "$answer" = YES ];then
exit 1
fi
lptools clear-cow || true
lptools unlimited-group || true
lptools remove product || true
lptools remove product$(getprop ro.boot.slot_suffix) || true
free=$(lptools free |grep -oE '[0-9]+$')
if [ "$free" -le "$size" ];then
echo "Sorry, there is still not enough space available. OTA requires $size, you have $free available"
exit 1
fi
fi
lptools create system_phh "$size"
lptools unmap system_phh
dmDevice=$(lptools map system_phh|grep -oE '/dev/block/[^ ]*')
echo "Flashing from ${url}..."
curl -L "$url" | busybox_phh xz -d -c | simg2img_simple > $dmDevice
lptools replace system_phh system
reboot
exit 0

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<SecFloatingFeatureSet>
<SEC_FLOATING_FEATURE_AUDIO_SUPPORT_PSEUDO_DUAL_SPEAKER>TRUE</SEC_FLOATING_FEATURE_AUDIO_SUPPORT_PSEUDO_DUAL_SPEAKER>
</SecFloatingFeatureSet>

View File

@ -0,0 +1,12 @@
# Copyright (C) 2018 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 703 ASSIST
key 103 SYSTEM_NAVIGATION_UP
key 105 SYSTEM_NAVIGATION_LEFT
key 106 SYSTEM_NAVIGATION_RIGHT
key 108 SYSTEM_NAVIGATION_DOWN
key 172 HOME

View File

@ -0,0 +1 @@
touch.orientationAware = 1

View File

@ -0,0 +1,3 @@
key 158 BACK
key 254 APP_SWITCH

View File

@ -0,0 +1,30 @@
# Copyright (c) 2015, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
key 143 WAKEUP
key 172 WAKEUP

5
files/sony-gpio-keys.kl Normal file
View File

@ -0,0 +1,5 @@
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 528 FOCUS
key 766 CAMERA

View File

@ -0,0 +1,4 @@
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 456 WAKEUP

View File

@ -0,0 +1,3 @@
# Key layout for Unihertz devices with fingerprint sensor
# For Atom {,L,XL}: fingerprint sensor as home
key 172 HOME VIRTUAL

13
files/unihertz-mtk-kpd.kl Normal file
View File

@ -0,0 +1,13 @@
# Keylayout for Unihertz devices with a dedicated PTT button
# Volume buttons
key 115 VOLUME_UP
key 114 VOLUME_DOWN
# Power button
key 116 POWER
# PTT - Remap to camera by default
# CAMERA is delivered to apps, so remapping via
# third-party apps is possible
key 249 CAMERA
key 250 CAMERA

View File

@ -0,0 +1,6 @@
# Keylayout for Unihertz devices with capacitive keys
# Capacitive navigation
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
key 158 BACK VIRTUAL

View File

@ -0,0 +1,6 @@
# Keylayout for Unihertz devices with capacitive keys
# Capacitive navigation
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
key 158 BACK VIRTUAL

6
files/zf6-goodixfp.kl Normal file
View File

@ -0,0 +1,6 @@
key 0x6c SYSTEM_NAVIGATION_DOWN
key 0x67 SYSTEM_NAVIGATION_UP
key 0x69 SYSTEM_NAVIGATION_LEFT
key 0x6a SYSTEM_NAVIGATION_RIGHT

View File

@ -0,0 +1 @@
key 0x248 ASSIST

23
framework_manifest.xml Normal file
View File

@ -0,0 +1,23 @@
<manifest version="1.0" type="framework">
<hal format="hidl">
<name>android.hardware.wifi.hostapd</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IHostapd</name>
<instance>default</instance>
</interface>
</hal>
<!-- For our Oppo/Realme friends -->
<hal>
<name>android.hardware.biometrics.fingerprint</name>
<transport>hwbinder</transport>
<version>2.1</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

21
gapps-go.mk Normal file
View File

@ -0,0 +1,21 @@
BUILD_GMS := yes
#include not inherit, because we must edit some values
-include vendor/google/products/gms_go.mk
-include vendor/partner_gms/products/gms_go.mk
FILTER_OUT = $(foreach v,$(2),$(if $(findstring $(1),$(v)),,$(v)))
#gms_go.mk has a broken copy of google_go.xml => google.xml
#But there already is a google.xml => google.xml
#Only difference between those is maps go and youtube go applinks, so good enough
PRODUCT_COPY_FILES := $(call FILTER_OUT,google_go.xml:, $(PRODUCT_COPY_FILES))
#We need to use this way because it overrides sync adapters
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES := $(filter-out GoogleContacts, $(PRODUCT_PACKAGES))
PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES += \
phh-gapps-go-overrides \
GoogleContactsSyncAdapter \

View File

@ -1,4 +1,30 @@
GAPPS_VARIANT := nano
BUILD_GMS := yes
ifneq ($(wildcard vendor/google)$(wildcard vendor/partner_gms),)
-include vendor/google/products/gms.mk
-include vendor/partner_gms/products/gms.mk
PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES := $(filter-out GoogleContacts, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES += \
phh-gapps-overrides \
Chrome \
GoogleContactsSyncAdapter \
talkback \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES := $(filter-out ro.boot.vendor.overlay.theme=%,$(PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
endif
ifneq ($(wildcard vendor/opengapps),)
PRODUCT_COPY_FILES += \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera2.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2015.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2016.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2017.xml
PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay-gapps
GAPPS_VARIANT := pico
DONT_DEXPREOPT_PREBUILTS := true
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true
GAPPS_FORCE_PACKAGE_OVERRIDES := true
@ -9,8 +35,18 @@ PRODUCT_PACKAGES += \
CalculatorGoogle \
PrebuiltDeskClockGoogle \
CalendarGooglePrebuilt \
GoogleHome \
LatinImeGoogle \
phh-overrides
$(call inherit-product, vendor/opengapps/build/opengapps-packages.mk)
endif
#Pixel Experience gapps
ifneq ($(wildcard vendor/gapps),)
IS_PHONE := true
$(call inherit-product,vendor/gapps/config.mk)
PRODUCT_PACKAGES += \
phh-overrides \
com.simplemobiletools.gallery.pro \
endif

View File

@ -2,24 +2,38 @@
rom_script=''
if [ -n "$1" ];then
rom_script='$(call inherit-product, device/phh/treble/'$1'.mk)'
if echo "$1" | grep -qF /;then
rom_script=''
for i in "$@";do
rom_script="$rom_script"$'\n''$(call inherit-product, '$i')'
done
else
rom_script='$(call inherit-product, device/phh/treble/'$1'.mk)'
fi
fi
echo 'PRODUCT_MAKEFILES := \' > AndroidProducts.mk
for part in a ab;do
for apps in vanilla gapps foss;do
for arch in arm64 arm;do
for apps in vanilla gapps foss gapps-go;do
for arch in arm64 arm a64;do
for su in yes no;do
apps_suffix=""
apps_script=""
apps_name=""
extra_packages=""
vndk="vndk.mk"
optional_base=""
if [ "$apps" == "gapps" ];then
apps_suffix="g"
apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
apps_name="with GApps"
fi
if [ "$apps" == "gapps-go" ];then
apps_suffix="o"
apps_script='$(call inherit-product, device/phh/treble/gapps-go.mk)'
apps_name="Go"
fi
if [ "$apps" == "foss" ];then
apps_suffix="f"
apps_script='$(call inherit-product, vendor/foss/foss.mk)'
@ -30,33 +44,55 @@ for part in a ab;do
apps_script=''
apps_name="vanilla"
fi
if [ "$arch" == "arm" ];then
vndk="vndk-binder32.mk"
fi
if [ "$arch" == "a64" ];then
vndk="vndk32.mk"
fi
su_suffix='N'
if [ "$su" == "yes" ];then
su_suffix='S'
extra_packages+=' phh-su'
extra_packages+=' phh-su me.phh.superuser'
fi
part_suffix='a'
if [ "$part" == 'ab' ];then
part_suffix='b'
else
optional_base='$(call inherit-product, device/phh/treble/base-sas.mk)'
fi
target="treble_${arch}_${part_suffix}${apps_suffix}${su_suffix}"
baseArch="$arch"
if [ "$arch" = "a64" ];then
baseArch="arm"
fi
zygote=32
if [ "$arch" = "arm64" ];then
zygote=64_32
fi
cat > ${target}.mk << EOF
TARGET_GAPPS_ARCH := ${baseArch}
\$(call inherit-product, device/phh/treble/base-pre.mk)
include build/make/target/product/treble_common.mk
include build/make/target/product/aosp_${baseArch}_ab.mk
\$(call inherit-product, device/phh/treble/base.mk)
$optional_base
$apps_script
$rom_script
PRODUCT_NAME := $target
PRODUCT_DEVICE := phhgsi_${arch}_$part
PRODUCT_BRAND := Android
PRODUCT_BRAND := Phh
PRODUCT_SYSTEM_BRAND := Phh
PRODUCT_MODEL := Phh-Treble $apps_name
PRODUCT_PACKAGES += $extra_packages
EOF
echo -e '\t$(LOCAL_DIR)/'$target.mk '\' >> AndroidProducts.mk
done

23
hal/oplus-fp/Android.bp Normal file
View File

@ -0,0 +1,23 @@
cc_binary {
name: "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat",
defaults: ["hidl_defaults"],
init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.oplus.rc"],
relative_install_path: "hw",
srcs: [
"BiometricsFingerprint.cpp",
"service.cpp",
],
cflags: [
"-Wno-unused-parameter",
],
shared_libs: [
"libcutils",
"liblog",
"libhidlbase",
"libhardware",
"libutils",
"libbase",
"android.hardware.biometrics.fingerprint@2.1",
"vendor.oplus.hardware.biometrics.fingerprint@2.1",
],
}

View File

@ -0,0 +1,267 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat"
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat"
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include "BiometricsFingerprint.h"
#include <inttypes.h>
#include <unistd.h>
#include <utils/Log.h>
#include <thread>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
BiometricsFingerprint::BiometricsFingerprint() {
for(int i=0; i<10; i++) {
mOplusBiometricsFingerprint = vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint::tryGetService();
if(mOplusBiometricsFingerprint != nullptr) break;
sleep(10);
}
if(mOplusBiometricsFingerprint == nullptr) exit(0);
}
static bool receivedCancel;
static bool receivedEnumerate;
static uint64_t myDeviceId;
static std::vector<uint32_t> knownFingers;
class OplusClientCallback : public vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback {
public:
sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> mClientCallback;
OplusClientCallback(sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> clientCallback) : mClientCallback(clientCallback) {}
Return<void> onEnrollResult(uint64_t deviceId, uint32_t fingerId,
uint32_t groupId, uint32_t remaining) {
ALOGE("onEnrollResult %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnrollResult(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onAcquired(uint64_t deviceId, vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo acquiredInfo,
int32_t vendorCode) {
ALOGE("onAcquired %" PRIu64 " %d", deviceId, vendorCode);
if(mClientCallback != nullptr)
mClientCallback->onAcquired(deviceId, OplusToAOSPFingerprintAcquiredInfo(acquiredInfo), vendorCode);
return Void();
}
Return<void> onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
const hidl_vec<uint8_t>& token) {
ALOGE("onAuthenticated %" PRIu64 " %u %u", deviceId, fingerId, groupId);
if(mClientCallback != nullptr)
mClientCallback->onAuthenticated(deviceId, fingerId, groupId, token);
return Void();
}
Return<void> onError(uint64_t deviceId, vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError error, int32_t vendorCode) {
ALOGE("onError %" PRIu64 " %d", deviceId, vendorCode);
if(error == vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED) {
receivedCancel = true;
}
if(mClientCallback != nullptr)
mClientCallback->onError(deviceId, OplusToAOSPFingerprintError(error), vendorCode);
return Void();
}
Return<void> onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
ALOGE("onRemoved %" PRIu64 " %" PRIu32, deviceId, fingerId);
if(mClientCallback != nullptr)
mClientCallback->onRemoved(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
receivedEnumerate = true;
ALOGE("onEnumerate %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnumerate(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onTouchUp(uint64_t deviceId) { return Void(); }
Return<void> onTouchDown(uint64_t deviceId) { return Void(); }
Return<void> onSyncTemplates(uint64_t deviceId, const hidl_vec<uint32_t>& fingerId, uint32_t remaining) {
ALOGE("onSyncTemplates %" PRIu64 " %zu %" PRIu32, deviceId, fingerId.size(), remaining);
myDeviceId = deviceId;
for(auto fid : fingerId) {
ALOGE("\t- %u", fid);
}
knownFingers = fingerId;
return Void();
}
Return<void> onFingerprintCmd(int32_t deviceId, const hidl_vec<uint32_t>& groupId, uint32_t remaining) { return Void(); }
Return<void> onImageInfoAcquired(uint32_t type, uint32_t quality, uint32_t match_score) { return Void(); }
Return<void> onMonitorEventTriggered(uint32_t type, const hidl_string& data) { return Void(); }
Return<void> onEngineeringInfoUpdated(uint32_t length, const hidl_vec<uint32_t>& keys, const hidl_vec<hidl_string>& values) { return Void(); }
Return<void> onUIReady(int64_t deviceId) { return Void(); }
private:
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo> OplusToAOSPFingerprintAcquiredInfo(vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo info) {
switch(info) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
}
}
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintError> OplusToAOSPFingerprintError(vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError error) {
switch(error) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
}
}
};
Return<uint64_t> BiometricsFingerprint::setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
ALOGE("setNotify");
mOplusClientCallback = new OplusClientCallback(clientCallback);
return mOplusBiometricsFingerprint->setNotify(mOplusClientCallback);
}
Return<RequestStatus> BiometricsFingerprint::OplusToAOSPRequestStatus(vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus req) {
switch(req) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_UNKNOWN: return RequestStatus::SYS_UNKNOWN;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_OK: return RequestStatus::SYS_OK;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOENT: return RequestStatus::SYS_ENOENT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINTR: return RequestStatus::SYS_EINTR;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EIO: return RequestStatus::SYS_EIO;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EAGAIN: return RequestStatus::SYS_EAGAIN;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOMEM: return RequestStatus::SYS_ENOMEM;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EACCES: return RequestStatus::SYS_EACCES;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EFAULT: return RequestStatus::SYS_EFAULT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EBUSY: return RequestStatus::SYS_EBUSY;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINVAL: return RequestStatus::SYS_EINVAL;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOSPC: return RequestStatus::SYS_ENOSPC;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ETIMEDOUT: return RequestStatus::SYS_ETIMEDOUT;
default:
return RequestStatus::SYS_UNKNOWN;
}
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
ALOGE("preEnroll");
return mOplusBiometricsFingerprint->preEnroll();
}
Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69>& hat,
uint32_t gid, uint32_t timeoutSec) {
ALOGE("enroll");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->enroll(hat, gid, timeoutSec));
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
ALOGE("postEnroll");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->postEnroll());
}
Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
ALOGE("getAuthId");
return mOplusBiometricsFingerprint->getAuthenticatorId();
}
Return<RequestStatus> BiometricsFingerprint::cancel() {
receivedCancel = false;
RequestStatus ret = OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->cancel());
ALOGE("CANCELING");
if(!receivedCancel) {
ALOGE("Sending cancel error");
mOplusClientCallback->mClientCallback->onError(
myDeviceId,
android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED,
0);
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::enumerate() {
receivedEnumerate = false;
RequestStatus ret = OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->enumerate());
ALOGE("ENUMERATING");
if(ret == RequestStatus::SYS_OK && !receivedEnumerate) {
size_t nFingers = knownFingers.size();
ALOGE("received fingers, sending our own %zu", nFingers);
if(nFingers > 0) {
for(auto finger: knownFingers) {
mOplusClientCallback->mClientCallback->onEnumerate(
myDeviceId,
finger,
0,
--nFingers);
}
} else {
mOplusClientCallback->mClientCallback->onEnumerate(
myDeviceId,
0,
0,
0);
}
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
ALOGE("remove");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->remove(gid, fid));
}
Return<RequestStatus> BiometricsFingerprint::setActiveGroup(uint32_t gid,
const hidl_string& storePath) {
ALOGE("setActiveGroup");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->setActiveGroup(gid, storePath));
}
Return<RequestStatus> BiometricsFingerprint::authenticate(uint64_t operationId, uint32_t gid) {
ALOGE("auth");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->authenticate(operationId, gid));
}
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android

View File

@ -0,0 +1,78 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#include <log/log.h>
#include <android/log.h>
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <android/hardware/biometrics/fingerprint/2.1/types.h>
#include <vendor/oplus/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::OK;
using ::android::sp;
using ::android::status_t;
class OplusClientCallback;
struct BiometricsFingerprint : public IBiometricsFingerprint {
public:
BiometricsFingerprint();
// Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
Return<uint64_t> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
Return<uint64_t> preEnroll() override;
Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
Return<RequestStatus> postEnroll() override;
Return<uint64_t> getAuthenticatorId() override;
Return<RequestStatus> cancel() override;
Return<RequestStatus> enumerate() override;
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
private:
sp<vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint> mOplusBiometricsFingerprint;
sp<OplusClientCallback> mOplusClientCallback;
static Return<RequestStatus> OplusToAOSPRequestStatus(vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus req);
};
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H

View File

@ -0,0 +1,9 @@
service fps_hal.oplus.compat /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oplus.compat
# "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once
# /data is mounted.
class late_start
user system
group system input uhid
writepid /dev/cpuset/system-background/tasks
oneshot

61
hal/oplus-fp/service.cpp Normal file
View File

@ -0,0 +1,61 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "BiometricsFingerprint.h"
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::OK;
using android::sp;
using android::status_t;
int main() {
sp<BiometricsFingerprint> biometricsFingerprint;
status_t status;
LOG(INFO) << "Fingerprint HAL Adapter service is starting.";
biometricsFingerprint = new BiometricsFingerprint();
if (biometricsFingerprint == nullptr) {
LOG(ERROR) << "Can not create an instance of Fingerprint HAL Adapter BiometricsFingerprint Iface, exiting.";
goto shutdown;
}
configureRpcThreadpool(1, true /*callerWillJoin*/);
status = biometricsFingerprint->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for Fingerprint HAL Adapter BiometricsFingerprint Iface ("
<< status << ")";
goto shutdown;
}
LOG(INFO) << "Fingerprint HAL Adapter service is ready.";
joinRpcThreadpool();
// Should not pass this line
shutdown:
// In normal operation, we don't expect the thread pool to shutdown
LOG(ERROR) << "Fingerprint HAL Adapter service is shutting down.";
return 1;
}

23
hal/oppo-fp/Android.bp Normal file
View File

@ -0,0 +1,23 @@
cc_binary {
name: "android.hardware.biometrics.fingerprint@2.1-service.oppo.compat",
defaults: ["hidl_defaults"],
init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.oppo.rc"],
relative_install_path: "hw",
srcs: [
"BiometricsFingerprint.cpp",
"service.cpp",
],
cflags: [
"-Wno-unused-parameter",
],
shared_libs: [
"libcutils",
"liblog",
"libhidlbase",
"libhardware",
"libutils",
"libbase",
"android.hardware.biometrics.fingerprint@2.1",
"vendor.oppo.hardware.biometrics.fingerprint@2.1",
],
}

View File

@ -0,0 +1,267 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.oppo.compat"
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.1-service.oppo.compat"
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include "BiometricsFingerprint.h"
#include <inttypes.h>
#include <unistd.h>
#include <utils/Log.h>
#include <thread>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
BiometricsFingerprint::BiometricsFingerprint() {
for(int i=0; i<10; i++) {
mOppoBiometricsFingerprint = vendor::oppo::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint::tryGetService();
if(mOppoBiometricsFingerprint != nullptr) break;
sleep(10);
}
if(mOppoBiometricsFingerprint == nullptr) exit(0);
}
static bool receivedCancel;
static bool receivedEnumerate;
static uint64_t myDeviceId;
static std::vector<uint32_t> knownFingers;
class OppoClientCallback : public vendor::oppo::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback {
public:
sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> mClientCallback;
OppoClientCallback(sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> clientCallback) : mClientCallback(clientCallback) {}
Return<void> onEnrollResult(uint64_t deviceId, uint32_t fingerId,
uint32_t groupId, uint32_t remaining) {
ALOGE("onEnrollResult %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnrollResult(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onAcquired(uint64_t deviceId, vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo acquiredInfo,
int32_t vendorCode) {
ALOGE("onAcquired %" PRIu64 " %d", deviceId, vendorCode);
if(mClientCallback != nullptr)
mClientCallback->onAcquired(deviceId, OppoToAOSPFingerprintAcquiredInfo(acquiredInfo), vendorCode);
return Void();
}
Return<void> onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
const hidl_vec<uint8_t>& token) {
ALOGE("onAuthenticated %" PRIu64 " %u %u", deviceId, fingerId, groupId);
if(mClientCallback != nullptr)
mClientCallback->onAuthenticated(deviceId, fingerId, groupId, token);
return Void();
}
Return<void> onError(uint64_t deviceId, vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError error, int32_t vendorCode) {
ALOGE("onError %" PRIu64 " %d", deviceId, vendorCode);
if(error == vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED) {
receivedCancel = true;
}
if(mClientCallback != nullptr)
mClientCallback->onError(deviceId, OppoToAOSPFingerprintError(error), vendorCode);
return Void();
}
Return<void> onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
ALOGE("onRemoved %" PRIu64 " %" PRIu32, deviceId, fingerId);
if(mClientCallback != nullptr)
mClientCallback->onRemoved(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
receivedEnumerate = true;
ALOGE("onEnumerate %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnumerate(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onTouchUp(uint64_t deviceId) { return Void(); }
Return<void> onTouchDown(uint64_t deviceId) { return Void(); }
Return<void> onSyncTemplates(uint64_t deviceId, const hidl_vec<uint32_t>& fingerId, uint32_t remaining) {
ALOGE("onSyncTemplates %" PRIu64 " %zu %" PRIu32, deviceId, fingerId.size(), remaining);
myDeviceId = deviceId;
for(auto fid : fingerId) {
ALOGE("\t- %u", fid);
}
knownFingers = fingerId;
return Void();
}
Return<void> onFingerprintCmd(int32_t deviceId, const hidl_vec<uint32_t>& groupId, uint32_t remaining) { return Void(); }
Return<void> onImageInfoAcquired(uint32_t type, uint32_t quality, uint32_t match_score) { return Void(); }
Return<void> onMonitorEventTriggered(uint32_t type, const hidl_string& data) { return Void(); }
Return<void> onEngineeringInfoUpdated(uint32_t length, const hidl_vec<uint32_t>& keys, const hidl_vec<hidl_string>& values) { return Void(); }
Return<void> onUIReady(int64_t deviceId) { return Void(); }
private:
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo> OppoToAOSPFingerprintAcquiredInfo(vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo info) {
switch(info) {
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
}
}
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintError> OppoToAOSPFingerprintError(vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError error) {
switch(error) {
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
}
}
};
Return<uint64_t> BiometricsFingerprint::setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
ALOGE("setNotify");
mOppoClientCallback = new OppoClientCallback(clientCallback);
return mOppoBiometricsFingerprint->setNotify(mOppoClientCallback);
}
Return<RequestStatus> BiometricsFingerprint::OppoToAOSPRequestStatus(vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus req) {
switch(req) {
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_UNKNOWN: return RequestStatus::SYS_UNKNOWN;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_OK: return RequestStatus::SYS_OK;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOENT: return RequestStatus::SYS_ENOENT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINTR: return RequestStatus::SYS_EINTR;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EIO: return RequestStatus::SYS_EIO;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EAGAIN: return RequestStatus::SYS_EAGAIN;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOMEM: return RequestStatus::SYS_ENOMEM;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EACCES: return RequestStatus::SYS_EACCES;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EFAULT: return RequestStatus::SYS_EFAULT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EBUSY: return RequestStatus::SYS_EBUSY;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINVAL: return RequestStatus::SYS_EINVAL;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOSPC: return RequestStatus::SYS_ENOSPC;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ETIMEDOUT: return RequestStatus::SYS_ETIMEDOUT;
default:
return RequestStatus::SYS_UNKNOWN;
}
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
ALOGE("preEnroll");
return mOppoBiometricsFingerprint->preEnroll();
}
Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69>& hat,
uint32_t gid, uint32_t timeoutSec) {
ALOGE("enroll");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->enroll(hat, gid, timeoutSec));
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
ALOGE("postEnroll");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->postEnroll());
}
Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
ALOGE("getAuthId");
return mOppoBiometricsFingerprint->getAuthenticatorId();
}
Return<RequestStatus> BiometricsFingerprint::cancel() {
receivedCancel = false;
RequestStatus ret = OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->cancel());
ALOGE("CANCELING");
if(!receivedCancel) {
ALOGE("Sending cancel error");
mOppoClientCallback->mClientCallback->onError(
myDeviceId,
android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED,
0);
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::enumerate() {
receivedEnumerate = false;
RequestStatus ret = OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->enumerate());
ALOGE("ENUMERATING");
if(ret == RequestStatus::SYS_OK && !receivedEnumerate) {
size_t nFingers = knownFingers.size();
ALOGE("received fingers, sending our own %zu", nFingers);
if(nFingers > 0) {
for(auto finger: knownFingers) {
mOppoClientCallback->mClientCallback->onEnumerate(
myDeviceId,
finger,
0,
--nFingers);
}
} else {
mOppoClientCallback->mClientCallback->onEnumerate(
myDeviceId,
0,
0,
0);
}
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
ALOGE("remove");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->remove(gid, fid));
}
Return<RequestStatus> BiometricsFingerprint::setActiveGroup(uint32_t gid,
const hidl_string& storePath) {
ALOGE("setActiveGroup");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->setActiveGroup(gid, storePath));
}
Return<RequestStatus> BiometricsFingerprint::authenticate(uint64_t operationId, uint32_t gid) {
ALOGE("auth");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->authenticate(operationId, gid));
}
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android

View File

@ -0,0 +1,78 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#include <log/log.h>
#include <android/log.h>
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <android/hardware/biometrics/fingerprint/2.1/types.h>
#include <vendor/oppo/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::OK;
using ::android::sp;
using ::android::status_t;
class OppoClientCallback;
struct BiometricsFingerprint : public IBiometricsFingerprint {
public:
BiometricsFingerprint();
// Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
Return<uint64_t> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
Return<uint64_t> preEnroll() override;
Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
Return<RequestStatus> postEnroll() override;
Return<uint64_t> getAuthenticatorId() override;
Return<RequestStatus> cancel() override;
Return<RequestStatus> enumerate() override;
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
private:
sp<vendor::oppo::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint> mOppoBiometricsFingerprint;
sp<OppoClientCallback> mOppoClientCallback;
static Return<RequestStatus> OppoToAOSPRequestStatus(vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus req);
};
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H

View File

@ -0,0 +1,9 @@
service fps_hal.oppo.compat /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oppo.compat
# "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once
# /data is mounted.
class late_start
user system
group system input uhid
writepid /dev/cpuset/system-background/tasks
oneshot

61
hal/oppo-fp/service.cpp Normal file
View File

@ -0,0 +1,61 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "BiometricsFingerprint.h"
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::OK;
using android::sp;
using android::status_t;
int main() {
sp<BiometricsFingerprint> biometricsFingerprint;
status_t status;
LOG(INFO) << "Fingerprint HAL Adapter service is starting.";
biometricsFingerprint = new BiometricsFingerprint();
if (biometricsFingerprint == nullptr) {
LOG(ERROR) << "Can not create an instance of Fingerprint HAL Adapter BiometricsFingerprint Iface, exiting.";
goto shutdown;
}
configureRpcThreadpool(1, true /*callerWillJoin*/);
status = biometricsFingerprint->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for Fingerprint HAL Adapter BiometricsFingerprint Iface ("
<< status << ")";
goto shutdown;
}
LOG(INFO) << "Fingerprint HAL Adapter service is ready.";
joinRpcThreadpool();
// Should not pass this line
shutdown:
// In normal operation, we don't expect the thread pool to shutdown
LOG(ERROR) << "Fingerprint HAL Adapter service is shutting down.";
return 1;
}

3
havoc.mk Normal file
View File

@ -0,0 +1,3 @@
$(call inherit-product, vendor/havoc/config/common_full_phone.mk)
$(call inherit-product, device/havoc/sepolicy/common/sepolicy.mk)
-include vendor/havoc/build/core/config.mk

1775
huawei_charger/Android.mk Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Some files were not shown because too many files have changed in this diff Show More