├── KLCStuffs
├── KLC OS Banner.png
├── android-logo-mask.png
└── default_wallpaper.jpg
├── Notes.txt
├── README.md
├── frameworks
└── base
│ └── core
│ └── res
│ └── assets
│ └── images
│ └── android-logo-mask.png
├── treble_aosp
├── LICENSE
├── README.md
├── build.sh
├── build
│ ├── Dockerfile
│ ├── aosp.mk
│ ├── default.xml
│ └── remove.xml
├── config
│ └── ota.json
├── patch.sh
├── patches
│ ├── personal
│ │ ├── device_phh_treble
│ │ │ ├── 0001-Import-vendor-gapps.patch
│ │ │ └── 0002-Rework-securize-tweak.patch
│ │ ├── platform_build
│ │ │ ├── 0001-Remove-su-from-vanilla-builds.patch
│ │ │ └── 0002-product-Exclude-AOSP-apn-list-on-custom-builds.patch
│ │ ├── platform_external_robolectric
│ │ │ └── 0001-Fix-Trebuchet-tests.patch
│ │ ├── platform_frameworks_base
│ │ │ ├── 0001-gmscompat-Change-attestation-and-instrumentation-to-.patch
│ │ │ ├── 0002-gmscompat-Spoof-Pixel-XL-for-Google-Photos.patch
│ │ │ ├── 0003-monet-Use-Style.SPRITZ-by-default.patch
│ │ │ ├── 0004-fw-b-Use-ro.build.version.incremental-to-signal-OTA-.patch
│ │ │ ├── 0005-SystemUI-Add-left-padding-for-keyguard-slices.patch
│ │ │ ├── 0006-Add-android.permission.READ_PHONE_STATE-to-manifest.patch
│ │ │ ├── 0007-permissions-Pre-grant-google-restore-permissions.patch
│ │ │ ├── 0008-feat-Add-Lockscreen-Weather-with-OmniJaws-1-2.patch
│ │ │ └── 0009-feat-Add-Face-Unlock-with-ParanoidSense-1-2.patch
│ │ ├── platform_packages_apps_Settings
│ │ │ ├── 0001-feat-Add-Lockscreen-Weather-with-OmniJaws-2-2.patch
│ │ │ ├── 0002-feat-Add-Face-Unlock-with-ParanoidSense-2-2.patch
│ │ │ └── 0003-Settings-Set-correct-category-and-styling-for-google.patch
│ │ ├── platform_packages_apps_Trebuchet
│ │ │ └── 0001-Revert-Add-support-for-toggling-taskbar.patch
│ │ └── treble_app
│ │ │ └── 0001-misc-Remove-securize-preference.patch
│ └── trebledroid
│ │ ├── platform_bionic
│ │ ├── 0001-Disable-vndklite-handling.patch
│ │ └── 0002-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch
│ │ ├── platform_bootable_recovery
│ │ └── 0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch
│ │ ├── platform_external_selinux
│ │ ├── 0001-Increase-default-log_level-to-get-actual-selinux-err.patch
│ │ ├── 0002-Revert-libsepol-Make-an-unknown-permission-an-error-.patch
│ │ ├── 0003-Workaround-device-phh-treble-conflict-with-SELinux-p.patch
│ │ ├── 0004-Fix-boot-on-Moto-devices-using-unknown-class.patch
│ │ ├── 0005-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch
│ │ ├── 0006-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch
│ │ ├── 0007-Allow-mismatches-of-exfat-genfscon.patch
│ │ └── 0008-Enable-multipl_decls-by-default.-This-is-needed-beca.patch
│ │ ├── platform_frameworks_av
│ │ ├── 0001-Fix-BT-in-call-on-CAF-devices.patch
│ │ ├── 0002-Add-partial-cam-id-is-hardcoded-support-for-Asus-ZF6.patch
│ │ ├── 0003-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch
│ │ ├── 0004-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch
│ │ ├── 0005-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch
│ │ ├── 0006-Add-a-property-to-force-camera-timestamp-source.patch
│ │ ├── 0007-FIH-devices-Fix-Earpiece-audio-output.patch
│ │ ├── 0008-audiopolicy-No-longer-make-re-assigning-legacy-audio.patch
│ │ ├── 0009-Add-persist.sys.phh.disable_a2dp_offload-property-to.patch
│ │ ├── 0010-Make-camera-IDs-filter-out-optional.patch
│ │ ├── 0011-Support-Samsung-R-multi-cams.patch
│ │ ├── 0012-audiopolicy-Don-t-crash-on-unknown-audio-devices.patch
│ │ ├── 0013-Reenable-STRATEGY_ROUTING.-This-is-a-leftover-of-tri.patch
│ │ ├── 0014-Use-a-fake-volume-policy-when-none-has-been-found.patch
│ │ ├── 0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch
│ │ ├── 0016-When-aux-cameras-are-enabled-ignore-system-only-came.patch
│ │ ├── 0017-APM-Restore-R-and-Q-behavior-respectively-for-teleph.patch
│ │ ├── 0018-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch
│ │ ├── 0019-Fix-parsing-audio-hal-7.0-audio-policies.patch
│ │ ├── 0020-fixup-Not-all-sources-in-a-route-are-valid.-Dont-ign.patch
│ │ ├── 0021-Next-level-of-force-disable-a2dp-offload-erase-all-m.patch
│ │ ├── 0022-Add-a-prop-to-change-Samsung-flash-strength.patch
│ │ ├── 0023-Support-variable-flash-strength-on-samsung-hal-4.0.patch
│ │ └── 0024-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch
│ │ ├── platform_frameworks_base
│ │ ├── 0001-Fallback-to-stupid-autobrightness-if-brightness-valu.patch
│ │ ├── 0002-Relax-requirement-for-visible-flag-to-sdcards.patch
│ │ ├── 0003-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch
│ │ ├── 0004-Show-APN-Settings-for-CDMA-carriers.patch
│ │ ├── 0005-Re-order-services-so-that-it-works-even-without-qtag.patch
│ │ ├── 0006-Support-samsung-Pie-and-Q-light-hal.patch
│ │ ├── 0007-Add-support-for-samsung-touch-physical-and-hover-pro.patch
│ │ ├── 0008-Always-allow-overriding-the-number-of-work-profiles.patch
│ │ ├── 0009-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch
│ │ ├── 0010-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch
│ │ ├── 0011-Fix-brightness-range-not-being-complete-on-Samsung-d.patch
│ │ ├── 0012-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch
│ │ ├── 0013-Make-rounded-corners-padding-overridable-with-persis.patch
│ │ ├── 0014-Remove-useless-notification-about-console-service-be.patch
│ │ ├── 0015-Revert-Remove-unused-SystemProperties.set.patch
│ │ ├── 0016-TelephonyManager-bring-back-getNetworkClass.patch
│ │ ├── 0017-TelephonyManager-add-API-annotations-for-setTelephon.patch
│ │ ├── 0018-Fix-Wakelock-issue.patch
│ │ ├── 0019-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch
│ │ ├── 0020-Automatically-detect-pick-up-sensor-so-that-an-overl.patch
│ │ ├── 0021-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch
│ │ ├── 0022-backlight-Fix-backlight-control-on-Galaxy-S9.patch
│ │ ├── 0023-Add-support-for-app-signature-spoofing.patch
│ │ ├── 0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch
│ │ ├── 0025-Reduce-the-size-of-udfps-enroll-progress-bar.-Some-d.patch
│ │ ├── 0026-Add-UDFPS-support-for-various-devices.patch
│ │ ├── 0027-Dynamically-resize-boot-animation-to-match-screen-si.patch
│ │ ├── 0028-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch
│ │ ├── 0029-Add-persist.sys.phh.ultrasonic_udfps-property-to-dis.patch
│ │ ├── 0030-Allow-128bits-SHA1-IPSec-keys.-This-is-required-to-i.patch
│ │ ├── 0031-Fix-FOD-on-ZF8.patch
│ │ ├── 0032-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch
│ │ ├── 0033-Switch-FOD-to-WHITE.patch
│ │ ├── 0034-Support-samsung-ultrasonic-udfps.patch
│ │ └── 0035-Allow-FOD-color-to-be-customized-with-persist.sys.ph.patch
│ │ ├── platform_frameworks_native
│ │ ├── 0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch
│ │ ├── 0002-Use-BKK-s-hwcomposer-hacks-to-properly-display-FOD-l.patch
│ │ ├── 0003-Samsung-Xiaomi-new-FOD-HBM-controls.patch
│ │ ├── 0004-Matching-an-input-with-a-display-uses-uniqueId.patch
│ │ ├── 0005-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch
│ │ ├── 0006-Remove-Samsung-system-permission-on-sensors.patch
│ │ ├── 0007-Try-to-fallback-mCallingSid-to-getpidcon.patch
│ │ ├── 0008-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch
│ │ ├── 0009-On-Samsung-devices-for-FOD-HBM-set-specific-usage-bi.patch
│ │ ├── 0010-Update-FOD-HBM-method-Xiaomi-Oplus.patch
│ │ ├── 0011-For-FOD-HBM-on-Asus-devices-call-the-HWC-extended-ca.patch
│ │ ├── 0012-powermanager-Add-support-Samsung-miscpower-HAL.patch
│ │ ├── 0013-Fix-loading-power-hidl-v1.0.patch
│ │ ├── 0014-FOD-for-Asus-ZF8-had-layer-classes-inverted.patch
│ │ ├── 0015-Don-t-crash-skiagl-backend.patch
│ │ ├── 0016-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch
│ │ └── 0017-Fix-memory-leak-on-Try-to-fallback-mCallingSid-to-ge.patch
│ │ ├── platform_frameworks_opt_net_ims
│ │ └── 0001-Pie-MTK-IMS-calls-static-ImsManager.updateImsService.patch
│ │ ├── platform_frameworks_opt_telephony
│ │ ├── 0001-telephony-forward-port-support-for-forceCognitive.patch
│ │ ├── 0002-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch
│ │ ├── 0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch
│ │ ├── 0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch
│ │ └── 0005-Fix-Huawei-signal-strength-indicator.patch
│ │ ├── platform_hardware_interfaces
│ │ └── 0001-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch
│ │ ├── platform_packages_apps_Bluetooth
│ │ └── 0001-On-Samsung-devices-we-need-to-tell-Audio-HAL-if-we-r.patch
│ │ ├── platform_packages_apps_Settings
│ │ ├── 0001-Act-as-usb-device-when-there-is-no-hal-but-we-believ.patch
│ │ └── 0002-Ignore-cancelled-fingerprint-events-they-are-expecte.patch
│ │ ├── platform_packages_modules_Wifi
│ │ └── 0001-Boot-wifi-supplicant-both-with-lazy-hal-style-and-in.patch
│ │ ├── platform_system_bpf
│ │ └── 0001-Support-no-bpf-usecase.patch
│ │ ├── platform_system_bt
│ │ ├── 0001-Add-props-to-control-supported-features-and-states-1.patch
│ │ ├── 0002-Add-persist.sys.phh.disable_a2dp_offload-property-to.patch
│ │ ├── 0003-Add-a-property-to-disable-eSCO.patch
│ │ ├── 0004-Add-option-to-change-eSCO-Transport-Unit-Size.patch
│ │ └── 0005-Don-t-abort-when-failing-to-get-real-time-priority.patch
│ │ ├── platform_system_core
│ │ ├── 0001-first-stage-If-Vboot2-fails-fall-back-to-Vboot1.patch
│ │ ├── 0002-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch
│ │ ├── 0003-Detect-allowed-sdcard-options-based-on-vndk.patch
│ │ ├── 0004-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch
│ │ ├── 0005-Add-my-own-OTA-mechanism-going-over-data.patch
│ │ └── 0006-Let-system-override-ro.apex.updatable.patch
│ │ ├── platform_system_extras
│ │ └── 0001-libfscrypt-Bail-out-if-we-can-t-open-directory.patch
│ │ ├── platform_system_linkerconfig
│ │ └── 0001-Disable-vndklite-handling.patch
│ │ ├── platform_system_netd
│ │ ├── 0001-Support-no-bpf-usecase.patch
│ │ ├── 0002-device-Huawei-Kirin-960-accept-broken-rpfilter-match.patch
│ │ └── 0003-Don-t-fail-on-FTP-conntracking-failing.patch
│ │ ├── platform_system_nfc
│ │ └── 0001-Let-vendor-have-priority-over-NFC-config-file-rather.patch
│ │ ├── platform_system_security
│ │ └── 0001-Keystore-2.0-Add-CREATION_DATETIME-only-for-Keymint-.patch
│ │ └── platform_system_vold
│ │ ├── 0001-Allow-deletion-of-symlink.patch
│ │ ├── 0002-Support-Samsung-s-implementation-of-exfat-called-sdf.patch
│ │ ├── 0003-Sony-has-texfat-exfat-fs.patch
│ │ ├── 0004-Failing-to-create-facedata-shouldn-t-be-fatal.patch
│ │ ├── 0005-Every-voldmanaged-storage-is-adoptable.patch
│ │ ├── 0006-Log-support-for-exfat-texfat-FS-driver-names.patch
│ │ └── 0007-Don-t-unmount-rw-system.sh-binds.patch
├── sign.sh
└── sync.sh
└── vendor
└── ponces
└── rro_overlays
└── GsiFrameworksOverlay
└── res
└── drawable-nodpi
└── default_wallpaper.jpg
/KLCStuffs/KLC OS Banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LoggingNewMemory/KLC_OS/94322e5364008a4ca2b86a3f6da3ad92872b83a7/KLCStuffs/KLC OS Banner.png
--------------------------------------------------------------------------------
/KLCStuffs/android-logo-mask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LoggingNewMemory/KLC_OS/94322e5364008a4ca2b86a3f6da3ad92872b83a7/KLCStuffs/android-logo-mask.png
--------------------------------------------------------------------------------
/KLCStuffs/default_wallpaper.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LoggingNewMemory/KLC_OS/94322e5364008a4ca2b86a3f6da3ad92872b83a7/KLCStuffs/default_wallpaper.jpg
--------------------------------------------------------------------------------
/Notes.txt:
--------------------------------------------------------------------------------
1 | Boot anim:
2 | /frameworks/base/core/res/assets/images/android-logo-mask.png
3 |
4 | Default Wallpaper:
5 | /vendor/ponces/rro_overlays/GsiFrameworksOverlay/res/drawable-nodpi/default_wallpaper.jpg
6 |
7 | System.img located at:
8 | /out/target/product/tdgsi_arm64_ab/obj/PACKAGING/system_intermediates/system.img
9 |
10 | Got error while sync repo?
11 | wait until the script ends (Do not CTRL + C it) type this
12 |
13 | repo sync -j1 --fail-fast
14 |
15 | (Okay, actually you can modify it to -j4 or anything as long it works)
16 |
17 | All KLC OS Files are inside KLCStuffs folder
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | ## Source Code? This GSI based on ponces Android 15 AOSP
4 |
5 | ## Build
6 |
7 | To get started with building AOSP GSI, you'll need to get familiar with [Git and Repo](https://source.android.com/docs/setup/reference/repo) as well as [How to build a GSI](https://github.com/phhusson/treble_experimentations/wiki/How-to-build-a-GSI%3F)
8 |
9 | Note:
10 | - Pay attention to number 1 - 5
11 | - You need at least 30 GB of RAM to build this
12 | - At least 200 Free storage (HDD or SSD)
13 | - There is a note (Notes.txt) That contains bootanim logo and default wallpaper path, and also system.img path. Hope it helps
14 | - Pay attention to the KLC_OS/treble_aosp/build.sh script. I also write something there
15 | - All KLC OS Files are inside KLCStuffs folder
16 |
17 | ### Steps
18 |
19 | 1. Create a new working directory for your AOSP build and navigate to it:
20 | `mkdir klc_os; cd klc_os`
21 |
22 | 2. Clone this repo:
23 | `git clone https://github.com/LoggingNewMemory/KLC_OS -b android15.0`
24 |
25 | 3. Start the build, Good luck.
26 | `bash KLC_OS/treble_aosp/build.sh`
27 |
28 | Thanks to:
29 | - [ponces](https://github.com/ponces)
30 | - TrebleDroid Builders Community
31 | - Wahid (Lend me a Server)
32 |
--------------------------------------------------------------------------------
/frameworks/base/core/res/assets/images/android-logo-mask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LoggingNewMemory/KLC_OS/94322e5364008a4ca2b86a3f6da3ad92872b83a7/frameworks/base/core/res/assets/images/android-logo-mask.png
--------------------------------------------------------------------------------
/treble_aosp/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2023-2024 ponces
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/treble_aosp/README.md:
--------------------------------------------------------------------------------
1 | # TrebleDroid AOSP GSI
2 |
3 | ## Build
4 | To get started with building AOSP GSI, you'll need to get familiar with [Git and Repo](https://source.android.com/source/using-repo.html) as well as [How to build a GSI](https://github.com/phhusson/treble_experimentations/wiki/How-to-build-a-GSI%3F).
5 | - Create a new working directory for your AOSP build and navigate to it:
6 | ```
7 | mkdir aosp; cd aosp
8 | ```
9 | - Clone this repo:
10 | ```
11 | git clone https://github.com/ponces/treble_aosp -b android-15.0
12 | ```
13 | - Finally, start the build script:
14 | ```
15 | bash treble_aosp/build.sh
16 | ```
17 |
18 | ## Issues
19 | [Open issue](https://github.com/ponces/treble_aosp/issues/new/choose)
20 |
21 | ## Credits
22 | These people have helped this project in some way or another, so they should be the ones who receive all the credit:
23 | - [phhusson](https://github.com/phhusson)
24 | - [AndyYan](https://github.com/AndyCGYan)
25 | - [eremitein](https://github.com/eremitein)
26 | - [kdrag0n](https://github.com/kdrag0n)
27 | - [Peter Cai](https://github.com/PeterCxy)
28 | - [haridhayal11](https://github.com/haridhayal11)
29 | - [sooti](https://github.com/sooti)
30 | - [Iceows](https://github.com/Iceows)
31 | - [ChonDoit](https://github.com/ChonDoit)
32 |
--------------------------------------------------------------------------------
/treble_aosp/build/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:22.04
2 | LABEL Alberto Ponces="ponces26@gmail.com"
3 |
4 | COPY . /aosp/treble_aosp
5 | RUN ln -s /aosp/treble_aosp/build.sh /usr/bin/treblebuild && \
6 | ln -s /aosp/treble_aosp/sync.sh /usr/bin/treblesync
7 |
8 | ARG DEBIAN_FRONTEND=noninteractive
9 | RUN dpkg --add-architecture i386 && \
10 | apt update && apt install -y \
11 | aapt \
12 | bc \
13 | bison \
14 | build-essential \
15 | curl \
16 | dos2unix \
17 | flex \
18 | fontconfig \
19 | g++-multilib \
20 | gcc-multilib \
21 | git \
22 | gnupg \
23 | gperf \
24 | imagemagick \
25 | jq \
26 | libncurses5 \
27 | libstdc++6 \
28 | libstdc++6:i386 \
29 | libxml2-utils \
30 | locales \
31 | lunzip \
32 | lzip \
33 | lzop \
34 | m4 \
35 | openjdk-17-jdk \
36 | python-is-python3 \
37 | python3-pip \
38 | rsync \
39 | simg2img \
40 | squashfs-tools \
41 | sudo \
42 | tree \
43 | unzip \
44 | wget \
45 | xattr \
46 | xmlstarlet \
47 | xsltproc \
48 | zip \
49 | zlib1g \
50 | zlib1g:i386 ; \
51 | apt clean autoclean
52 |
53 | RUN locale-gen en_US.UTF-8 && \
54 | dpkg-reconfigure locales
55 |
56 | RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo && \
57 | chmod a+x /usr/local/bin/repo
58 |
59 | RUN curl https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
60 | apt update && apt install git-lfs && \
61 | git lfs install
62 |
63 | RUN git config --global user.name "Alberto Ponces" && \
64 | git config --global user.email ponces26@gmail.com && \
65 | git config --global color.ui auto
66 |
67 | USER root
68 | WORKDIR /aosp
69 |
--------------------------------------------------------------------------------
/treble_aosp/build/aosp.mk:
--------------------------------------------------------------------------------
1 | $(call inherit-product, vendor/ponces/config/common.mk)
2 |
3 | PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
4 | ro.system.ota.json_url=https://raw.githubusercontent.com/ponces/treble_aosp/android-15.0/config/ota.json
5 |
--------------------------------------------------------------------------------
/treble_aosp/build/default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/treble_aosp/build/remove.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/treble_aosp/config/ota.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "v2024.08.16",
3 | "date": "1723841795",
4 | "variants": [
5 | {
6 | "name": "treble_a64_bgN",
7 | "size": "951154852",
8 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm32_binder64-ab-gapps-14.0-20240816.img.xz"
9 | },
10 | {
11 | "name": "treble_a64_bgN-vndklite",
12 | "size": "867938808",
13 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm32_binder64-ab-gapps-vndklite-14.0-20240816.img.xz"
14 | },
15 | {
16 | "name": "treble_a64_bvN",
17 | "size": "621525760",
18 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm32_binder64-ab-vanilla-14.0-20240816.img.xz"
19 | },
20 | {
21 | "name": "treble_a64_bvN-vndklite",
22 | "size": "582337888",
23 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm32_binder64-ab-vanilla-vndklite-14.0-20240816.img.xz"
24 | },
25 | {
26 | "name": "treble_arm64_bgN",
27 | "size": "1341129884",
28 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm64-ab-gapps-14.0-20240816.img.xz"
29 | },
30 | {
31 | "name": "treble_arm64_bgN-vndklite",
32 | "size": "1197727784",
33 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm64-ab-gapps-vndklite-14.0-20240816.img.xz"
34 | },
35 | {
36 | "name": "treble_arm64_bvN",
37 | "size": "828267276",
38 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm64-ab-vanilla-14.0-20240816.img.xz"
39 | },
40 | {
41 | "name": "treble_arm64_bvN-vndklite",
42 | "size": "793370044",
43 | "url": "https://github.com/ponces/treble_aosp/releases/download/v2024.08.16/aosp-arm64-ab-vanilla-vndklite-14.0-20240816.img.xz"
44 | }
45 | ]
46 | }
47 |
--------------------------------------------------------------------------------
/treble_aosp/patch.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | patches="$(readlink -f -- $1)"
6 | tree="$2"
7 |
8 | for project in $(cd $patches/patches/$tree; echo *); do
9 | p="$(tr _ / <<<$project |sed -e 's;platform/;;g')"
10 | [ "$p" == build ] && p=build/make
11 | [ "$p" == treble/app ] && p=treble_app
12 | [ "$p" == vendor/hardware/overlay ] && p=vendor/hardware_overlay
13 | pushd $p &>/dev/null
14 | for patch in $patches/patches/$tree/$project/*.patch; do
15 | git am $patch || exit
16 | done
17 | popd &>/dev/null
18 | done
19 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/device_phh_treble/0001-Import-vendor-gapps.patch:
--------------------------------------------------------------------------------
1 | From 990e22c107d7144f41c83b39a6e48f2f89248e10 Mon Sep 17 00:00:00 2001
2 | From: Alberto Ponces
3 | Date: Tue, 21 Feb 2023 22:51:12 +0000
4 | Subject: [PATCH 1/2] Import vendor/gapps
5 |
6 | ---
7 | generate.sh | 2 +-
8 | 1 file changed, 1 insertion(+), 1 deletion(-)
9 |
10 | diff --git a/generate.sh b/generate.sh
11 | index 9c20eb5..8fbb16b 100644
12 | --- a/generate.sh
13 | +++ b/generate.sh
14 | @@ -26,7 +26,7 @@ for part in a ab;do
15 | optional_base=""
16 | if [ "$apps" == "gapps" ];then
17 | apps_suffix="g"
18 | - apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
19 | + apps_script='$(call inherit-product, vendor/gapps/common/common-vendor.mk)'
20 | apps_name="with GApps"
21 | fi
22 | if [ "$apps" == "gapps-go" ];then
23 | --
24 | 2.34.1
25 |
26 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_build/0001-Remove-su-from-vanilla-builds.patch:
--------------------------------------------------------------------------------
1 | From c690eeb44a8d7fda7522b8681decb07ac861313f Mon Sep 17 00:00:00 2001
2 | From: Victor Bo
3 | Date: Sat, 14 Dec 2019 23:46:34 +0200
4 | Subject: [PATCH 1/2] Remove su from vanilla builds
5 |
6 | ---
7 | target/product/base_system.mk | 1 -
8 | 1 file changed, 1 deletion(-)
9 |
10 | diff --git a/target/product/base_system.mk b/target/product/base_system.mk
11 | index 4f21c3ed63..c54b6f7ba4 100644
12 | --- a/target/product/base_system.mk
13 | +++ b/target/product/base_system.mk
14 | @@ -471,7 +471,6 @@ PRODUCT_PACKAGES_DEBUG := \
15 | ss \
16 | start_with_lockagent \
17 | strace \
18 | - su \
19 | sanitizer-status \
20 | tracepath \
21 | tracepath6 \
22 | --
23 | 2.34.1
24 |
25 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_build/0002-product-Exclude-AOSP-apn-list-on-custom-builds.patch:
--------------------------------------------------------------------------------
1 | From e38da8c1aa80ac5ec327cb6fa3aba867caa11871 Mon Sep 17 00:00:00 2001
2 | From: Alberto Ponces
3 | Date: Tue, 26 Dec 2023 17:01:46 +0000
4 | Subject: [PATCH 2/2] product: Exclude AOSP apn list on custom builds
5 |
6 | Change-Id: I76c8d5ef67de73d4558d350a87a9bc317aaad792
7 | ---
8 | target/product/aosp_product.mk | 5 -----
9 | target/product/full_base_telephony.mk | 1 -
10 | 2 files changed, 6 deletions(-)
11 |
12 | diff --git a/target/product/aosp_product.mk b/target/product/aosp_product.mk
13 | index 3a5b622f99..26070b7f2b 100644
14 | --- a/target/product/aosp_product.mk
15 | +++ b/target/product/aosp_product.mk
16 | @@ -34,8 +34,3 @@ PRODUCT_PACKAGES += \
17 | PhotoTable \
18 | preinstalled-packages-platform-aosp-product.xml \
19 | ThemePicker \
20 | -
21 | -# Telephony:
22 | -# Provide a APN configuration to GSI product
23 | -PRODUCT_COPY_FILES += \
24 | - device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml
25 | diff --git a/target/product/full_base_telephony.mk b/target/product/full_base_telephony.mk
26 | index d8a54cd7f3..5470ad2be5 100644
27 | --- a/target/product/full_base_telephony.mk
28 | +++ b/target/product/full_base_telephony.mk
29 | @@ -24,7 +24,6 @@ PRODUCT_VENDOR_PROPERTIES := \
30 | ro.com.android.dataroaming?=true
31 |
32 | PRODUCT_COPY_FILES := \
33 | - device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml \
34 | frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
35 |
36 | $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
37 | --
38 | 2.34.1
39 |
40 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_external_robolectric/0001-Fix-Trebuchet-tests.patch:
--------------------------------------------------------------------------------
1 | From f570cd2c9660455e86b6e2e97ee68aa6cc123e14 Mon Sep 17 00:00:00 2001
2 | From: Michael Bestas
3 | Date: Sun, 16 Jun 2024 23:07:27 +0300
4 | Subject: [PATCH] Fix Trebuchet tests
5 |
6 | Change-Id: I88830b39a758359445821e2d38a5b27f82a547d7
7 | ---
8 | Android.bp | 2 +-
9 | 1 file changed, 1 insertion(+), 1 deletion(-)
10 |
11 | diff --git a/Android.bp b/Android.bp
12 | index ef8c34716..621fc82dd 100644
13 | --- a/Android.bp
14 | +++ b/Android.bp
15 | @@ -205,7 +205,7 @@ java_host_for_device {
16 | "//frameworks/base/packages/SettingsLib:__subpackages__",
17 | "//frameworks/base/packages/SystemUI:__pkg__",
18 | "//frameworks/libs/systemui:__subpackages__",
19 | - "//packages/apps/Launcher3/tests:__pkg__",
20 | + "//packages/apps/Trebuchet/tests:__pkg__",
21 | "//frameworks/base/tests/InputScreenshotTest:__subpackages__",
22 | "//frameworks/opt/car/setupwizard/library/main/tests/robotests:__pkg__",
23 | "//frameworks/opt/localepicker/tests:__pkg__",
24 | --
25 | 2.34.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_frameworks_base/0002-gmscompat-Spoof-Pixel-XL-for-Google-Photos.patch:
--------------------------------------------------------------------------------
1 | From 563cb7da4d3eacbeabff5ead0a67fc0e4cb21b50 Mon Sep 17 00:00:00 2001
2 | From: vladsendrix <83285656+vladsendrix@users.noreply.github.com>
3 | Date: Fri, 31 Dec 2021 03:18:04 +0100
4 | Subject: [PATCH 2/9] gmscompat: Spoof Pixel XL for Google Photos
5 |
6 | Change-Id: I905e40625b07ebf500cbb3ce1deadedee2e624c5
7 | ---
8 | .../internal/gmscompat/AttestationHooks.java | 14 ++++++++++++++
9 | 1 file changed, 14 insertions(+)
10 |
11 | diff --git a/core/java/com/android/internal/gmscompat/AttestationHooks.java b/core/java/com/android/internal/gmscompat/AttestationHooks.java
12 | index 99e61ae74007..efa41e2a9b5f 100644
13 | --- a/core/java/com/android/internal/gmscompat/AttestationHooks.java
14 | +++ b/core/java/com/android/internal/gmscompat/AttestationHooks.java
15 | @@ -31,6 +31,7 @@ public final class AttestationHooks {
16 |
17 | private static final String PACKAGE_GMS = "com.google.android.gms";
18 | private static final String PACKAGE_FINSKY = "com.android.vending";
19 | + private static final String PACKAGE_PHOTOS = "com.google.android.apps.photos";
20 | private static final String PROCESS_UNSTABLE = "com.google.android.gms.unstable";
21 |
22 | private static volatile boolean sIsGms = false;
23 | @@ -66,6 +67,15 @@ public final class AttestationHooks {
24 | setPropValue("VERSION.DEVICE_INITIAL_SDK_INT", "32");
25 | }
26 |
27 | + private static void spoofGooglePhotos() {
28 | + setPropValue("PRODUCT", "marlin");
29 | + setPropValue("DEVICE", "marlin");
30 | + setPropValue("MANUFACTURER", "Google");
31 | + setPropValue("BRAND", "google");
32 | + setPropValue("MODEL", "Pixel XL");
33 | + setPropValue("FINGERPRINT", "google/marlin/marlin:10/QP1A.191005.007.A3/5972272:user/release-keys");
34 | + }
35 | +
36 | public static void initApplicationBeforeOnCreate(Application app) {
37 | if (PACKAGE_GMS.equals(app.getPackageName()) &&
38 | PROCESS_UNSTABLE.equals(Application.getProcessName())) {
39 | @@ -76,6 +86,10 @@ public final class AttestationHooks {
40 | if (PACKAGE_FINSKY.equals(app.getPackageName())) {
41 | sIsFinsky = true;
42 | }
43 | +
44 | + if (PACKAGE_PHOTOS.equals(app.getPackageName())) {
45 | + spoofGooglePhotos();
46 | + }
47 | }
48 |
49 | private static boolean isCallerSafetyNet() {
50 | --
51 | 2.34.1
52 |
53 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_frameworks_base/0003-monet-Use-Style.SPRITZ-by-default.patch:
--------------------------------------------------------------------------------
1 | From dcd2c3139cdd670197ccdd16b85312169d4a4dea Mon Sep 17 00:00:00 2001
2 | From: Alberto Ponces
3 | Date: Sun, 26 Feb 2023 22:13:35 +0000
4 | Subject: [PATCH 3/9] monet: Use Style.SPRITZ by default
5 |
6 | Change-Id: Ia44ba56c8daa07033b290de89bb300bda9d39d86
7 | ---
8 | .../com/android/systemui/theme/ThemeOverlayController.java | 6 +++---
9 | 1 file changed, 3 insertions(+), 3 deletions(-)
10 |
11 | diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
12 | index 4963aae08ab7..9c67b44fccbd 100644
13 | --- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
14 | +++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
15 | @@ -146,7 +146,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
16 | private double mContrast = 0.0;
17 | // Theme variant: Vibrant, Tonal, Expressive, etc
18 | @VisibleForTesting
19 | - protected Style mThemeStyle = Style.TONAL_SPOT;
20 | + protected Style mThemeStyle = Style.SPRITZ;
21 | // Accent colors overlay
22 | private FabricatedOverlay mSecondaryOverlay;
23 | // Neutral system colors overlay
24 | @@ -831,11 +831,11 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
25 | style = Style.valueOf(
26 | object.getString(ThemeOverlayApplier.OVERLAY_CATEGORY_THEME_STYLE));
27 | if (!validStyles.contains(style)) {
28 | - style = Style.TONAL_SPOT;
29 | + style = Style.SPRITZ;
30 | }
31 | } catch (JSONException | IllegalArgumentException e) {
32 | Log.i(TAG, "Failed to parse THEME_CUSTOMIZATION_OVERLAY_PACKAGES.", e);
33 | - style = Style.TONAL_SPOT;
34 | + style = Style.SPRITZ;
35 | }
36 | }
37 | return style;
38 | --
39 | 2.34.1
40 |
41 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_frameworks_base/0005-SystemUI-Add-left-padding-for-keyguard-slices.patch:
--------------------------------------------------------------------------------
1 | From 1ae92f65636784cf2217d3de1222aa330356d278 Mon Sep 17 00:00:00 2001
2 | From: LuK1337
3 | Date: Fri, 27 May 2022 01:13:39 +0200
4 | Subject: [PATCH 5/9] SystemUI: Add left padding for keyguard slices
5 |
6 | Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/4620
7 | Change-Id: I2735028472aa46bad412c69948936fb30c5fa36c
8 | ---
9 | .../src/com/android/keyguard/KeyguardSliceView.java | 9 ++++++---
10 | 1 file changed, 6 insertions(+), 3 deletions(-)
11 |
12 | diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
13 | index 7b5325d4eaa6..d8be862e19ac 100644
14 | --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
15 | +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
16 | @@ -49,6 +49,7 @@ import com.android.internal.annotations.VisibleForTesting;
17 | import com.android.internal.graphics.ColorUtils;
18 | import com.android.settingslib.Utils;
19 | import com.android.systemui.res.R;
20 | +import com.android.systemui.keyguard.KeyguardSliceProvider;
21 | import com.android.systemui.util.wakelock.KeepAwakeAnimationListener;
22 |
23 | import java.io.PrintWriter;
24 | @@ -445,13 +446,15 @@ public class KeyguardSliceView extends LinearLayout {
25 |
26 | private void updatePadding() {
27 | boolean hasText = !TextUtils.isEmpty(getText());
28 | + boolean isDate = Uri.parse(KeyguardSliceProvider.KEYGUARD_DATE_URI).equals(getTag());
29 | int padding = (int) getContext().getResources()
30 | .getDimension(R.dimen.widget_horizontal_padding) / 2;
31 | + int iconPadding = (int) mContext.getResources()
32 | + .getDimension(R.dimen.widget_icon_padding);
33 | // orientation is vertical, so add padding to top & bottom
34 | - setPadding(0, padding, 0, hasText ? padding : 0);
35 | + setPadding(!isDate ? iconPadding : 0, padding, 0, hasText ? padding : 0);
36 |
37 | - setCompoundDrawablePadding((int) mContext.getResources()
38 | - .getDimension(R.dimen.widget_icon_padding));
39 | + setCompoundDrawablePadding(iconPadding);
40 | }
41 |
42 | @Override
43 | --
44 | 2.34.1
45 |
46 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_frameworks_base/0006-Add-android.permission.READ_PHONE_STATE-to-manifest.patch:
--------------------------------------------------------------------------------
1 | From 774be1dc31b7f77cf8f10e94dae95656d7de046e Mon Sep 17 00:00:00 2001
2 | From: Janson Kang
3 | Date: Mon, 14 Dec 2015 11:13:24 +0800
4 | Subject: [PATCH 6/9] Add "android.permission.READ_PHONE_STATE" to manifest
5 |
6 | Change-Id: I78d90166635bbdf6b74e2a02efc1029387b4ad8d
7 | ---
8 | packages/SystemUI/AndroidManifest.xml | 1 +
9 | 1 file changed, 1 insertion(+)
10 |
11 | diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
12 | index 666d939257dc..e47dde0c1af1 100644
13 | --- a/packages/SystemUI/AndroidManifest.xml
14 | +++ b/packages/SystemUI/AndroidManifest.xml
15 | @@ -68,6 +68,7 @@
16 |
17 |
18 |
19 | +
20 |
21 |
22 |
23 | --
24 | 2.34.1
25 |
26 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_frameworks_base/0007-permissions-Pre-grant-google-restore-permissions.patch:
--------------------------------------------------------------------------------
1 | From 33e539839dc848b1bcc8acabadc307272a8fb009 Mon Sep 17 00:00:00 2001
2 | From: Alberto Ponces
3 | Date: Sun, 5 Mar 2023 17:54:25 +0000
4 | Subject: [PATCH 7/9] permissions: Pre-grant google restore permissions
5 |
6 | Change-Id: I241886b63e0660ef01e7801b273045c3c91d44ea
7 | ---
8 | .../DefaultPermissionGrantPolicy.java | 19 +++++++++++++++++++
9 | 1 file changed, 19 insertions(+)
10 |
11 | diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
12 | index 5eda6deb0eb0..748e5a2c51af 100644
13 | --- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
14 | +++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
15 | @@ -217,6 +217,15 @@ final class DefaultPermissionGrantPolicy {
16 | SENSORS_PERMISSIONS.add(Manifest.permission.BODY_SENSORS_BACKGROUND);
17 | }
18 |
19 | + private static final Set GOOGLE_RESTORE_PERMISSIONS = new ArraySet<>();
20 | + static {
21 | + GOOGLE_RESTORE_PERMISSIONS.add(Manifest.permission.READ_EXTERNAL_STORAGE);
22 | + GOOGLE_RESTORE_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
23 | + GOOGLE_RESTORE_PERMISSIONS.add(Manifest.permission.MANAGE_EXTERNAL_STORAGE);
24 | + GOOGLE_RESTORE_PERMISSIONS.add(Manifest.permission.MANAGE_USB);
25 | + GOOGLE_RESTORE_PERMISSIONS.add(Manifest.permission.INTERNET);
26 | + }
27 | +
28 | private static final Set STORAGE_PERMISSIONS = new ArraySet<>();
29 | static {
30 | STORAGE_PERMISSIONS.add(Manifest.permission.READ_EXTERNAL_STORAGE);
31 | @@ -939,6 +948,16 @@ final class DefaultPermissionGrantPolicy {
32 | String commonServiceAction = "android.adservices.AD_SERVICES_COMMON_SERVICE";
33 | grantPermissionsToSystemPackage(pm, getDefaultSystemHandlerServicePackage(pm,
34 | commonServiceAction, userId), userId, NOTIFICATION_PERMISSIONS);
35 | +
36 | + // Data Restore Tool
37 | + grantSystemFixedPermissionsToSystemPackage(pm, "com.google.android.apps.restore", userId, PHONE_PERMISSIONS,
38 | + CONTACTS_PERMISSIONS, SMS_PERMISSIONS, GOOGLE_RESTORE_PERMISSIONS);
39 | +
40 | + // Google Play Services
41 | + grantPermissionsToSystemPackage(pm, "com.google.android.gms", userId, SENSORS_PERMISSIONS,
42 | + CALENDAR_PERMISSIONS, CAMERA_PERMISSIONS, CONTACTS_PERMISSIONS, ALWAYS_LOCATION_PERMISSIONS,
43 | + MICROPHONE_PERMISSIONS, NEARBY_DEVICES_PERMISSIONS, PHONE_PERMISSIONS, SMS_PERMISSIONS,
44 | + STORAGE_PERMISSIONS);
45 | }
46 |
47 | private String getDefaultSystemHandlerActivityPackageForCategory(PackageManagerWrapper pm,
48 | --
49 | 2.34.1
50 |
51 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_packages_apps_Settings/0002-feat-Add-Face-Unlock-with-ParanoidSense-2-2.patch:
--------------------------------------------------------------------------------
1 | From cf5ab6ee6a8ce4456f7396071f28eabbe3bfc557 Mon Sep 17 00:00:00 2001
2 | From: Chris Crump
3 | Date: Fri, 17 Mar 2023 20:48:46 +0100
4 | Subject: [PATCH 2/3] feat: Add Face Unlock with ParanoidSense (2/2)
5 |
6 | Co-authored-by: Chris Crump
7 | Co-authored-by: Adithya R
8 | Co-authored-by: Tobias Merkel
9 | Co-authored-by: someone5678
10 | Co-authored-by: aswin7469
11 | Co-authored-by: Pranav Vashi
12 | Change-Id: I05fa784d9f7f978be9f5944900a97ad7df19f59e
13 | ---
14 | AndroidManifest.xml | 2 +-
15 | 1 file changed, 1 insertion(+), 1 deletion(-)
16 |
17 | diff --git a/AndroidManifest.xml b/AndroidManifest.xml
18 | index 69d000a9e89..c8aa7f4f0d0 100644
19 | --- a/AndroidManifest.xml
20 | +++ b/AndroidManifest.xml
21 | @@ -2701,7 +2701,7 @@
22 | android:screenOrientation="portrait"/>
23 |
24 |
29 |
30 | --
31 | 2.34.1
32 |
33 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/platform_packages_apps_Settings/0003-Settings-Set-correct-category-and-styling-for-google.patch:
--------------------------------------------------------------------------------
1 | From d1050e6d8a9a1b7033953efce924e42efd78ab19 Mon Sep 17 00:00:00 2001
2 | From: shoya0x00
3 | Date: Sat, 19 Oct 2024 12:42:04 +0000
4 | Subject: [PATCH 3/3] Settings: Set correct category and styling for google and
5 | digital wellbeing
6 |
7 | On new revamped Settings UX dashboard missing styling for google and digital wellbeing tile.
8 | This fixes the styling and move these apps tiles to their respective category
9 |
10 | Change-Id: I5f18fab2419c8346760c4f6bed6f77e1eac8e059
11 | Signed-off-by: shoya0x00
12 | ---
13 | .../settings/dashboard/DashboardFragment.java | 13 +++++++++----
14 | 1 file changed, 9 insertions(+), 4 deletions(-)
15 |
16 | diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
17 | index 9abc6c2a0fa..dca60f902be 100644
18 | --- a/src/com/android/settings/dashboard/DashboardFragment.java
19 | +++ b/src/com/android/settings/dashboard/DashboardFragment.java
20 | @@ -556,12 +556,17 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
21 | screen.addPreference(pref);
22 | }
23 | } else {
24 | + Preference group = null;
25 | if (tile.hasGroupKey()
26 | && mDashboardTilePrefKeys.containsKey(tile.getGroupKey())) {
27 | - Preference group = screen.findPreference(tile.getGroupKey());
28 | - if (group instanceof PreferenceCategory) {
29 | - ((PreferenceCategory) group).addPreference(pref);
30 | - }
31 | + group = screen.findPreference(tile.getGroupKey());
32 | + } else if ("top_level_google".equals(key)) {
33 | + group = screen.findPreference("top_level_account_category");
34 | + } else if ("top_level_wellbeing".equals(key)) {
35 | + group = screen.findPreference("top_level_security_privacy_category");
36 | + }
37 | + if (group instanceof PreferenceCategory) {
38 | + ((PreferenceCategory) group).addPreference(pref);
39 | } else {
40 | screen.addPreference(pref);
41 | }
42 | --
43 | 2.34.1
44 |
45 |
--------------------------------------------------------------------------------
/treble_aosp/patches/personal/treble_app/0001-misc-Remove-securize-preference.patch:
--------------------------------------------------------------------------------
1 | From 1586c804a971422cd93de3743ae67d27212986be Mon Sep 17 00:00:00 2001
2 | From: Alberto Ponces
3 | Date: Tue, 8 Jun 2021 09:44:26 +0100
4 | Subject: [PATCH] misc: Remove securize preference
5 |
6 | ---
7 | .../java/me/phh/treble/app/MiscSettings.kt | 33 -------------------
8 | app/src/main/res/xml/pref_misc.xml | 2 --
9 | 2 files changed, 35 deletions(-)
10 |
11 | diff --git a/app/src/main/java/me/phh/treble/app/MiscSettings.kt b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
12 | index dc2e0e3..80530b1 100644
13 | --- a/app/src/main/java/me/phh/treble/app/MiscSettings.kt
14 | +++ b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
15 | @@ -49,39 +49,6 @@ class MiscSettingsFragment : SettingsFragment() {
16 | override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
17 | super.onCreatePreferences(savedInstanceState, rootKey)
18 |
19 | - val securizePref = findPreference(MiscSettings.securize)
20 | - securizePref!!.setOnPreferenceClickListener {
21 | - val builder = AlertDialog.Builder( this.getActivity() )
22 | - builder.setTitle(getString(R.string.remove_root))
23 | - builder.setMessage(getString(R.string.continue_question))
24 | -
25 | - builder.setPositiveButton(android.R.string.yes) { dialog, which ->
26 | -
27 | - var cmds = listOf(
28 | - arrayOf("/sbin/su", "-c", "/system/bin/phh-securize.sh"),
29 | - arrayOf("/system/xbin/su", "-c", "/system/bin/phh-securize.sh"),
30 | - arrayOf("/system/xbin/phh-su", "-c", "/system/bin/phh-securize.sh"),
31 | - arrayOf("/sbin/su", "0", "/system/bin/phh-securize.sh"),
32 | - arrayOf("/system/xbin/su", "0", "/system/bin/phh-securize.sh"),
33 | - arrayOf("/system/xbin/phh-su", "0", "/system/bin/phh-securize.sh")
34 | - )
35 | - for (cmd in cmds) {
36 | - try {
37 | - Runtime.getRuntime().exec(cmd).waitFor()
38 | - break
39 | - } catch (t: Throwable) {
40 | - Log.d("PHH", "Failed to exec \"" + cmd.joinToString(separator = " ") + "\", skipping")
41 | - }
42 | - }
43 | - }
44 | -
45 | - builder.setNegativeButton(android.R.string.no) { dialog, which ->
46 | - }
47 | -
48 | - builder.show()
49 | - return@setOnPreferenceClickListener true
50 | - }
51 | -
52 | val removeTelephonyPref = findPreference(MiscSettings.removeTelephony)
53 | removeTelephonyPref!!.setOnPreferenceClickListener {
54 |
55 | diff --git a/app/src/main/res/xml/pref_misc.xml b/app/src/main/res/xml/pref_misc.xml
56 | index 4210106..9176674 100644
57 | --- a/app/src/main/res/xml/pref_misc.xml
58 | +++ b/app/src/main/res/xml/pref_misc.xml
59 | @@ -161,8 +161,6 @@
60 | android:entryValues="@array/pref_misc_fod_color_values"
61 | android:key="key_misc_fod_color"
62 | android:title="Under-display fp color" />
63 | -
65 |
66 |
67 |
68 | --
69 | 2.34.1
70 |
71 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_bionic/0001-Disable-vndklite-handling.patch:
--------------------------------------------------------------------------------
1 | From 1f5d6c985598d537566407e21cab13e6540f9b69 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Wed, 27 Oct 2021 14:39:29 -0400
4 | Subject: [PATCH 1/2] Disable vndklite handling
5 |
6 | Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2
7 | ---
8 | linker/linker.cpp | 5 -----
9 | 1 file changed, 5 deletions(-)
10 |
11 | diff --git a/linker/linker.cpp b/linker/linker.cpp
12 | index 3488f5cc7..c32ea8484 100644
13 | --- a/linker/linker.cpp
14 | +++ b/linker/linker.cpp
15 | @@ -93,7 +93,6 @@ static uint64_t g_module_unload_counter = 0;
16 | static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_STRING ".txt";
17 |
18 | static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt";
19 | -static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt";
20 |
21 | static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt";
22 |
23 | @@ -3368,10 +3367,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
24 | }
25 |
26 | static std::string get_ld_config_file_vndk_path() {
27 | - if (android::base::GetBoolProperty("ro.vndk.lite", false)) {
28 | - return kLdConfigVndkLiteFilePath;
29 | - }
30 | -
31 | std::string ld_config_file_vndk = kLdConfigFilePath;
32 | size_t insert_pos = ld_config_file_vndk.find_last_of('.');
33 | if (insert_pos == std::string::npos) {
34 | --
35 | 2.25.1
36 |
37 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_bionic/0002-Add-new-mechanism-to-fake-vendor-props-on-a-per-proc.patch:
--------------------------------------------------------------------------------
1 | From 80252e3a2495d6e840b678a5540494f3a2e395ba Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sat, 19 Feb 2022 08:20:25 -0500
4 | Subject: [PATCH 2/2] Add new mechanism to fake vendor props on a per-process
5 | basis
6 |
7 | This reads debug.phh.props.. If its value is "vendor",
8 | then ro.product.device/ro.product.manufacturer is read from vendor
9 | ---
10 | libc/system_properties/system_properties.cpp | 38 ++++++++++++++++++++
11 | 1 file changed, 38 insertions(+)
12 |
13 | diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
14 | index 1cb15c3df..d6e7e3e68 100644
15 | --- a/libc/system_properties/system_properties.cpp
16 | +++ b/libc/system_properties/system_properties.cpp
17 | @@ -35,6 +35,7 @@
18 | #include
19 | #include
20 | #include
21 | +#include
22 |
23 | #include
24 |
25 | @@ -50,6 +51,32 @@
26 | #define SERIAL_DIRTY(serial) ((serial)&1)
27 | #define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
28 |
29 | +static char comm[128];
30 | +static bool self_ok = false;
31 | +static char comm_override[PROP_VALUE_MAX];
32 | +
33 | +static void read_self() {
34 | + //NB: Not atomic, but should be good enough, there is no possible corruption from concurrency
35 | + if(self_ok) return;
36 | + self_ok = true;
37 | +
38 | + int fd = open("/proc/self/comm", O_RDONLY);
39 | + if(fd<0) return;
40 | + read(fd, comm, sizeof(comm)-1);
41 | + for(unsigned i=0; i0) return r;
67 | + }
68 | + if(strcmp(name, "ro.product.manufacturer") == 0) {
69 | + int r = Get("ro.product.vendor.manufacturer", value);
70 | + if(r>0) return r;
71 | + }
72 | + }
73 | const prop_info* pi = Find(name);
74 |
75 | if (pi != nullptr) {
76 | --
77 | 2.25.1
78 |
79 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_bootable_recovery/0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch:
--------------------------------------------------------------------------------
1 | From 5b4b66da955b6b329846e6010db79b2ecb344fcf Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Thu, 12 Sep 2019 20:31:07 +0200
4 | Subject: [PATCH] Don't reboot if we couldn't get bootctrl
5 |
6 | Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af
7 | ---
8 | update_verifier/update_verifier.cpp | 2 +-
9 | 1 file changed, 1 insertion(+), 1 deletion(-)
10 |
11 | diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
12 | index a042f900..ea3645af 100644
13 | --- a/update_verifier/update_verifier.cpp
14 | +++ b/update_verifier/update_verifier.cpp
15 | @@ -310,7 +310,7 @@ int update_verifier(int argc, char** argv) {
16 | sp module = IBootControl::getService();
17 | if (module == nullptr) {
18 | LOG(ERROR) << "Error getting bootctrl module.";
19 | - return reboot_device();
20 | + return 0;
21 | }
22 |
23 | uint32_t current_slot = module->getCurrentSlot();
24 | --
25 | 2.25.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_external_selinux/0001-Increase-default-log_level-to-get-actual-selinux-err.patch:
--------------------------------------------------------------------------------
1 | From 6c2ad4aed9187b64d5dae594096fece5666e648f Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Mon, 9 Apr 2018 00:19:49 +0200
4 | Subject: [PATCH 1/8] Increase default log_level to get actual selinux error in
5 | kmsg
6 |
7 | ---
8 | secilc/secilc.c | 2 +-
9 | 1 file changed, 1 insertion(+), 1 deletion(-)
10 |
11 | diff --git a/secilc/secilc.c b/secilc/secilc.c
12 | index 9c78e425..71a0f685 100644
13 | --- a/secilc/secilc.c
14 | +++ b/secilc/secilc.c
15 | @@ -103,7 +103,7 @@ int main(int argc, char *argv[])
16 | int opt_index = 0;
17 | char *fc_buf = NULL;
18 | size_t fc_size;
19 | - enum cil_log_level log_level = CIL_ERR;
20 | + enum cil_log_level log_level = CIL_WARN;
21 | static struct option long_opts[] = {
22 | {"help", no_argument, 0, 'h'},
23 | {"verbose", no_argument, 0, 'v'},
24 | --
25 | 2.25.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_external_selinux/0002-Revert-libsepol-Make-an-unknown-permission-an-error-.patch:
--------------------------------------------------------------------------------
1 | From 694d2147bae95a3f838c9bd0692d4defc0ea95ad Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Wed, 9 Sep 2020 22:36:42 +0200
4 | Subject: [PATCH 2/8] Revert "libsepol: Make an unknown permission an error in
5 | CIL"
6 |
7 | This reverts commit dc4e54126bf25dea4d51820922ccd1959be68fbc.
8 |
9 | This is required because some targets calls undefined permissions:
10 | - Realme X2 Pro calls sigcont
11 | - Honor 7X calls perf_event
12 | ---
13 | libsepol/cil/src/cil_resolve_ast.c | 12 ++++++++----
14 | 1 file changed, 8 insertions(+), 4 deletions(-)
15 |
16 | diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
17 | index 87575860..e72abdeb 100644
18 | --- a/libsepol/cil/src/cil_resolve_ast.c
19 | +++ b/libsepol/cil/src/cil_resolve_ast.c
20 | @@ -131,14 +131,18 @@ static int __cil_resolve_perms(symtab_t *class_symtab, symtab_t *common_symtab,
21 | }
22 | }
23 | if (rc != SEPOL_OK) {
24 | + struct cil_list *empty_list;
25 | if (class_flavor == CIL_MAP_CLASS) {
26 | cil_log(CIL_ERR, "Failed to resolve permission %s for map class\n", (char*)curr->data);
27 | - } else {
28 | - cil_log(CIL_ERR, "Failed to resolve permission %s\n", (char*)curr->data);
29 | + goto exit;
30 | }
31 | - goto exit;
32 | + cil_log(CIL_WARN, "Failed to resolve permission %s\n", (char*)curr->data);
33 | + /* Use an empty list to represent unknown perm */
34 | + cil_list_init(&empty_list, perm_strs->flavor);
35 | + cil_list_append(*perm_datums, CIL_LIST, empty_list);
36 | + } else {
37 | + cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
38 | }
39 | - cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
40 | } else {
41 | cil_list_append(*perm_datums, curr->flavor, curr->data);
42 | }
43 | --
44 | 2.25.1
45 |
46 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_external_selinux/0004-Fix-boot-on-Moto-devices-using-unknown-class.patch:
--------------------------------------------------------------------------------
1 | From 95d6d45fb888da3d33368ee8c5f74885620fb906 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Fri, 25 Oct 2019 13:29:20 +0200
4 | Subject: [PATCH 4/8] Fix boot on Moto devices using unknown class
5 |
6 | vendor sepolicy never contains new class or classorder, and are not
7 | allowed to.
8 | Though this is not tested, and it turns out Moto did it anyway.
9 | This raises an issue, because class need to be ordered, and thus the cil
10 | contains the ordering. This ordering needs to be merged.
11 | Android 10 added new classes, so the ordering can no longer be merged,
12 | and secilc fails on those devices, preventing boot.
13 |
14 | Considering vendor are not supposed to declare new class (and thus
15 | declare classorder), this fix ignores class-es/classorder in vendor
16 | SELinux policy.
17 |
18 | Since the vendor selinux policy has allows rules based on this context,
19 | those allows will fail since the class doesn't exist.
20 | Workaround this by ignoring rules with the problematic class
21 | ( keystore_moto_key )
22 |
23 | Lucky us, this new class `keystore_moto_key` is used by Moto for
24 | framework to framework (more accurately priv app to keymaster), since
25 | our own framework doesn't use this class, simply ignoring it fixes the
26 | issue.
27 |
28 | Change-Id: I66339857634ebfdba359f12a99dfd0bff709d80b
29 | ---
30 | libsepol/cil/src/cil_build_ast.c | 24 ++++++++++++++++++++++++
31 | 1 file changed, 24 insertions(+)
32 |
33 | diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
34 | index 94d55d7f..e5f76742 100644
35 | --- a/libsepol/cil/src/cil_build_ast.c
36 | +++ b/libsepol/cil/src/cil_build_ast.c
37 | @@ -393,6 +393,14 @@ int cil_gen_class(struct cil_db *db, struct cil_tree_node *parse_current, struct
38 | struct cil_tree_node *perms = NULL;
39 | int rc = SEPOL_ERR;
40 |
41 | + {
42 | + const char* path = cil_tree_get_cil_path(parse_current);
43 | + if(strstr(path, "vendor")) {
44 | + cil_clear_node(ast_node);
45 | + return SEPOL_OK;
46 | + }
47 | + }
48 | +
49 | rc = __cil_verify_syntax(parse_current, syntax, syntax_len);
50 | if (rc != SEPOL_OK) {
51 | goto exit;
52 | @@ -459,6 +467,14 @@ int cil_gen_classorder(struct cil_db *db, struct cil_tree_node *parse_current, s
53 | struct cil_list_item *head = NULL;
54 | int rc = SEPOL_ERR;
55 |
56 | + {
57 | + const char* path = cil_tree_get_cil_path(parse_current);
58 | + if(strstr(path, "vendor")) {
59 | + cil_clear_node(ast_node);
60 | + return SEPOL_OK;
61 | + }
62 | + }
63 | +
64 | if (db == NULL || parse_current == NULL || ast_node == NULL) {
65 | goto exit;
66 | }
67 | @@ -2057,6 +2073,14 @@ int cil_gen_avrule(struct cil_tree_node *parse_current, struct cil_tree_node *as
68 | rule->src_str = parse_current->next->data;
69 | rule->tgt_str = parse_current->next->next->data;
70 |
71 | + {
72 | + const char *classname = parse_current->next->next->next->cl_head->data;
73 | + if(strcmp(classname, "keystore_moto_key") == 0) {
74 | + cil_clear_node(ast_node);
75 | + return SEPOL_OK;
76 | + }
77 | + }
78 | +
79 | rc = cil_fill_classperms_list(parse_current->next->next->next, &rule->perms.classperms);
80 | if (rc != SEPOL_OK) {
81 | goto exit;
82 | --
83 | 2.25.1
84 |
85 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_external_selinux/0005-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch:
--------------------------------------------------------------------------------
1 | From ef479c63d4fb9e1e839c968db9f61c0fcf76828c Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Fri, 6 Sep 2019 15:07:25 +0200
4 | Subject: [PATCH 5/8] Allow /devices/virtual/block/ genfscon conflict (seen on
5 | Xiaomi Mi 9)
6 |
7 | Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895
8 | ---
9 | libsepol/cil/src/cil_post.c | 18 +++++++++++++++++-
10 | 1 file changed, 17 insertions(+), 1 deletion(-)
11 |
12 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
13 | index a0cadfde..68c0318e 100644
14 | --- a/libsepol/cil/src/cil_post.c
15 | +++ b/libsepol/cil/src/cil_post.c
16 | @@ -477,7 +477,23 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
17 | {
18 | struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a;
19 | struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b;
20 | - return context_compare(a_genfscon->context, b_genfscon->context);
21 | + int rc = context_compare(a_genfscon->context, b_genfscon->context);
22 | + if(rc) {
23 | + fprintf(stderr, "hello %s\n", a_genfscon->fs_str);
24 | + int bypass = 0;
25 | + /*
26 | + * This conflict has been seen on Xiaomi Mi 9:
27 | + * - AOSP Q says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0))))
28 | + * - stock rom says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_ufs_target ((s0) (s0))))
29 | + */
30 | + if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
31 | + bypass = 1;
32 | + if(bypass == 1) {
33 | + fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
34 | + return 0;
35 | + }
36 | + }
37 | + return rc;
38 | }
39 |
40 | int cil_post_netifcon_context_compare(const void *a, const void *b)
41 | --
42 | 2.25.1
43 |
44 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_external_selinux/0006-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch:
--------------------------------------------------------------------------------
1 | From 0054622f2f85e87b7a303c71dc13a7aeee2d5bde Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Thu, 12 Sep 2019 20:37:04 +0200
4 | Subject: [PATCH 6/8] if service is "rcs", accept conflict. Seen on Moto E5
5 |
6 | Change-Id: I0cc2d0fad83f403f2b5d7458039b1564ce5ed9dd
7 | ---
8 | libselinux/src/label_backends_android.c | 14 ++++++++++++--
9 | 1 file changed, 12 insertions(+), 2 deletions(-)
10 |
11 | diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
12 | index 121b52f5..57723a7b 100644
13 | --- a/libselinux/src/label_backends_android.c
14 | +++ b/libselinux/src/label_backends_android.c
15 | @@ -62,14 +62,24 @@ static int nodups_specs(struct saved_data *data)
16 | curr_spec->property_key)) {
17 | if (strcmp(spec_arr[jj].lr.ctx_raw,
18 | curr_spec->lr.ctx_raw)) {
19 | - rc = -1;
20 | - errno = EINVAL;
21 | selinux_log
22 | (SELINUX_ERROR,
23 | "Multiple different specifications for %s (%s and %s).\n",
24 | curr_spec->property_key,
25 | spec_arr[jj].lr.ctx_raw,
26 | curr_spec->lr.ctx_raw);
27 | + int ignore = 0;
28 | + /*
29 | + * This issue has been found on Moto E5
30 | + * E SELinux : Multiple different specifications for rcs (u:object_r:radio_service:s0 and u:object_r:mot_rcs_service:s0).
31 | + */
32 | + if(!strcmp(curr_spec->property_key, "rcs"))
33 | + ignore = 1;
34 | +
35 | + if(!ignore) {
36 | + rc = -1;
37 | + errno = EINVAL;
38 | + }
39 | } else {
40 | selinux_log
41 | (SELINUX_WARNING,
42 | --
43 | 2.25.1
44 |
45 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_external_selinux/0007-Allow-mismatches-of-exfat-genfscon.patch:
--------------------------------------------------------------------------------
1 | From 725f8a440f4a3c3c50cca83c4965dcf7ebf2b9a2 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sun, 24 May 2020 17:22:22 +0200
4 | Subject: [PATCH 7/8] Allow mismatches of exfat genfscon
5 |
6 | ---
7 | libsepol/cil/src/cil_post.c | 4 ++++
8 | 1 file changed, 4 insertions(+)
9 |
10 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
11 | index 68c0318e..75e5128c 100644
12 | --- a/libsepol/cil/src/cil_post.c
13 | +++ b/libsepol/cil/src/cil_post.c
14 | @@ -488,6 +488,10 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
15 | */
16 | if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
17 | bypass = 1;
18 | + if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) {
19 | + if(strcmp(a_genfscon->path_str, "/") == 0)
20 | + bypass = 1;
21 | + }
22 | if(bypass == 1) {
23 | fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
24 | return 0;
25 | --
26 | 2.25.1
27 |
28 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_external_selinux/0008-Enable-multipl_decls-by-default.-This-is-needed-beca.patch:
--------------------------------------------------------------------------------
1 | From afaad1385d00ec04adf09d78d602c5b947234927 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Fri, 2 Mar 2018 22:49:55 +0100
4 | Subject: [PATCH 8/8] Enable multipl_decls by default. This is needed because
5 | 8.0 init doesn't add -m
6 |
7 | Change-Id: I43dc661d519f7b8576d72a828d8cbd444592bf5e
8 | ---
9 | secilc/secilc.c | 2 +-
10 | 1 file changed, 1 insertion(+), 1 deletion(-)
11 |
12 | diff --git a/secilc/secilc.c b/secilc/secilc.c
13 | index 71a0f685..a7e2e531 100644
14 | --- a/secilc/secilc.c
15 | +++ b/secilc/secilc.c
16 | @@ -91,7 +91,7 @@ int main(int argc, char *argv[])
17 | int target = SEPOL_TARGET_SELINUX;
18 | int mls = -1;
19 | int disable_dontaudit = 0;
20 | - int multiple_decls = 0;
21 | + int multiple_decls = 1;
22 | int disable_neverallow = 0;
23 | int preserve_tunables = 0;
24 | int handle_unknown = -1;
25 | --
26 | 2.25.1
27 |
28 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0003-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch:
--------------------------------------------------------------------------------
1 | From f1a716f3dec614a6fb7882216574d05e36005a03 Mon Sep 17 00:00:00 2001
2 | From: Peter Cai
3 | Date: Thu, 23 Jan 2020 11:13:43 +0800
4 | Subject: [PATCH 03/24] audiopolicy: try again with trimmed audio port name if
5 | not found
6 |
7 | * In Spreadtrum BSP, some audio routes may contain ports with extra
8 | spaces at the beginning and the end, causing audiopolicy to refuse to
9 | load and leading to broken audio.
10 |
11 | * Fix this by retrying with trimmed port name when not found. Do not
12 | use trimmed name all the time because a white space is a valid
13 | character in port name, and we cannot be sure nobody is using it for
14 | legitimite purposes.
15 |
16 | Change-Id: I993708b28e8404bc8c483d71a850ac69382231bd
17 | ---
18 | .../common/managerdefinitions/src/Serializer.cpp | 14 ++++++++++++++
19 | 1 file changed, 14 insertions(+)
20 |
21 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
22 | index 9a857ff091..d919951007 100644
23 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
24 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
25 | @@ -579,6 +579,17 @@ std::variant PolicySerializer::deserialize<
26 | return deviceDesc;
27 | }
28 |
29 | +char* trim(char * s) {
30 | + int l = strlen(s);
31 | +
32 | + if (l > 0) {
33 | + while (isspace(s[l - 1])) --l;
34 | + while (*s && isspace(*s)) ++s, --l;
35 | + }
36 | +
37 | + return strndup(s, l);
38 | +}
39 | +
40 | template<>
41 | std::variant PolicySerializer::deserialize(
42 | const xmlNode *cur, RouteTraits::PtrSerializingCtx ctx)
43 | @@ -626,6 +637,9 @@ std::variant PolicySerializer::deserialize source = ctx->findPortByTagName(devTag);
47 | + if (source == NULL) {
48 | + source = ctx->findPortByTagName(trim(devTag));
49 | + }
50 | if (source == NULL && !mIgnoreVendorExtensions) {
51 | ALOGE("%s: no source found with name=%s", __func__, devTag);
52 | return BAD_VALUE;
53 | --
54 | 2.25.1
55 |
56 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0004-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch:
--------------------------------------------------------------------------------
1 | From a7fa41975e6446e1f4af35fc66dea42a1e44f343 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Mon, 13 Apr 2020 21:01:16 +0200
4 | Subject: [PATCH 04/24] There are three SCO devices. Fallback from one to the
5 | others if needed
6 |
7 | Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2
8 | ---
9 | .../managerdefinitions/src/HwModule.cpp | 21 +++++++++++++++++++
10 | 1 file changed, 21 insertions(+)
11 |
12 | diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
13 | index 3a143b0058..565defc203 100644
14 | --- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
15 | +++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
16 | @@ -309,6 +309,27 @@ sp HwModuleCollection::getModuleForDeviceType(audio_devices_t type,
17 | }
18 | }
19 | }
20 | + //We didn't find one? Ok but all SCOs are equivalent surely?
21 | + if(type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO ||
22 | + type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET ||
23 | + type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
24 | + ALOGE("Fallback SCO");
25 | + if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO) {
26 | + auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO, encodedFormat);
27 | + ALOGE("Fallback SCO simple? %s", (ret != nullptr) ? "yes" : "no");
28 | + if(ret != nullptr) return ret;
29 | + }
30 | + if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) {
31 | + auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, encodedFormat);
32 | + ALOGE("Fallback SCO headset? %s", (ret != nullptr) ? "yes" : "no");
33 | + if(ret != nullptr) return ret;
34 | + }
35 | + if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
36 | + auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat);
37 | + ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no");
38 | + if(ret != nullptr) return ret;
39 | + }
40 | + }
41 | return nullptr;
42 | }
43 |
44 | --
45 | 2.25.1
46 |
47 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0006-Add-a-property-to-force-camera-timestamp-source.patch:
--------------------------------------------------------------------------------
1 | From 1c7203d02a737467a76733fe75aab737ff5d9f73 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Tue, 19 May 2020 14:01:14 +0200
4 | Subject: [PATCH 06/24] Add a property to force camera timestamp source
5 |
6 | Some devices wrongly report their timesource
7 | Camera's timesource can either be CLOCK_MONOTONIC, or CLOCK_BOOTTIME
8 | The former doesn't increment in sleep, while the later does.
9 | There is a camera HAL property for that, though some devices don't
10 | report it properly.
11 |
12 | This issue happens on Xiaomi Redmi 7A, it needs to force the value to 1
13 |
14 | Add a property persist.sys.phh.camera.force_timestampsource to force
15 | timestamp source.
16 | ---
17 | .../libcameraservice/device3/Camera3Device.cpp | 12 ++++++++++--
18 | 1 file changed, 10 insertions(+), 2 deletions(-)
19 |
20 | diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
21 | index de418da6cc..6c2de0f088 100644
22 | --- a/services/camera/libcameraservice/device3/Camera3Device.cpp
23 | +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
24 | @@ -347,8 +347,16 @@ status_t Camera3Device::initializeCommonLocked() {
25 | // Measure the clock domain offset between camera and video/hw_composer
26 | camera_metadata_entry timestampSource =
27 | mDeviceInfo.find(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE);
28 | - if (timestampSource.count > 0 && timestampSource.data.u8[0] ==
29 | - ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME) {
30 | + int timestampSourceValue = 0;
31 | + if ((timestampSource.count > 0 && timestampSource.data.u8[0] ==
32 | + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME)) {
33 | + timestampSourceValue = 1;
34 | + }
35 | + int forceTimestampSource = property_get_int32("persist.sys.phh.camera.force_timestampsource", -1);
36 | + //Don't override if it's -1, default value
37 | + if(forceTimestampSource == 0) timestampSourceValue = 0;
38 | + if(forceTimestampSource == 1) timestampSourceValue = 1;
39 | + if (timestampSourceValue == 1) {
40 | mTimestampOffset = getMonoToBoottimeOffset();
41 | }
42 |
43 | --
44 | 2.25.1
45 |
46 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0008-audiopolicy-No-longer-make-re-assigning-legacy-audio.patch:
--------------------------------------------------------------------------------
1 | From 0b7c3e2fe99b01d8e3f15d5d49232dcaf3c0374d Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sat, 12 Sep 2020 12:32:50 +0200
4 | Subject: [PATCH 08/24] [audiopolicy] No longer make re-assigning legacy audio
5 | groups fatal. Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING
6 | which is defined by framework too
7 |
8 | Change-Id: I794fe22d63a8af705be4f5f09b9879ecaab3eae5
9 | ---
10 | services/audiopolicy/engine/common/src/EngineBase.cpp | 6 +++---
11 | 1 file changed, 3 insertions(+), 3 deletions(-)
12 |
13 | diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp
14 | index 150a9a8e4f..740eab288c 100644
15 | --- a/services/audiopolicy/engine/common/src/EngineBase.cpp
16 | +++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
17 | @@ -216,9 +216,9 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
18 | }
19 | if (group.stream != AUDIO_STREAM_DEFAULT) {
20 | // A legacy stream can be assigned once to a volume group
21 | - LOG_ALWAYS_FATAL_IF(checkStreamForGroups(group.stream, mVolumeGroups),
22 | - "stream %s already assigned to a volume group, "
23 | - "review the configuration", toString(group.stream).c_str());
24 | + if(checkStreamForGroups(group.stream, mVolumeGroups)) {
25 | + ALOGE("stream %s already assigned to a volume group, review the configuration", toString(group.stream).c_str());
26 | + }
27 | volumeGroup->addSupportedStream(group.stream);
28 | }
29 | addSupportedAttributesToGroup(group, volumeGroup, strategy);
30 | --
31 | 2.25.1
32 |
33 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0010-Make-camera-IDs-filter-out-optional.patch:
--------------------------------------------------------------------------------
1 | From 972f3dfa9149443fd591b38eb053711062e20e3d Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Mon, 21 Dec 2020 20:19:11 +0100
4 | Subject: [PATCH 10/24] Make camera IDs filter-out optional
5 |
6 | Nowadays most people have Camera 2 apps, and would like to have all
7 | cameras, rather than limit which cameras are available.
8 | Add a property for that.
9 | ---
10 | .../camera/libcameraservice/common/CameraProviderManager.cpp | 4 +++-
11 | 1 file changed, 3 insertions(+), 1 deletion(-)
12 |
13 | diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
14 | index 79f11a75ab..015aa12cfa 100644
15 | --- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
16 | +++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
17 | @@ -183,7 +183,9 @@ std::vector CameraProviderManager::getAPI1CompatibleCameraDeviceIds
18 | // API1 app doesn't handle logical and physical camera devices well. So
19 | // for each camera facing, only take the first id advertised by HAL in
20 | // all [logical, physical1, physical2, ...] id combos, and filter out the rest.
21 | - filterLogicalCameraIdsLocked(providerDeviceIds);
22 | + if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) {
23 | + filterLogicalCameraIdsLocked(providerDeviceIds);
24 | + }
25 | collectDeviceIdsLocked(providerDeviceIds, publicDeviceIds, systemDeviceIds);
26 | }
27 | auto sortFunc =
28 | --
29 | 2.25.1
30 |
31 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0012-audiopolicy-Don-t-crash-on-unknown-audio-devices.patch:
--------------------------------------------------------------------------------
1 | From 5ee716f3474aa63687a64ae5a00eb4d3edf60275 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Tue, 23 Mar 2021 00:16:42 +0100
4 | Subject: [PATCH 12/24] [audiopolicy] Don't crash on unknown audio devices
5 |
6 | Change-Id: I2df8d88f742da6a84aa8888cdf19de25444de919
7 | ---
8 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
9 | 1 file changed, 1 insertion(+), 1 deletion(-)
10 |
11 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
12 | index c6db471c8c..a76da4569b 100644
13 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
14 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
15 | @@ -1011,7 +1011,7 @@ std::variant PolicySerializer::deserialize device = module->getDeclaredDevices().
17 | getDeviceFromTagName(std::string(reinterpret_cast(
18 | attachedDevice.get())));
19 | - if (device == nullptr && mIgnoreVendorExtensions) {
20 | + if (device == nullptr) {
21 | ALOGW("Skipped attached device \"%s\" because it likely uses a vendor"
22 | "extension type",
23 | reinterpret_cast(attachedDevice.get()));
24 | --
25 | 2.25.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0013-Reenable-STRATEGY_ROUTING.-This-is-a-leftover-of-tri.patch:
--------------------------------------------------------------------------------
1 | From 399bc8772ee00a283f83946cc83b4a643b2aad09 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sun, 28 Mar 2021 14:47:52 +0200
4 | Subject: [PATCH 13/24] Reenable STRATEGY_ROUTING. This is a leftover of tries
5 | of 587b198, wrongly commited in 20f869
6 |
7 | ---
8 | services/audiopolicy/enginedefault/src/Engine.cpp | 2 +-
9 | 1 file changed, 1 insertion(+), 1 deletion(-)
10 |
11 | diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
12 | index 314de7889b..c73c17d1e4 100644
13 | --- a/services/audiopolicy/enginedefault/src/Engine.cpp
14 | +++ b/services/audiopolicy/enginedefault/src/Engine.cpp
15 | @@ -52,7 +52,7 @@ static const std::vector& getLegacyStrategy() {
16 | { "STRATEGY_ENFORCED_AUDIBLE", STRATEGY_ENFORCED_AUDIBLE },
17 | { "STRATEGY_TRANSMITTED_THROUGH_SPEAKER", STRATEGY_TRANSMITTED_THROUGH_SPEAKER },
18 | { "STRATEGY_ACCESSIBILITY", STRATEGY_ACCESSIBILITY },
19 | - //{ "STRATEGY_REROUTING", STRATEGY_REROUTING },
20 | + { "STRATEGY_REROUTING", STRATEGY_REROUTING },
21 | { "STRATEGY_PATCH", STRATEGY_REROUTING }, // boiler to manage stream patch volume
22 | { "STRATEGY_CALL_ASSISTANT", STRATEGY_CALL_ASSISTANT },
23 | };
24 | --
25 | 2.25.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0014-Use-a-fake-volume-policy-when-none-has-been-found.patch:
--------------------------------------------------------------------------------
1 | From f3eb05207b8cdb10eac7ee378cfe3f5cdd39d0c6 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sun, 28 Mar 2021 14:48:49 +0200
4 | Subject: [PATCH 14/24] Use a fake volume policy when none has been found
5 |
6 | This is useful, because on Samsung devices, the "real"
7 | (=non-gsi-cheating) audio policy doesn't have any volume policy.
8 |
9 | This requires actually adding the fake audio policy xml file (done in
10 | device/phh/treble)
11 |
12 | Change-Id: I461a3f22893ab2b1d96d67f22397369b2cae41e5
13 | ---
14 | services/audiopolicy/engine/config/src/EngineConfig.cpp | 7 ++++++-
15 | 1 file changed, 6 insertions(+), 1 deletion(-)
16 |
17 | diff --git a/services/audiopolicy/engine/config/src/EngineConfig.cpp b/services/audiopolicy/engine/config/src/EngineConfig.cpp
18 | index 81e803fa7f..340eb1b358 100644
19 | --- a/services/audiopolicy/engine/config/src/EngineConfig.cpp
20 | +++ b/services/audiopolicy/engine/config/src/EngineConfig.cpp
21 | @@ -714,7 +714,12 @@ android::status_t parseLegacyVolumeFile(const char* path, VolumeGroups &volumeGr
22 | android::status_t parseLegacyVolumes(VolumeGroups &volumeGroups) {
23 | if (std::string audioPolicyXmlConfigFile = audio_get_audio_policy_config_file();
24 | !audioPolicyXmlConfigFile.empty()) {
25 | - return parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups);
26 | + int ret = parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups);
27 | + if (ret == NO_ERROR && volumeGroups.size() == 0) {
28 | + ret = parseLegacyVolumeFile("/system/etc/fake_audio_policy_volume.xml", volumeGroups);
29 | + ALOGE("Parsing volume for /system/etc/fake_audio_policy_volume.xml gave %zu", volumeGroups.size());
30 | + }
31 | + return ret;
32 | } else {
33 | ALOGE("No readable audio policy config file found");
34 | return BAD_VALUE;
35 | --
36 | 2.25.1
37 |
38 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch:
--------------------------------------------------------------------------------
1 | From 322638f3f1f9fd459912fd587f56e1d1e279e1c2 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sun, 28 Mar 2021 18:54:47 +0200
4 | Subject: [PATCH 15/24] Not all sources in a route are valid. Dont ignore the
5 | whole route because of one broken source
6 |
7 | Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d
8 | ---
9 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
10 | 1 file changed, 1 insertion(+), 1 deletion(-)
11 |
12 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
13 | index a76da4569b..2ff11ddbab 100644
14 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
15 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
16 | @@ -656,7 +656,7 @@ std::variant PolicySerializer::deserializefindPortByTagName(trim(devTag));
19 | }
20 | - if (source == NULL && !mIgnoreVendorExtensions) {
21 | + if (source == NULL) {
22 | ALOGE("%s: no source found with name=%s", __func__, devTag);
23 | return BAD_VALUE;
24 | } else if (source == NULL) {
25 | --
26 | 2.25.1
27 |
28 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0016-When-aux-cameras-are-enabled-ignore-system-only-came.patch:
--------------------------------------------------------------------------------
1 | From e196f29f865821a6c450d0a209564fc2bd365980 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sat, 7 Aug 2021 11:11:39 +0200
4 | Subject: [PATCH 16/24] When aux cameras are enabled, ignore "system only"
5 | camera flag (it shouldnt be q security issue since secure cameras are listed
6 | otherwise)
7 |
8 | ---
9 | .../libcameraservice/common/CameraProviderManager.cpp | 10 ++++++----
10 | 1 file changed, 6 insertions(+), 4 deletions(-)
11 |
12 | diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
13 | index 75004be52c..3d969845fd 100644
14 | --- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
15 | +++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
16 | @@ -586,10 +586,12 @@ SystemCameraKind CameraProviderManager::ProviderInfo::DeviceInfo3::getSystemCame
17 |
18 | // Go through the capabilities and check if it has
19 | // ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA
20 | - for (size_t i = 0; i < entryCap.count; ++i) {
21 | - uint8_t capability = entryCap.data.u8[i];
22 | - if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA) {
23 | - return SystemCameraKind::SYSTEM_ONLY_CAMERA;
24 | + if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) {
25 | + for (size_t i = 0; i < entryCap.count; ++i) {
26 | + uint8_t capability = entryCap.data.u8[i];
27 | + if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA) {
28 | + return SystemCameraKind::SYSTEM_ONLY_CAMERA;
29 | + }
30 | }
31 | }
32 | return SystemCameraKind::PUBLIC;
33 | --
34 | 2.25.1
35 |
36 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0018-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch:
--------------------------------------------------------------------------------
1 | From 33cdfbe9d451caf03e2a0717404b548739727665 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Mon, 11 Oct 2021 16:10:42 -0400
4 | Subject: [PATCH 18/24] Revert "Remove support for audio HAL V2 from the
5 | framework"
6 |
7 | This reverts commit cbf517f837f7bf8a59f3ff8aa1e0e3e19612e251.
8 |
9 | Also enable new extensions required to actually build
10 |
11 | Change-Id: Icfd638a91b22ffa6d2cd6d19a624e699a85a850a
12 | ---
13 | media/libaudiohal/Android.bp | 1 +
14 | media/libaudiohal/FactoryHalHidl.cpp | 1 +
15 | media/libaudiohal/impl/Android.bp | 18 ++++++++++++++++++
16 | 3 files changed, 20 insertions(+)
17 |
18 | diff --git a/media/libaudiohal/Android.bp b/media/libaudiohal/Android.bp
19 | index bd24c84dbc..f7a9ecc2b7 100644
20 | --- a/media/libaudiohal/Android.bp
21 | +++ b/media/libaudiohal/Android.bp
22 | @@ -23,6 +23,7 @@ cc_library_shared {
23 | ],
24 |
25 | required: [
26 | + "libaudiohal@2.0",
27 | "libaudiohal@4.0",
28 | "libaudiohal@5.0",
29 | "libaudiohal@6.0",
30 | diff --git a/media/libaudiohal/FactoryHalHidl.cpp b/media/libaudiohal/FactoryHalHidl.cpp
31 | index e420d079b8..7228b221b9 100644
32 | --- a/media/libaudiohal/FactoryHalHidl.cpp
33 | +++ b/media/libaudiohal/FactoryHalHidl.cpp
34 | @@ -35,6 +35,7 @@ const char* sAudioHALVersions[] = {
35 | "6.0",
36 | "5.0",
37 | "4.0",
38 | + "2.0",
39 | nullptr
40 | };
41 |
42 | diff --git a/media/libaudiohal/impl/Android.bp b/media/libaudiohal/impl/Android.bp
43 | index a2c6e8aeba..4e360be7e8 100644
44 | --- a/media/libaudiohal/impl/Android.bp
45 | +++ b/media/libaudiohal/impl/Android.bp
46 | @@ -62,6 +62,24 @@ cc_defaults {
47 | ],
48 | }
49 |
50 | +cc_library_shared {
51 | + name: "libaudiohal@2.0",
52 | + defaults: ["libaudiohal_default"],
53 | + shared_libs: [
54 | + "android.hardware.audio.common@2.0",
55 | + "android.hardware.audio.common@2.0-util",
56 | + "android.hardware.audio.effect@2.0",
57 | + "android.hardware.audio.effect@2.0-util",
58 | + "android.hardware.audio@2.0",
59 | + "android.hardware.audio@2.0-util",
60 | + ],
61 | + cflags: [
62 | + "-DMAJOR_VERSION=2",
63 | + "-DMINOR_VERSION=0",
64 | + "-include common/all-versions/VersionMacro.h",
65 | + ]
66 | +}
67 | +
68 | cc_library_shared {
69 | name: "libaudiohal@4.0",
70 | defaults: ["libaudiohal_default"],
71 | --
72 | 2.25.1
73 |
74 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0019-Fix-parsing-audio-hal-7.0-audio-policies.patch:
--------------------------------------------------------------------------------
1 | From 9dfb684105e35b415de9a64454ef9f393cea46b4 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sun, 30 Jan 2022 07:40:19 -0500
4 | Subject: [PATCH 19/24] Fix parsing audio hal 7.0 audio policies
5 |
6 | Google changed separator from natural "," to weird " "
7 | We broke its support in "FIH devices: Fix "Earpiece" audio output"
8 |
9 | Change-Id: I458b8b6a6498dd9cf748e00843ff65c561579902
10 | ---
11 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
12 | 1 file changed, 1 insertion(+), 1 deletion(-)
13 |
14 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
15 | index 2ff11ddbab..df4f2dff63 100644
16 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
17 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
18 | @@ -431,7 +431,7 @@ PolicySerializer::deserialize(
19 | std::string samplingRates = getXmlAttribute(cur, Attributes::samplingRates);
20 | std::string format = getXmlAttribute(cur, Attributes::format);
21 | std::string channels = getXmlAttribute(cur, Attributes::channelMasks);
22 | - ChannelTraits::Collection channelsMask = channelMasksFromString(channels, ",");
23 | + ChannelTraits::Collection channelsMask = channelMasksFromString(channels, mChannelMasksSeparator.c_str());
24 |
25 | //Some Foxconn devices have wrong earpiece channel mask, leading to no channel mask
26 | if(channelsMask.size() == 1 && *channelsMask.begin() == AUDIO_CHANNEL_IN_MONO && isOutput) {
27 | --
28 | 2.25.1
29 |
30 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0020-fixup-Not-all-sources-in-a-route-are-valid.-Dont-ign.patch:
--------------------------------------------------------------------------------
1 | From 51cbabbd0bb3288c643a34aa64710b409f2ece6a Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sat, 12 Mar 2022 18:07:43 -0500
4 | Subject: [PATCH 20/24] fixup! Not all sources in a route are valid. Dont
5 | ignore the whole route because of one broken source
6 |
7 | ---
8 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
9 | 1 file changed, 1 insertion(+), 1 deletion(-)
10 |
11 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
12 | index df4f2dff63..2d6aff6146 100644
13 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
14 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
15 | @@ -656,7 +656,7 @@ std::variant PolicySerializer::deserializefindPortByTagName(trim(devTag));
18 | }
19 | - if (source == NULL) {
20 | + if (source == NULL && false) {
21 | ALOGE("%s: no source found with name=%s", __func__, devTag);
22 | return BAD_VALUE;
23 | } else if (source == NULL) {
24 | --
25 | 2.25.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0021-Next-level-of-force-disable-a2dp-offload-erase-all-m.patch:
--------------------------------------------------------------------------------
1 | From 53697db0dbbbc7f333d6fe59abac5440e957255d Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Tue, 5 Apr 2022 15:07:37 -0400
4 | Subject: [PATCH 21/24] Next level of force disable a2dp offload: erase all
5 | modules related to a2dp, and include our own
6 |
7 | ---
8 | .../managerdefinitions/src/Serializer.cpp | 24 +++++++++++++++++++
9 | 1 file changed, 24 insertions(+)
10 |
11 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
12 | index 2d6aff6146..06c65f1d85 100644
13 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
14 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
15 | @@ -1181,6 +1181,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
16 | if (status != NO_ERROR) {
17 | return status;
18 | }
19 | +
20 | + // Remove modules called bluetooth, bluetooth_qti or a2dp, and inject our own
21 | + if(forceDisableA2dpOffload) {
22 | + for(auto it = modules.begin(); it != modules.end(); it++) {
23 | + const char *name = (*it)->getName();
24 | + if(strcmp(name, "a2dp") == 0 ||
25 | + strcmp(name, "a2dpsink") == 0 ||
26 | + strcmp(name, "bluetooth") == 0 ||
27 | + strcmp(name, "bluetooth_qti") == 0) {
28 | +
29 | + ALOGE("Removed module %s\n", name);
30 | + it = modules.erase(it);
31 | + }
32 | + if(it == modules.end()) break;
33 | + }
34 | + const char* a2dpFileName = "/system/etc/a2dp_audio_policy_configuration.xml";
35 | + if (version == "7.0")
36 | + a2dpFileName = "/system/etc/a2dp_audio_policy_configuration_7_0.xml";
37 | + auto doc = make_xmlUnique(xmlParseFile(a2dpFileName));
38 | + xmlNodePtr root = xmlDocGetRootElement(doc.get());
39 | + auto maybeA2dpModule = deserialize(root, config);
40 | + modules.add(std::get<1>(maybeA2dpModule));
41 | + }
42 | +
43 | config->setHwModules(modules);
44 |
45 | // Global Configuration
46 | --
47 | 2.25.1
48 |
49 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0022-Add-a-prop-to-change-Samsung-flash-strength.patch:
--------------------------------------------------------------------------------
1 | From 46de089f9982988dcadf61db1aee134114600019 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sat, 16 Apr 2022 14:30:14 -0400
4 | Subject: [PATCH 22/24] Add a prop to change Samsung flash strength
5 |
6 | ---
7 | services/camera/libcameraservice/Android.bp | 1 +
8 | .../common/CameraProviderManager.cpp | 14 +++++++++++++-
9 | 2 files changed, 14 insertions(+), 1 deletion(-)
10 |
11 | diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
12 | index a2a2ad623e..b616f8207f 100644
13 | --- a/services/camera/libcameraservice/Android.bp
14 | +++ b/services/camera/libcameraservice/Android.bp
15 | @@ -156,6 +156,7 @@ cc_library_shared {
16 | "android.hardware.camera.device@3.7",
17 | "vendor.samsung.hardware.camera.provider@3.0",
18 | "vendor.samsung.hardware.camera.provider@4.0",
19 | + "vendor.samsung.hardware.camera.device@5.0",
20 | "media_permission-aidl-cpp",
21 | ],
22 |
23 | diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
24 | index 3d969845fd..19f217711c 100644
25 | --- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
26 | +++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
27 | @@ -23,6 +23,7 @@
28 | #include
29 | #include
30 | #include
31 | +#include
32 |
33 | #include
34 | #include
35 | @@ -2278,7 +2279,18 @@ sp CameraProviderManager::ProviderInfo::DeviceInfo::startDeviceInter
36 | template
37 | status_t CameraProviderManager::ProviderInfo::DeviceInfo::setTorchMode(InterfaceT& interface,
38 | bool enabled) {
39 | - Status s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
40 | + int32_t flashStrength = property_get_int32("persist.sys.phh.flash_strength", 1);
41 | +
42 | + auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
43 | + android::sp seh = sehCast;
44 | +
45 | + Status s;
46 | + if(seh != nullptr) {
47 | + s = seh->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
48 | + } else {
49 | + s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
50 | + }
51 | +
52 | return mapToStatusT(s);
53 | }
54 |
55 | --
56 | 2.25.1
57 |
58 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0023-Support-variable-flash-strength-on-samsung-hal-4.0.patch:
--------------------------------------------------------------------------------
1 | From d6adaf1022ba17c8b27d63f9f89e44fc2828d14b Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Mon, 2 May 2022 17:37:09 -0400
4 | Subject: [PATCH 23/24] Support variable flash strength on samsung hal 4.0
5 |
6 | ---
7 | services/camera/libcameraservice/Android.bp | 1 +
8 | .../libcameraservice/common/CameraProviderManager.cpp | 6 ++++++
9 | 2 files changed, 7 insertions(+)
10 |
11 | diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
12 | index b616f8207f..3b99e643e5 100644
13 | --- a/services/camera/libcameraservice/Android.bp
14 | +++ b/services/camera/libcameraservice/Android.bp
15 | @@ -157,6 +157,7 @@ cc_library_shared {
16 | "vendor.samsung.hardware.camera.provider@3.0",
17 | "vendor.samsung.hardware.camera.provider@4.0",
18 | "vendor.samsung.hardware.camera.device@5.0",
19 | + "vendor.samsung.hardware.camera.device@4.0",
20 | "media_permission-aidl-cpp",
21 | ],
22 |
23 | diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
24 | index 19f217711c..f6d8e276ee 100644
25 | --- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
26 | +++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
27 | @@ -24,6 +24,7 @@
28 | #include
29 | #include
30 | #include
31 | +#include
32 |
33 | #include
34 | #include
35 | @@ -2284,9 +2285,14 @@ status_t CameraProviderManager::ProviderInfo::DeviceInfo::setTorchMode(Interface
36 | auto sehCast = vendor::samsung::hardware::camera::device::V5_0::ISehCameraDevice::castFrom(interface);
37 | android::sp seh = sehCast;
38 |
39 | + auto sehCast2 = vendor::samsung::hardware::camera::device::V4_0::ISehCameraDevice::castFrom(interface);
40 | + android::sp seh2 = sehCast2;
41 | +
42 | Status s;
43 | if(seh != nullptr) {
44 | s = seh->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
45 | + } else if(seh2 != nullptr) {
46 | + s = seh2->sehSetTorchModeStrength(enabled ? TorchMode::ON : TorchMode::OFF, flashStrength);
47 | } else {
48 | s = interface->setTorchMode(enabled ? TorchMode::ON : TorchMode::OFF);
49 | }
50 | --
51 | 2.25.1
52 |
53 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_av/0024-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch:
--------------------------------------------------------------------------------
1 | From 5d2164fc7904156fe4c8d5edb9f48f7f67eccd35 Mon Sep 17 00:00:00 2001
2 | From: ponces
3 | Date: Mon, 24 Oct 2022 09:38:34 +0100
4 | Subject: [PATCH 24/24] voip: Fix high pitched voice on Qualcomm devices
5 |
6 | ---
7 | .../common/managerdefinitions/src/Serializer.cpp | 9 +++++++++
8 | 1 file changed, 9 insertions(+)
9 |
10 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
11 | index 06c65f1d85..2847fe278c 100644
12 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
13 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
14 | @@ -252,6 +252,7 @@ private:
15 | std::string mChannelMasksSeparator = ",";
16 | std::string mSamplingRatesSeparator = ",";
17 | std::string mFlagsSeparator = "|";
18 | + std::string mMixPortName = "";
19 |
20 | // Children: ModulesTraits, VolumeTraits, SurroundSoundTraits (optional)
21 | };
22 | @@ -439,6 +440,13 @@ PolicySerializer::deserialize(
23 | channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
24 | }
25 |
26 | + // This breaks in-game voice chat and audio in some messaging apps causing it to play with a higher pitch and speed
27 | + bool disableStereoVoip = property_get_bool("persist.sys.phh.disable_stereo_voip", false);
28 | + if (disableStereoVoip && mMixPortName == "voip_rx") {
29 | + ALOGI("%s: disabling stereo support on voip_rx", __func__);
30 | + channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
31 | + }
32 | +
33 | if (mIgnoreVendorExtensions && maybeVendorExtension(format)) {
34 | ALOGI("%s: vendor extension format \"%s\" skipped", __func__, format.c_str());
35 | return NO_INIT;
36 | @@ -461,6 +469,7 @@ std::variant PolicySerializer::deserialize
3 | Date: Tue, 5 Oct 2021 17:59:16 -0400
4 | Subject: [PATCH 01/35] Fallback to stupid autobrightness if brightness values
5 | are broken
6 |
7 | This is needed because of:
8 | `ava.lang.IllegalArgumentException: The control points must all have strictly increasing X values.`
9 | on some Samsung devices
10 |
11 | Change-Id: Ieb679b34239013a5e31b34cb010b12febd9ef6d9
12 | ---
13 | .../com/android/server/display/DisplayDeviceConfig.java | 7 ++++++-
14 | 1 file changed, 6 insertions(+), 1 deletion(-)
15 |
16 | diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
17 | index 255494f98667..022870870222 100644
18 | --- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java
19 | +++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
20 | @@ -178,7 +178,12 @@ public class DisplayDeviceConfig {
21 | public static DisplayDeviceConfig create(Context context, boolean useConfigXml) {
22 | DisplayDeviceConfig config;
23 | if (useConfigXml) {
24 | - config = getConfigFromGlobalXml(context);
25 | + try {
26 | + config = getConfigFromGlobalXml(context);
27 | + } catch(Exception e) {
28 | + android.util.Log.e("PHH", "Failed parsing automatic brightness values, fallbacking", e);
29 | + config = getConfigFromPmValues(context);
30 | + }
31 | } else {
32 | config = getConfigFromPmValues(context);
33 | }
34 | --
35 | 2.25.1
36 |
37 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0002-Relax-requirement-for-visible-flag-to-sdcards.patch:
--------------------------------------------------------------------------------
1 | From 63e27c6044f7dfbfbd02dc34f0d00fe1e0b9f47d Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Tue, 28 Nov 2017 18:28:04 +0100
4 | Subject: [PATCH 02/35] Relax requirement for visible flag to sdcards
5 |
6 | The vast majority of sdcard readers are stable enough to be declared by
7 | the API. (I see no counter-example)
8 | FBE broke adoptable storage with SDCard, hence this need.
9 |
10 | Change-Id: Ia616671c03562d1eadaff5531a5c708a62d7ad3a
11 | ---
12 | .../core/java/com/android/server/StorageManagerService.java | 3 ++-
13 | 1 file changed, 2 insertions(+), 1 deletion(-)
14 |
15 | diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
16 | index 6fc01bd64688..a41e88a00c0b 100644
17 | --- a/services/core/java/com/android/server/StorageManagerService.java
18 | +++ b/services/core/java/com/android/server/StorageManagerService.java
19 | @@ -1583,7 +1583,8 @@ class StorageManagerService extends IStorageManager.Stub
20 |
21 | // Adoptable public disks are visible to apps, since they meet
22 | // public API requirement of being in a stable location.
23 | - if (vol.disk.isAdoptable()) {
24 | + // Assume all SDs match this as well
25 | + if (vol.disk.isAdoptable() || vol.disk.isSd()) {
26 | vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
27 | }
28 |
29 | --
30 | 2.25.1
31 |
32 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0003-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch:
--------------------------------------------------------------------------------
1 | From f943ee9b934008e10e759a4de8e3c9787d774266 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Thu, 17 May 2018 20:28:35 +0200
4 | Subject: [PATCH 03/35] Don't crash if there is IR HAL is not declared
5 |
6 | Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b
7 | ---
8 | .../core/java/com/android/server/ConsumerIrService.java | 7 -------
9 | services/core/jni/com_android_server_ConsumerIrService.cpp | 2 +-
10 | 2 files changed, 1 insertion(+), 8 deletions(-)
11 |
12 | diff --git a/services/core/java/com/android/server/ConsumerIrService.java b/services/core/java/com/android/server/ConsumerIrService.java
13 | index 2ed6c77baa0d..82ec033bc30b 100644
14 | --- a/services/core/java/com/android/server/ConsumerIrService.java
15 | +++ b/services/core/java/com/android/server/ConsumerIrService.java
16 | @@ -46,13 +46,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub {
17 | mWakeLock.setReferenceCounted(true);
18 |
19 | mHasNativeHal = halOpen();
20 | - if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONSUMER_IR)) {
21 | - if (!mHasNativeHal) {
22 | - throw new RuntimeException("FEATURE_CONSUMER_IR present, but no IR HAL loaded!");
23 | - }
24 | - } else if (mHasNativeHal) {
25 | - throw new RuntimeException("IR HAL present, but FEATURE_CONSUMER_IR is not set!");
26 | - }
27 | }
28 |
29 | @Override
30 | diff --git a/services/core/jni/com_android_server_ConsumerIrService.cpp b/services/core/jni/com_android_server_ConsumerIrService.cpp
31 | index 2ca348b3ae46..148fba9a688c 100644
32 | --- a/services/core/jni/com_android_server_ConsumerIrService.cpp
33 | +++ b/services/core/jni/com_android_server_ConsumerIrService.cpp
34 | @@ -36,7 +36,7 @@ static sp mHal;
35 |
36 | static jboolean halOpen(JNIEnv* /* env */, jobject /* obj */) {
37 | // TODO(b/31632518)
38 | - mHal = IConsumerIr::getService();
39 | + mHal = IConsumerIr::tryGetService();
40 | return mHal != nullptr;
41 | }
42 |
43 | --
44 | 2.25.1
45 |
46 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0004-Show-APN-Settings-for-CDMA-carriers.patch:
--------------------------------------------------------------------------------
1 | From 81ff6eaf2a7f2123fba55111bbe393ff15325b4a Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Mon, 6 Aug 2018 12:49:00 +0200
4 | Subject: [PATCH 04/35] Show APN Settings for CDMA carriers
5 |
6 | ---
7 | telephony/java/android/telephony/CarrierConfigManager.java | 2 +-
8 | 1 file changed, 1 insertion(+), 1 deletion(-)
9 |
10 | diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
11 | index 1ca251d370ab..cb05839ba220 100644
12 | --- a/telephony/java/android/telephony/CarrierConfigManager.java
13 | +++ b/telephony/java/android/telephony/CarrierConfigManager.java
14 | @@ -5483,7 +5483,7 @@ public class CarrierConfigManager {
15 | sDefaults.putBoolean(KEY_MDN_IS_ADDITIONAL_VOICEMAIL_NUMBER_BOOL, false);
16 | sDefaults.putBoolean(KEY_OPERATOR_SELECTION_EXPAND_BOOL, true);
17 | sDefaults.putBoolean(KEY_PREFER_2G_BOOL, true);
18 | - sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, false);
19 | + sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, true);
20 | sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, false);
21 | sDefaults.putBoolean(KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL, false);
22 | sDefaults.putBoolean(KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL, false);
23 | --
24 | 2.25.1
25 |
26 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0005-Re-order-services-so-that-it-works-even-without-qtag.patch:
--------------------------------------------------------------------------------
1 | From 450213030a471318407f884e6ae2afa05ec72405 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Thu, 8 Nov 2018 23:04:03 +0100
4 | Subject: [PATCH 05/35] Re-order services so that it works even without qtaguid
5 |
6 | Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df
7 | ---
8 | .../android/server/net/NetworkPolicyManagerService.java | 8 ++++----
9 | 1 file changed, 4 insertions(+), 4 deletions(-)
10 |
11 | diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
12 | index cfefffcdd2e8..197fed7c8834 100644
13 | --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
14 | +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
15 | @@ -845,6 +845,10 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
16 | Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "systemReady");
17 | final int oldPriority = Process.getThreadPriority(Process.myTid());
18 | try {
19 | + mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class);
20 | + mAppStandby = LocalServices.getService(AppStandbyInternal.class);
21 | + mNetworkStats = LocalServices.getService(NetworkStatsManagerInternal.class);
22 | +
23 | // Boost thread's priority during system server init
24 | Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
25 | if (!isBandwidthControlEnabled()) {
26 | @@ -852,10 +856,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
27 | return;
28 | }
29 |
30 | - mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class);
31 | - mAppStandby = LocalServices.getService(AppStandbyInternal.class);
32 | - mNetworkStats = LocalServices.getService(NetworkStatsManagerInternal.class);
33 | -
34 | synchronized (mUidRulesFirstLock) {
35 | synchronized (mNetworkPoliciesSecondLock) {
36 | updatePowerSaveWhitelistUL();
37 | --
38 | 2.25.1
39 |
40 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0008-Always-allow-overriding-the-number-of-work-profiles.patch:
--------------------------------------------------------------------------------
1 | From f730bda0fd6219ff18075052fd94058f1e094292 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sun, 5 Apr 2020 16:32:46 +0200
4 | Subject: [PATCH 08/35] Always allow overriding the number of work profiles
5 |
6 | Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a
7 | ---
8 | .../java/com/android/server/pm/UserManagerService.java | 8 ++------
9 | 1 file changed, 2 insertions(+), 6 deletions(-)
10 |
11 | diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
12 | index 09c6b50571d4..74c50137f597 100644
13 | --- a/services/core/java/com/android/server/pm/UserManagerService.java
14 | +++ b/services/core/java/com/android/server/pm/UserManagerService.java
15 | @@ -5865,12 +5865,8 @@ public class UserManagerService extends IUserManager.Stub {
16 | */
17 | private static int getMaxUsersOfTypePerParent(UserTypeDetails userTypeDetails) {
18 | final int defaultMax = userTypeDetails.getMaxAllowedPerParent();
19 | - if (!Build.IS_DEBUGGABLE) {
20 | - return defaultMax;
21 | - } else {
22 | - if (userTypeDetails.isManagedProfile()) {
23 | - return SystemProperties.getInt("persist.sys.max_profiles", defaultMax);
24 | - }
25 | + if (userTypeDetails.isManagedProfile()) {
26 | + return SystemProperties.getInt("persist.sys.max_profiles", defaultMax);
27 | }
28 | return defaultMax;
29 | }
30 | --
31 | 2.25.1
32 |
33 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0009-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch:
--------------------------------------------------------------------------------
1 | From b90f7d1e60221568bf9a8bef2b7855f71196e99c Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sat, 6 Jun 2020 18:21:56 +0200
4 | Subject: [PATCH 09/35] HOME deserves to wake-up devices just as well as back
5 | and menu
6 |
7 | Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a
8 | ---
9 | core/java/android/view/KeyEvent.java | 1 +
10 | 1 file changed, 1 insertion(+)
11 |
12 | diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
13 | index cda9b233576c..bb35e3172165 100644
14 | --- a/core/java/android/view/KeyEvent.java
15 | +++ b/core/java/android/view/KeyEvent.java
16 | @@ -1988,6 +1988,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
17 | switch (keyCode) {
18 | case KeyEvent.KEYCODE_CAMERA:
19 | case KeyEvent.KEYCODE_MENU:
20 | + case KeyEvent.KEYCODE_HOME:
21 | case KeyEvent.KEYCODE_PAIRING:
22 | case KeyEvent.KEYCODE_STEM_1:
23 | case KeyEvent.KEYCODE_STEM_2:
24 | --
25 | 2.25.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0010-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch:
--------------------------------------------------------------------------------
1 | From 09d75a135dbfb94a430ebfdcfb1e0abaf8f02c91 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Tue, 29 Sep 2020 22:39:47 +0200
4 | Subject: [PATCH 10/35] Some devices have proximity sensor reporting NaN as max
5 | range for some reason. Make them behave standard way by setting 5 cm
6 |
7 | Change-Id: I3c39e3e914a05903c140235702e0480d2d58a612
8 | ---
9 | .../com/android/server/display/DisplayPowerController.java | 3 +++
10 | 1 file changed, 3 insertions(+)
11 |
12 | diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
13 | index c5f380964400..0c2829a2a86c 100644
14 | --- a/services/core/java/com/android/server/display/DisplayPowerController.java
15 | +++ b/services/core/java/com/android/server/display/DisplayPowerController.java
16 | @@ -1744,6 +1744,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
17 | if (mProximitySensor != null) {
18 | mProximityThreshold = Math.min(mProximitySensor.getMaximumRange(),
19 | TYPICAL_PROXIMITY_THRESHOLD);
20 | + if(Float.isNaN(mProximityThreshold)) {
21 | + mProximityThreshold = 5.0f;
22 | + }
23 | }
24 | }
25 |
26 | --
27 | 2.25.1
28 |
29 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0011-Fix-brightness-range-not-being-complete-on-Samsung-d.patch:
--------------------------------------------------------------------------------
1 | From a589ed6c82acc507440821766bd1e8c985243af1 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Tue, 29 Sep 2020 22:40:10 +0200
4 | Subject: [PATCH 11/35] Fix brightness range not being complete on Samsung
5 | devices
6 |
7 | On some devices, minimum brightness is 0, which totally messes with
8 | Brightness computations (minimum float brightness becomes -1.0 instead
9 | of 0.0...).
10 | Cheat and have them report 1 as minimum instead, which fixes the slope
11 |
12 | Change-Id: I4d97cbc32490949e83272b81ec6320a5483310b1
13 | ---
14 | .../java/com/android/server/power/PowerManagerService.java | 6 ++++--
15 | 1 file changed, 4 insertions(+), 2 deletions(-)
16 |
17 | diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
18 | index 8c7d257d271b..10c624eba54d 100644
19 | --- a/services/core/java/com/android/server/power/PowerManagerService.java
20 | +++ b/services/core/java/com/android/server/power/PowerManagerService.java
21 | @@ -995,9 +995,11 @@ public final class PowerManagerService extends SystemService
22 |
23 | if (min == INVALID_BRIGHTNESS_IN_CONFIG || max == INVALID_BRIGHTNESS_IN_CONFIG
24 | || def == INVALID_BRIGHTNESS_IN_CONFIG) {
25 | + int correctedMin = mContext.getResources().getInteger(com.android.internal.R.integer
26 | + .config_screenBrightnessSettingMinimum);
27 | + if(correctedMin == 0) correctedMin = 1;
28 | mScreenBrightnessMinimum = BrightnessSynchronizer.brightnessIntToFloat(
29 | - mContext.getResources().getInteger(com.android.internal.R.integer
30 | - .config_screenBrightnessSettingMinimum));
31 | + correctedMin);
32 | mScreenBrightnessMaximum = BrightnessSynchronizer.brightnessIntToFloat(
33 | mContext.getResources().getInteger(com.android.internal.R.integer
34 | .config_screenBrightnessSettingMaximum));
35 | --
36 | 2.25.1
37 |
38 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0012-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch:
--------------------------------------------------------------------------------
1 | From 42ea47c3058772dc227f334753c0e96e7abe2af7 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sun, 25 Oct 2020 23:57:26 +0100
4 | Subject: [PATCH 12/35] Re-implement fnmatch-like behaviour for RRO java-side
5 |
6 | Change-Id: Id38292a9a1453aa87b8401c1fdb390fa4e63c7d1
7 | ---
8 | core/java/android/content/pm/PackageParser.java | 13 +++++++++++--
9 | 1 file changed, 11 insertions(+), 2 deletions(-)
10 |
11 | diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
12 | index 4ff26242dab2..9379a634afa8 100644
13 | --- a/core/java/android/content/pm/PackageParser.java
14 | +++ b/core/java/android/content/pm/PackageParser.java
15 | @@ -2489,8 +2489,17 @@ public class PackageParser {
16 | for (int i = 0; i < propNames.length; i++) {
17 | // Check property value: make sure it is both set and equal to expected value
18 | final String currValue = SystemProperties.get(propNames[i]);
19 | - if (!TextUtils.equals(currValue, propValues[i])) {
20 | - return false;
21 | + final String value = propValues[i];
22 | + if(value.startsWith("+")) {
23 | + final java.util.regex.Pattern regex = java.util.regex.Pattern.compile(value.substring(1, value.length()).replace("*", ".*"));
24 | + java.util.regex.Matcher matcher = regex.matcher(currValue);
25 | + if (!matcher.find()) {
26 | + return false;
27 | + }
28 | + } else {
29 | + if(!value.equals(currValue)) {
30 | + return false;
31 | + }
32 | }
33 | }
34 | return true;
35 | --
36 | 2.25.1
37 |
38 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0014-Remove-useless-notification-about-console-service-be.patch:
--------------------------------------------------------------------------------
1 | From 17d6c112a8d8fbe020c0c6a266fe73f560789098 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Fri, 11 Dec 2020 14:41:09 +0100
4 | Subject: [PATCH 14/35] Remove useless notification about "console" service
5 | being running
6 |
7 | ---
8 | .../core/java/com/android/server/am/ActivityManagerService.java | 2 +-
9 | 1 file changed, 1 insertion(+), 1 deletion(-)
10 |
11 | diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
12 | index a32aa6d895ef..38553b8a5b46 100644
13 | --- a/services/core/java/com/android/server/am/ActivityManagerService.java
14 | +++ b/services/core/java/com/android/server/am/ActivityManagerService.java
15 | @@ -4802,7 +4802,7 @@ public class ActivityManagerService extends IActivityManager.Stub
16 | }
17 |
18 | private void showConsoleNotificationIfActive() {
19 | - if (!SystemProperties.get("init.svc.console").equals("running")) {
20 | + if (!SystemProperties.get("init.svc.console").equals("running") || true) {
21 | return;
22 | }
23 | String title = mContext
24 | --
25 | 2.25.1
26 |
27 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0017-TelephonyManager-add-API-annotations-for-setTelephon.patch:
--------------------------------------------------------------------------------
1 | From e6a60f104444c53cdcce6c9bfeec88a4e0e6fb9c Mon Sep 17 00:00:00 2001
2 | From: Peter Cai
3 | Date: Wed, 16 Dec 2020 21:26:45 +0800
4 | Subject: [PATCH 17/35] TelephonyManager: add API annotations for
5 | setTelephonyProperty
6 |
7 | * This method was added back by reverting commit
8 | debb4616ef67f9ed5054eca51ec58592358ff55f, but they do not conform to
9 | the new R API requirements.
10 |
11 | * R requires such annotations.
12 | ---
13 | telephony/java/android/telephony/TelephonyManager.java | 5 +++--
14 | 1 file changed, 3 insertions(+), 2 deletions(-)
15 |
16 | diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
17 | index 967ad10f697d..e5b80e4cee30 100644
18 | --- a/telephony/java/android/telephony/TelephonyManager.java
19 | +++ b/telephony/java/android/telephony/TelephonyManager.java
20 | @@ -7470,7 +7470,7 @@ public class TelephonyManager {
21 | * @hide
22 | */
23 | @UnsupportedAppUsage
24 | - public static void setTelephonyProperty(int phoneId, String property, String value) {
25 | + public static void setTelephonyProperty(int phoneId, @NonNull String property, @Nullable String value) {
26 | String propVal = "";
27 | String p[] = null;
28 | String prop = SystemProperties.get(property);
29 | @@ -7524,7 +7524,8 @@ public class TelephonyManager {
30 | *
31 | * @hide
32 | */
33 | - public static void setTelephonyProperty(String property, String value) {
34 | + @UnsupportedAppUsage
35 | + public static void setTelephonyProperty(@NonNull String property, @Nullable String value) {
36 | if (value == null) {
37 | value = "";
38 | }
39 | --
40 | 2.25.1
41 |
42 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0018-Fix-Wakelock-issue.patch:
--------------------------------------------------------------------------------
1 | From 6764c90fce7d0d4ea02689a8260c7c19e5afe124 Mon Sep 17 00:00:00 2001
2 | From: Alberto Ponces
3 | Date: Tue, 2 Feb 2021 10:20:51 +0000
4 | Subject: [PATCH 18/35] Fix Wakelock issue
5 |
6 | Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue #12) by only releasing a wakelock that was not already released
7 | ---
8 | .../src/com/android/systemui/util/wakelock/WakeLock.java | 4 +++-
9 | 1 file changed, 3 insertions(+), 1 deletion(-)
10 |
11 | diff --git a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
12 | index 8d77c4a194a9..e9f253433740 100644
13 | --- a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
14 | +++ b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
15 | @@ -110,7 +110,9 @@ public interface WakeLock {
16 | } else {
17 | mActiveClients.put(why, count - 1);
18 | }
19 | - inner.release();
20 | + if (inner.isHeld()) {
21 | + inner.release();
22 | + }
23 | }
24 |
25 | /** @see PowerManager.WakeLock#wrap(Runnable) */
26 | --
27 | 2.25.1
28 |
29 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0019-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch:
--------------------------------------------------------------------------------
1 | From 20f8597eb8a8473082ab1a436da4cdb3525cbac0 Mon Sep 17 00:00:00 2001
2 | From: Arne Coucheron
3 | Date: Thu, 5 Nov 2020 05:38:44 +0100
4 | Subject: [PATCH 19/35] SystemUI: Use AVCProfileMain for screen recorder
5 |
6 | Some devices don't support the High profile very well.
7 | Use Main profile, which is more compatible, so they
8 | can use screen recorder too.
9 |
10 | Change-Id: Iac23480e080edf4300e6f411c3394c0b41030daa
11 | ---
12 | .../com/android/systemui/screenrecord/ScreenMediaRecorder.java | 2 +-
13 | 1 file changed, 1 insertion(+), 1 deletion(-)
14 |
15 | diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java
16 | index 2133cf63d1c3..6100b6030544 100644
17 | --- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java
18 | +++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java
19 | @@ -135,7 +135,7 @@ public class ScreenMediaRecorder {
20 | * VIDEO_FRAME_RATE_TO_RESOLUTION_RATIO;
21 | mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
22 | mMediaRecorder.setVideoEncodingProfileLevel(
23 | - MediaCodecInfo.CodecProfileLevel.AVCProfileHigh,
24 | + MediaCodecInfo.CodecProfileLevel.AVCProfileMain,
25 | MediaCodecInfo.CodecProfileLevel.AVCLevel3);
26 | mMediaRecorder.setVideoSize(width, height);
27 | mMediaRecorder.setVideoFrameRate(refreshRate);
28 | --
29 | 2.25.1
30 |
31 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0020-Automatically-detect-pick-up-sensor-so-that-an-overl.patch:
--------------------------------------------------------------------------------
1 | From 576e79dc3e7ad3076e38d57af7228851b5daa8f0 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Sat, 20 Mar 2021 14:31:01 +0100
4 | Subject: [PATCH 20/35] Automatically detect pick up sensor, so that an overlay
5 | is required for the sole purpose of enabling pulse doze on pick up sensor
6 |
7 | ---
8 | .../display/AmbientDisplayConfiguration.java | 18 +++++++++++++++++-
9 | 1 file changed, 17 insertions(+), 1 deletion(-)
10 |
11 | diff --git a/core/java/android/hardware/display/AmbientDisplayConfiguration.java b/core/java/android/hardware/display/AmbientDisplayConfiguration.java
12 | index 0b1ed65ef937..61a7522f38f4 100644
13 | --- a/core/java/android/hardware/display/AmbientDisplayConfiguration.java
14 | +++ b/core/java/android/hardware/display/AmbientDisplayConfiguration.java
15 | @@ -23,6 +23,9 @@ import android.os.SystemProperties;
16 | import android.provider.Settings;
17 | import android.text.TextUtils;
18 |
19 | +import android.hardware.SensorManager;
20 | +import android.hardware.Sensor;
21 | +
22 | import com.android.internal.R;
23 | import com.android.internal.util.ArrayUtils;
24 |
25 | @@ -77,7 +80,20 @@ public class AmbientDisplayConfiguration {
26 |
27 | /** {@hide} */
28 | public boolean dozePickupSensorAvailable() {
29 | - return mContext.getResources().getBoolean(R.bool.config_dozePulsePickup);
30 | + SensorManager sm = mContext.getSystemService(SensorManager.class);
31 | + boolean found = false;
32 | + if(sm == null) {
33 | + android.util.Log.d("PHH", "Failed getting sensor manager, can't detect pickup sensor");
34 | + } else {
35 | + java.util.List sensors = sm.getSensorList(Sensor.TYPE_ALL);
36 | + for(Sensor s : sensors) {
37 | + if(Sensor.STRING_TYPE_PICK_UP_GESTURE.equals(s.getStringType())) {
38 | + found = true;
39 | + break;
40 | + }
41 | + }
42 | + }
43 | + return mContext.getResources().getBoolean(R.bool.config_dozePulsePickup) || found;
44 | }
45 |
46 | /** {@hide} */
47 | --
48 | 2.25.1
49 |
50 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0021-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch:
--------------------------------------------------------------------------------
1 | From a2c1e56fbbbb9680aa927647aac3fe52f71d1a88 Mon Sep 17 00:00:00 2001
2 | From: Pierre-Hugues Husson
3 | Date: Tue, 23 Mar 2021 19:43:26 +0100
4 | Subject: [PATCH 21/35] Catch broken mainBuiltInDisplayCutoutRectApproximation
5 |
6 | Some devices (Redmi Note 9T) have:
7 | mainBuiltInDisplayCutoutRectApproximation = @android:mainBuiltInDisplayCutout
8 | Since mainBuiltInDisplayCutout is private, its ID is dynamic and can't
9 | be relied upon.
10 | This means that we'll get garbage in mainBuiltInDisplayCutoutRectApproximation
11 | The SVG Path parser will fail, triggering an exception.
12 |
13 | Fix it by catching it, and parsing mainBuiltInDisplayCutout instead
14 |
15 | Change-Id: I03b6e78bac2cc38f3a623c8add801405ad6ba7ba
16 | ---
17 | core/java/android/view/DisplayCutout.java | 15 +++++++++++----
18 | 1 file changed, 11 insertions(+), 4 deletions(-)
19 |
20 | diff --git a/core/java/android/view/DisplayCutout.java b/core/java/android/view/DisplayCutout.java
21 | index c1a5636b7b34..2f3d71c963c8 100644
22 | --- a/core/java/android/view/DisplayCutout.java
23 | +++ b/core/java/android/view/DisplayCutout.java
24 | @@ -987,10 +987,17 @@ public final class DisplayCutout {
25 | */
26 | public static DisplayCutout fromResourcesRectApproximation(Resources res,
27 | String displayUniqueId, int displayWidth, int displayHeight) {
28 | - return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId),
29 | - getDisplayCutoutApproximationRect(res, displayUniqueId),
30 | - displayWidth, displayHeight, DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT,
31 | - getWaterfallInsets(res, displayUniqueId)).second;
32 | + try {
33 | + return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId),
34 | + getDisplayCutoutApproximationRect(res, displayUniqueId),
35 | + displayWidth, displayHeight, DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT,
36 | + getWaterfallInsets(res, displayUniqueId)).second;
37 | + } catch(Throwable t) {
38 | + return pathAndDisplayCutoutFromSpec(getDisplayCutoutPath(res, displayUniqueId),
39 | + null,
40 | + displayWidth, displayHeight, DENSITY_DEVICE_STABLE / (float) DENSITY_DEFAULT,
41 | + getWaterfallInsets(res, displayUniqueId)).second;
42 | + }
43 | }
44 |
45 | /**
46 | --
47 | 2.25.1
48 |
49 |
--------------------------------------------------------------------------------
/treble_aosp/patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch:
--------------------------------------------------------------------------------
1 | From 4c797b922204ab8d933a217a1ab8df139c57311f Mon Sep 17 00:00:00 2001
2 | From: Andy CrossGate Yan
3 | Date: Sat, 4 Sep 2021 08:26:30 +0000
4 | Subject: [PATCH 24/35] Revert "Switch long-press power behavior in AOSP."
5 |
6 | This reverts commit 803c77a0a24624111944832098c6f65158051dc4.
7 | ---
8 | core/res/res/values/config.xml | 4 ++--
9 | 1 file changed, 2 insertions(+), 2 deletions(-)
10 |
11 | diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
12 | index 21c6f087a2d4..beddd6767eea 100644
13 | --- a/core/res/res/values/config.xml
14 | +++ b/core/res/res/values/config.xml
15 | @@ -977,7 +977,7 @@
16 | 4 - Go to voice assist
17 | 5 - Go to assistant (Settings.Secure.ASSISTANT)
18 | -->
19 | - 5
20 | + 1
21 |
22 |
23 | 500
24 | @@ -1009,7 +1009,7 @@
25 | 1 - Mute toggle
26 | 2 - Global actions menu
27 | -->
28 | - 2
29 | + 1
30 |
31 |
20 |
21 | - 280
22 | + 70
23 |
24 |
25 | Getting latest upstream version"
18 | aosp=$(curl -sL https://github.com/TrebleDroid/treble_manifest/raw/$TD/replace.xml | grep -oP "${TD}.0_r\d+" | head -1)
19 |
20 | echo "--> Initializing workspace"
21 | repo init -u https://android.googlesource.com/platform/manifest -b "$aosp"
22 | echo
23 |
24 | echo "--> Preparing local manifest"
25 | if [ -d .repo/local_manifests ]; then
26 | (cd .repo/local_manifests; git fetch; git reset --hard; git checkout origin/$TD)
27 | else
28 | git clone https://github.com/TrebleDroid/treble_manifest .repo/local_manifests -b $TD
29 | fi
30 | echo
31 | }
32 |
33 | syncRepos() {
34 | echo "--> Syncing repos"
35 | repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all) || repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
36 | echo
37 | }
38 |
39 | generatePatches() {
40 | echo "--> Generating patches"
41 | rm -rf patchestd patchestd.zip
42 | wget -q https://github.com/TrebleDroid/treble_experimentations/raw/master/list-patches.sh -O list-patches.sh
43 | sed -i "s/patches/patchestd/g" list-patches.sh
44 | bash list-patches.sh
45 | echo
46 | }
47 |
48 | updatePatches() {
49 | echo "--> Updating patches"
50 | rm -rf $BL/patches/trebledroid
51 | unzip -q patchestd.zip
52 | mv patchestd $BL/patches/trebledroid
53 | echo
54 | }
55 |
56 | START=$(date +%s)
57 |
58 | initRepos
59 | syncRepos
60 | generatePatches
61 | updatePatches
62 |
63 | END=$(date +%s)
64 | ELAPSEDM=$(($(($END-$START))/60))
65 | ELAPSEDS=$(($(($END-$START))-$ELAPSEDM*60))
66 |
67 | echo "--> Syncbot completed in $ELAPSEDM minutes and $ELAPSEDS seconds"
68 | echo
69 |
--------------------------------------------------------------------------------
/vendor/ponces/rro_overlays/GsiFrameworksOverlay/res/drawable-nodpi/default_wallpaper.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LoggingNewMemory/KLC_OS/94322e5364008a4ca2b86a3f6da3ad92872b83a7/vendor/ponces/rro_overlays/GsiFrameworksOverlay/res/drawable-nodpi/default_wallpaper.jpg
--------------------------------------------------------------------------------