commit 758cd0d33b5a53a9d60af8284cca149e3732afb6 Author: Andy CrossGate Yan Date: Sun Dec 20 10:08:50 2020 +0000 Initial commit for Android 11 diff --git a/README.md b/README.md new file mode 100644 index 0000000..81a90ec --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ + +## Building PHH-based LineageOS GSIs ## + +To get started with building LineageOS 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). + +First, open a new Terminal window, which defaults to your home directory. Clone the modified treble_experimentations repo there: + + git clone https://github.com/AndyCGYan/treble_experimentations + +Create a new working directory for your LineageOS build and navigate to it: + + mkdir lineage-18.x-build-gsi; cd lineage-18.x-build-gsi + +Initialize your LineageOS workspace: + + repo init -u https://github.com/LineageOS/android.git -b lineage-18.1 + +Clone the modified treble patches and this repo: + + git clone https://github.com/AndyCGYan/treble_patches -b lineage-18.1 + git clone https://github.com/AndyCGYan/treble_build_los -b lineage-18.1 + +Finally, start the build script: + + bash treble_build_los/buildbot_treble.sh + +Be sure to update the cloned repos from time to time! + +--- + +Note: A-only and VNDKLite targets are now generated from AB images - refer to [sas-creator](https://github.com/phhusson/sas-creator). diff --git a/buildbot_treble.sh b/buildbot_treble.sh new file mode 100755 index 0000000..52f0c08 --- /dev/null +++ b/buildbot_treble.sh @@ -0,0 +1,122 @@ +#!/bin/bash +echo "" +echo "LineageOS 18.x Treble Buildbot" +echo "ATTENTION: this script syncs repo on each run" +echo "Executing in 5 seconds - CTRL-C to exit" +echo "" +sleep 5 + +START=`date +%s` +BUILD_DATE="$(date +%Y%m%d)" +BL=$PWD/treble_build_los + +echo "Preparing local manifest" +mkdir -p .repo/local_manifests +cp $BL/manifest.xml .repo/local_manifests/manifest.xml +echo "" + +echo "Syncing repos" +repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all) +echo "" + +echo "Setting up build environment" +source build/envsetup.sh &> /dev/null +echo "" + +repopick -t eleven-dialer-master +repopick -t eleven-telephony-master +repopick 289372 # Messaging: Add "Mark as read" quick action for message notifications + +echo "Reverting LOS FOD implementation" +cd frameworks/base +git am $BL/patches/0001-Squashed-revert-of-LOS-FOD-implementation.patch +cd ../.. +cd frameworks/native +git revert 381416d540ea92dca5f64cd48fd8c9dc887cac7b --no-edit # surfaceflinger: Add support for extension lib +cd ../.. +echo "" + +echo "Applying PHH patches" +rm -f device/*/sepolicy/common/private/genfs_contexts +cd device/phh/treble +git clean -fdx +bash generate.sh lineage +cd ../../.. +bash ~/treble_experimentations/apply-patches.sh treble_patches +echo "" + +echo "Applying universal patches" +cd frameworks/base +git am $BL/patches/0001-UI-Revive-navbar-layout-tuning-via-sysui_nav_bar-tun.patch +git am $BL/patches/0001-Disable-vendor-mismatch-warning.patch +cd ../.. +cd lineage-sdk +git am $BL/patches/0001-sdk-Invert-per-app-stretch-to-fullscreen.patch +cd .. +cd packages/apps/LineageParts +git am $BL/patches/0001-LineageParts-Invert-per-app-stretch-to-fullscreen.patch +cd ../../.. +cd vendor/lineage +git am $BL/patches/0001-vendor_lineage-Log-privapp-permissions-whitelist-vio.patch +cd ../.. +echo "" + +echo "Applying GSI-specific patches" +cd bootable/recovery +git revert 0e369f42b82c4d12edba9a46dd20bee0d4b783ec --no-edit # recovery: Allow custom bootloader msg offset in block misc +cd ../.. +cd build/make +git am $BL/patches/0001-build-Don-t-handle-apns-conf.patch +cd ../.. +cd device/phh/treble +git revert 82b15278bad816632dcaeaed623b569978e9840d --no-edit # Update lineage.mk for LineageOS 16.0 +git am $BL/patches/0001-Remove-fsck-SELinux-labels.patch +git am $BL/patches/0001-treble-Add-overlay-lineage.patch +git am $BL/patches/0001-treble-Don-t-specify-config_wallpaperCropperPackage.patch +cd ../../.. +cd frameworks/av +git revert 5a5606dbd92f01de322c797a7128fce69902d067 --no-edit # camera: Allow devices to load custom CameraParameter code +cd ../.. +cd frameworks/native +git revert 581c22f979af05e48ad4843cdfa9605186d286da --no-edit # Add suspend_resume trace events to the atrace 'freq' category. +cd ../.. +cd system/core +git am $BL/patches/0001-Revert-init-Add-vendor-specific-initialization-hooks.patch +cd ../.. +cd system/hardware/interfaces +git revert cb732f9b635b5f6f79e447ddaf743ebb800b8535 --no-edit # system_suspend: start early +cd ../../.. +cd system/sepolicy +git am $BL/patches/0001-Revert-sepolicy-Relabel-wifi.-properties-as-wifi_pro.patch +cd ../.. +cd vendor/lineage +git am $BL/patches/0001-build_soong-Disable-generated_kernel_headers.patch +cd ../.. +echo "" + +echo "CHECK PATCH STATUS NOW!" +sleep 5 +echo "" + +export WITHOUT_CHECK_API=true +export WITH_SU=true +mkdir -p ~/build-output/ + +buildVariant() { + lunch ${1}-userdebug + make installclean + make -j$(nproc --all) systemimage + make vndk-test-sepolicy + mv $OUT/system.img ~/build-output/lineage-18.1-$BUILD_DATE-UNOFFICIAL-${1}.img +} + +buildVariant treble_arm_bvS +buildVariant treble_a64_bvS +buildVariant treble_arm64_bvS +ls ~/build-output | grep 'lineage' + +END=`date +%s` +ELAPSEDM=$(($(($END-$START))/60)) +ELAPSEDS=$(($(($END-$START))-$ELAPSEDM*60)) +echo "Buildbot completed in $ELAPSEDM minutes and $ELAPSEDS seconds" +echo "" diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..e488b99 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/patches/0001-Disable-vendor-mismatch-warning.patch b/patches/0001-Disable-vendor-mismatch-warning.patch new file mode 100644 index 0000000..d5acc63 --- /dev/null +++ b/patches/0001-Disable-vendor-mismatch-warning.patch @@ -0,0 +1,40 @@ +From 9b907d3b202fd3f7a892b50eacd92e4d51877606 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Thu, 5 Apr 2018 10:01:19 +0800 +Subject: [PATCH] Disable vendor mismatch warning + +Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b +--- + .../server/wm/ActivityTaskManagerService.java | 16 ++-------------- + 1 file changed, 2 insertions(+), 14 deletions(-) + +diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +index ef02fd52999..b6bccb1c21c 100644 +--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java ++++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +@@ -6486,20 +6486,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { + } + + if (!Build.isBuildConsistent()) { +- Slog.e(TAG, "Build fingerprint is not consistent, warning user"); +- mUiHandler.post(() -> { +- if (mShowDialogs) { +- AlertDialog d = new BaseErrorDialog(mUiContext); +- d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR); +- d.setCancelable(false); +- d.setTitle(mUiContext.getText(R.string.android_system_label)); +- d.setMessage(mUiContext.getText(R.string.system_error_manufacturer)); +- d.setButton(DialogInterface.BUTTON_POSITIVE, +- mUiContext.getText(R.string.ok), +- mUiHandler.obtainMessage(DISMISS_DIALOG_UI_MSG, d)); +- d.show(); +- } +- }); ++ Slog.e(TAG, "Build fingerprint is not consistent"); ++ // Do not emit warning about vendor mismatch + } + } + } +-- +2.17.1 + diff --git a/patches/0001-LineageParts-Invert-per-app-stretch-to-fullscreen.patch b/patches/0001-LineageParts-Invert-per-app-stretch-to-fullscreen.patch new file mode 100644 index 0000000..f03bfb1 --- /dev/null +++ b/patches/0001-LineageParts-Invert-per-app-stretch-to-fullscreen.patch @@ -0,0 +1,105 @@ +From 47bf5612cec98931ee3076c307247ac58d07ccff Mon Sep 17 00:00:00 2001 +From: AndyCGYan +Date: Sun, 13 Jan 2019 21:44:48 +0800 +Subject: [PATCH] LineageParts: Invert per-app stretch-to-fullscreen + +Change-Id: Icb02c8dfd84882f736e37d6cd92c35e5eb288faa +--- + res/layout/long_screen_layout.xml | 2 +- + res/values-zh-rCN/strings.xml | 6 +++--- + res/values/strings.xml | 6 +++--- + res/xml/long_screen_prefs.xml | 2 +- + res/xml/parts_catalog.xml | 4 ++-- + .../lineageparts/applications/LongScreenSettings.java | 2 +- + 6 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/res/layout/long_screen_layout.xml b/res/layout/long_screen_layout.xml +index 40d0938..1119cef 100644 +--- a/res/layout/long_screen_layout.xml ++++ b/res/layout/long_screen_layout.xml +@@ -36,7 +36,7 @@ + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" +- android:text="@string/long_screen_settings_no_apps" ++ android:text="@string/inverse_long_screen_settings_no_apps" + android:textSize="18dp" + android:visibility="gone" /> + +diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml +index ee5f7f9..eeed571 100644 +--- a/res/values-zh-rCN/strings.xml ++++ b/res/values-zh-rCN/strings.xml +@@ -448,9 +448,9 @@ + 电量 %s 时自动启用省电 + 不要自动启用省电 + 永不 +- 全屏应用 +- 强制旧式应用程序使用全屏长宽比 +- 无应用 ++ 禁用拉伸全屏 ++ 对选定的应用禁用拉伸全屏 ++ 无应用 + 充电提示音 + 启用 + 连接或断开电源时发出声音 +diff --git a/res/values/strings.xml b/res/values/strings.xml +index 65d799a..ff23ae9 100644 +--- a/res/values/strings.xml ++++ b/res/values/strings.xml +@@ -579,9 +579,9 @@ + Never + + +- Full screen apps +- Force legacy apps to use full screen aspect ratio +- No apps ++ Disable stretch-to-fullscreen ++ Prevent selected apps from utilizing stretch-to-fullscreen ++ No apps + + + Charging sounds +diff --git a/res/xml/long_screen_prefs.xml b/res/xml/long_screen_prefs.xml +index ec947fa..20da90a 100644 +--- a/res/xml/long_screen_prefs.xml ++++ b/res/xml/long_screen_prefs.xml +@@ -18,6 +18,6 @@ + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:lineage="http://schemas.android.com/apk/res/org.lineageos.lineageparts" + android:key="long_screen_settings" +- android:title="@string/long_screen_settings_title"> ++ android:title="@string/inverse_long_screen_settings_title"> + + +diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml +index a4346c7..e21d7d5 100644 +--- a/res/xml/parts_catalog.xml ++++ b/res/xml/parts_catalog.xml +@@ -92,8 +92,8 @@ + lineage:xmlRes="@xml/perf_profile_settings" /> + + + +diff --git a/src/org/lineageos/lineageparts/applications/LongScreenSettings.java b/src/org/lineageos/lineageparts/applications/LongScreenSettings.java +index ac04058..50ff8f6 100644 +--- a/src/org/lineageos/lineageparts/applications/LongScreenSettings.java ++++ b/src/org/lineageos/lineageparts/applications/LongScreenSettings.java +@@ -246,7 +246,7 @@ public class LongScreenSettings extends SettingsPreferenceFragment + mApplicationsState.ensureIcon(entry); + holder.icon.setImageDrawable(entry.icon); + holder.state.setTag(entry); +- holder.state.setChecked(mLongScreen.shouldForceLongScreen(entry.info.packageName)); ++ holder.state.setChecked(!(mLongScreen.shouldForceLongScreen(entry.info.packageName))); + return holder.rootView; + } + +-- +2.17.1 + diff --git a/patches/0001-Remove-fsck-SELinux-labels.patch b/patches/0001-Remove-fsck-SELinux-labels.patch new file mode 100644 index 0000000..72d7935 --- /dev/null +++ b/patches/0001-Remove-fsck-SELinux-labels.patch @@ -0,0 +1,29 @@ +From 3fb27b3b3ab30a86432d2ca1f8fe5c3802793866 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Wed, 23 Oct 2019 09:38:16 +0000 +Subject: [PATCH] Remove fsck SELinux labels + +These are covered by LOS sepolicy + +Change-Id: I7c63c9aed39afc07b8c80918053154113f848cd9 +--- + sepolicy/file_contexts | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts +index 6da14ac..dfea075 100644 +--- a/sepolicy/file_contexts ++++ b/sepolicy/file_contexts +@@ -6,9 +6,6 @@ + /system/bin/phh-on-data.sh u:object_r:phhsu_exec:s0 + /system/bin/asus-motor u:object_r:phhsu_exec:s0 + +-#/system/bin/fsck\.exfat u:object_r:fsck_exec:s0 +-/system/bin/fsck\.ntfs u:object_r:fsck_exec:s0 +- + /bt_firmware(/.*)? u:object_r:bt_firmware_file:s0 + + /sec_storage(/.*)? u:object_r:teecd_data_file:s0 +-- +2.17.1 + diff --git a/patches/0001-Revert-init-Add-vendor-specific-initialization-hooks.patch b/patches/0001-Revert-init-Add-vendor-specific-initialization-hooks.patch new file mode 100644 index 0000000..aa023d5 --- /dev/null +++ b/patches/0001-Revert-init-Add-vendor-specific-initialization-hooks.patch @@ -0,0 +1,186 @@ +From 22d48d3925e8741ab115e7f20c2faf20c2fe21b5 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Sat, 19 Dec 2020 15:57:27 +0000 +Subject: [PATCH] Revert "init: Add vendor-specific initialization hooks." + +This reverts commit 7bc78d1354cd2e8df1ba693c627d5be39206e375. + +Change-Id: I0c3241ef3626bc989b34723e30b2339e4a62399d +--- + init/Android.bp | 9 --------- + init/NOTICE | 26 -------------------------- + init/property_service.cpp | 4 ---- + init/vendor_init.cpp | 37 ------------------------------------- + init/vendor_init.h | 33 --------------------------------- + 5 files changed, 109 deletions(-) + delete mode 100644 init/vendor_init.cpp + delete mode 100644 init/vendor_init.h + +diff --git a/init/Android.bp b/init/Android.bp +index e28d9f026..827a8293f 100644 +--- a/init/Android.bp ++++ b/init/Android.bp +@@ -71,14 +71,6 @@ init_host_sources = [ + "host_init_verifier.cpp", + ] + +-cc_library_static { +- name: "vendor_init", +- recovery_available: true, +- srcs: [ +- "vendor_init.cpp", +- ], +-} +- + cc_defaults { + name: "init_defaults", + cpp_std: "experimental", +@@ -169,7 +161,6 @@ cc_library_static { + defaults: [ + "init_defaults", + "selinux_policy_version", +- "vendor_init_defaults", + ], + srcs: init_common_sources + init_device_sources, + whole_static_libs: [ +diff --git a/init/NOTICE b/init/NOTICE +index 383d0f541..c5b1efa7a 100644 +--- a/init/NOTICE ++++ b/init/NOTICE +@@ -188,29 +188,3 @@ + + END OF TERMS AND CONDITIONS + +-Copyright (c) 2013, The Linux Foundation. All rights reserved. +- +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions are +-met: +- * Redistributions of source code must retain the above copyright +- notice, this list of conditions and the following disclaimer. +- * Redistributions in binary form must reproduce the above +- copyright notice, this list of conditions and the following +- disclaimer in the documentation and/or other materials provided +- with the distribution. +- * Neither the name of The Linux Foundation nor the names of its +- contributors may be used to endorse or promote products derived +- from this software without specific prior written permission. +- +-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +diff --git a/init/property_service.cpp b/init/property_service.cpp +index 2852f4fb4..a89504e59 100644 +--- a/init/property_service.cpp ++++ b/init/property_service.cpp +@@ -70,7 +70,6 @@ + #include "subcontext.h" + #include "system/core/init/property_service.pb.h" + #include "util.h" +-#include "vendor_init.h" + + using namespace std::literals; + +@@ -913,9 +912,6 @@ void PropertyLoadBootDefaults() { + } + } + +- // Update with vendor-specific property runtime overrides +- vendor_load_properties(); +- + property_initialize_ro_product_props(); + property_derive_build_fingerprint(); + +diff --git a/init/vendor_init.cpp b/init/vendor_init.cpp +deleted file mode 100644 +index d3fd5ffe2..000000000 +--- a/init/vendor_init.cpp ++++ /dev/null +@@ -1,37 +0,0 @@ +-/* +-Copyright (c) 2013, The Linux Foundation. All rights reserved. +- +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions are +-met: +- * Redistributions of source code must retain the above copyright +- notice, this list of conditions and the following disclaimer. +- * Redistributions in binary form must reproduce the above +- copyright notice, this list of conditions and the following +- disclaimer in the documentation and/or other materials provided +- with the distribution. +- * Neither the name of The Linux Foundation nor the names of its +- contributors may be used to endorse or promote products derived +- from this software without specific prior written permission. +- +-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- */ +- +-#include "vendor_init.h" +- +-/* init vendor override stubs */ +- +-__attribute__ ((weak)) +-void vendor_load_properties() +-{ +-} +diff --git a/init/vendor_init.h b/init/vendor_init.h +deleted file mode 100644 +index 9afb449be..000000000 +--- a/init/vendor_init.h ++++ /dev/null +@@ -1,33 +0,0 @@ +-/* +-Copyright (c) 2013, The Linux Foundation. All rights reserved. +- +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions are +-met: +- * Redistributions of source code must retain the above copyright +- notice, this list of conditions and the following disclaimer. +- * Redistributions in binary form must reproduce the above +- copyright notice, this list of conditions and the following +- disclaimer in the documentation and/or other materials provided +- with the distribution. +- * Neither the name of The Linux Foundation nor the names of its +- contributors may be used to endorse or promote products derived +- from this software without specific prior written permission. +- +-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- */ +- +-#ifndef __INIT_VENDOR__H__ +-#define __INIT_VENDOR__H__ +-extern void vendor_load_properties(void); +-#endif /* __INIT_VENDOR__H__ */ +-- +2.25.1 + diff --git a/patches/0001-Revert-sepolicy-Relabel-wifi.-properties-as-wifi_pro.patch b/patches/0001-Revert-sepolicy-Relabel-wifi.-properties-as-wifi_pro.patch new file mode 100644 index 0000000..408f40b --- /dev/null +++ b/patches/0001-Revert-sepolicy-Relabel-wifi.-properties-as-wifi_pro.patch @@ -0,0 +1,42 @@ +From 7f50c607a9e3bae747ff33566da624abc50024d3 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Mon, 5 Oct 2020 01:29:18 +0000 +Subject: [PATCH] Revert "sepolicy: Relabel wifi. properties as wifi_prop" + +This reverts commit bf52f194873840546c996c232eb44c8427ddcd5c. + +Change-Id: I0446540331684eb57f7e17bcc3273d6247915854 +--- + private/property_contexts | 1 - + private/system_server.te | 3 --- + 2 files changed, 4 deletions(-) + +diff --git a/private/property_contexts b/private/property_contexts +index 7908bb107..49cc8a2cd 100644 +--- a/private/property_contexts ++++ b/private/property_contexts +@@ -169,7 +169,6 @@ dalvik. u:object_r:dalvik_prop:s0 + ro.dalvik. u:object_r:dalvik_prop:s0 + + # Shared between system server and wificond +-wifi. u:object_r:wifi_prop:s0 + wlan. u:object_r:wifi_prop:s0 + + # Lowpan properties +diff --git a/private/system_server.te b/private/system_server.te +index 66c46ed97..2373e9617 100644 +--- a/private/system_server.te ++++ b/private/system_server.te +@@ -676,9 +676,6 @@ get_prop(system_server, mock_ota_prop) + # Read the property as feature flag for protecting apks with fs-verity. + get_prop(system_server, apk_verity_prop) + +-# Read wifi.interface +-get_prop(system_server, wifi_prop) +- + # Read the vendor property that indicates if Incremental features is enabled + get_prop(system_server, incremental_prop) + +-- +2.25.1 + diff --git a/patches/0001-Squashed-revert-of-LOS-FOD-implementation.patch b/patches/0001-Squashed-revert-of-LOS-FOD-implementation.patch new file mode 100644 index 0000000..35a2639 --- /dev/null +++ b/patches/0001-Squashed-revert-of-LOS-FOD-implementation.patch @@ -0,0 +1,1323 @@ +From 9badbe171d757a64ba76bdd247018e97d5e85066 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Sun, 13 Dec 2020 02:22:12 +0000 +Subject: [PATCH] Squashed revert of LOS FOD implementation + +Better than having an ever-growing string of revert commands? + +Change-Id: I4650cef96617c32e52d5dd088c8afffb06ab5e1d +--- + .../internal/statusbar/IStatusBar.aidl | 6 - + .../internal/statusbar/IStatusBarService.aidl | 6 - + packages/SystemUI/Android.bp | 2 - + .../res-keyguard/values/lineage_dimens.xml | 20 - + .../res/drawable-nodpi/fod_icon_pressed.png | Bin 108 -> 0 bytes + .../res/drawable/fod_icon_default.xml | 25 - + packages/SystemUI/res/values/config.xml | 1 - + .../SystemUI/res/values/lineage_config.xml | 4 - + .../keyguard/KeyguardSecurityContainer.java | 15 +- + .../systemui/biometrics/FODCircleView.java | 535 ------------------ + .../biometrics/FODCircleViewImpl.java | 73 --- + .../systemui/dagger/SystemUIBinder.java | 7 - + .../keyguard/KeyguardViewMediator.java | 10 +- + .../systemui/statusbar/CommandQueue.java | 28 - + .../phone/StatusBarKeyguardViewManager.java | 11 +- + services/core/Android.bp | 1 - + .../biometrics/BiometricServiceBase.java | 2 +- + .../fingerprint/FingerprintService.java | 112 ---- + .../statusbar/StatusBarManagerService.java | 22 - + 19 files changed, 5 insertions(+), 875 deletions(-) + delete mode 100644 packages/SystemUI/res-keyguard/values/lineage_dimens.xml + delete mode 100644 packages/SystemUI/res/drawable-nodpi/fod_icon_pressed.png + delete mode 100644 packages/SystemUI/res/drawable/fod_icon_default.xml + delete mode 100644 packages/SystemUI/src/com/android/systemui/biometrics/FODCircleView.java + delete mode 100644 packages/SystemUI/src/com/android/systemui/biometrics/FODCircleViewImpl.java + +diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl +index 44607f7f5fbd..83b672e06b01 100644 +--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl ++++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl +@@ -228,12 +228,6 @@ oneway interface IStatusBar + */ + void suppressAmbientDisplay(boolean suppress); + +- /** +- * Used to show or hide in display fingerprint view. +- */ +- void showInDisplayFingerprintView(); +- void hideInDisplayFingerprintView(); +- + /** + * Used to block or unblock usage of gestural navigation + */ +diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl +index e9b0683db89c..ca0eccdbc6e6 100644 +--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl ++++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl +@@ -148,12 +148,6 @@ interface IStatusBarService + */ + void suppressAmbientDisplay(boolean suppress); + +- /** +- * Used to show or hide in display fingerprint view. +- */ +- void showInDisplayFingerprintView(); +- void hideInDisplayFingerprintView(); +- + /** + * Starts the default assistant app. + */ +diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp +index c78630c05f08..84870f83ad2e 100644 +--- a/packages/SystemUI/Android.bp ++++ b/packages/SystemUI/Android.bp +@@ -71,7 +71,6 @@ android_library { + "dagger2-2.19", + "jsr330", + "org.lineageos.platform.internal", +- "vendor.lineage.biometrics.fingerprint.inscreen-V1.0-java", + "vendor.lineage.powershare-V1.0-java", + ], + manifest: "AndroidManifest.xml", +@@ -146,7 +145,6 @@ android_library { + "dagger2-2.19", + "jsr330", + "org.lineageos.platform.internal", +- "vendor.lineage.biometrics.fingerprint.inscreen-V1.0-java", + "vendor.lineage.powershare-V1.0-java", + ], + libs: [ +diff --git a/packages/SystemUI/res-keyguard/values/lineage_dimens.xml b/packages/SystemUI/res-keyguard/values/lineage_dimens.xml +deleted file mode 100644 +index bb6070c7199d..000000000000 +--- a/packages/SystemUI/res-keyguard/values/lineage_dimens.xml ++++ /dev/null +@@ -1,20 +0,0 @@ +- +- +- +- +- 0dp +- +diff --git a/packages/SystemUI/res/drawable-nodpi/fod_icon_pressed.png b/packages/SystemUI/res/drawable-nodpi/fod_icon_pressed.png +deleted file mode 100644 +index 4102e28c1300b49323b50625d8cfaa73b006561f..0000000000000000000000000000000000000000 +GIT binary patch +literal 0 +HcmV?d00001 + +literal 108 +zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}bl$r9IylHmNblJdl&R0hYC{G?O` +z&)mfH)S%SFl*+=BsWw1Ge4Z|jAr-fh5*U~o7?>FtSQ!{^cTTbP0l+XkK +D@OB!I + +diff --git a/packages/SystemUI/res/drawable/fod_icon_default.xml b/packages/SystemUI/res/drawable/fod_icon_default.xml +deleted file mode 100644 +index 38e9d3111286..000000000000 +--- a/packages/SystemUI/res/drawable/fod_icon_default.xml ++++ /dev/null +@@ -1,25 +0,0 @@ +- +- +- +- +- +diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml +index 74906e259fa9..49b7eab8a696 100644 +--- a/packages/SystemUI/res/values/config.xml ++++ b/packages/SystemUI/res/values/config.xml +@@ -319,7 +319,6 @@ + com.android.systemui.globalactions.GlobalActionsComponent + com.android.systemui.ScreenDecorations + com.android.systemui.biometrics.AuthController +- com.android.systemui.biometrics.FODCircleViewImpl + com.android.systemui.SliceBroadcastRelayHandler + com.android.systemui.SizeCompatModeActivityController + com.android.systemui.statusbar.notification.InstantAppNotifier +diff --git a/packages/SystemUI/res/values/lineage_config.xml b/packages/SystemUI/res/values/lineage_config.xml +index 2bb268216e33..2aca126a8feb 100644 +--- a/packages/SystemUI/res/values/lineage_config.xml ++++ b/packages/SystemUI/res/values/lineage_config.xml +@@ -14,10 +14,6 @@ + limitations under the License. + --> + +- +- #00ff00 +- #20000000 +- + + 4 + 5 +diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +index bace9324ac93..1db2e32b8cdb 100644 +--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java ++++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +@@ -33,7 +33,6 @@ import android.app.AlertDialog; + import android.app.admin.DevicePolicyManager; + import android.content.Context; + import android.content.Intent; +-import android.content.pm.PackageManager; + import android.content.res.ColorStateList; + import android.graphics.Insets; + import android.graphics.Rect; +@@ -80,8 +79,6 @@ import com.android.systemui.shared.system.SysUiStatsLog; + import com.android.systemui.statusbar.policy.KeyguardStateController; + import com.android.systemui.util.InjectionInflationController; + +-import lineageos.app.LineageContextConstants; +- + import java.util.List; + + public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSecurityView { +@@ -127,7 +124,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe + private InjectionInflationController mInjectionInflationController; + private boolean mSwipeUpToRetry; + private AdminSecondaryLockScreenController mSecondaryLockScreenController; +- private boolean mHasFod; + + private final ViewConfiguration mViewConfiguration; + private final SpringAnimation mSpringAnimation; +@@ -265,10 +261,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe + mKeyguardStateController = Dependency.get(KeyguardStateController.class); + mSecondaryLockScreenController = new AdminSecondaryLockScreenController(context, this, + mUpdateMonitor, mCallback, new Handler(Looper.myLooper())); +- +- PackageManager packageManager = mContext.getPackageManager(); +- mHasFod = packageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT) && +- packageManager.hasSystemFeature(LineageContextConstants.Features.FOD); + } + + public void setSecurityCallback(SecurityCallback callback) { +@@ -525,10 +517,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe + + // Consume bottom insets because we're setting the padding locally (for IME and navbar.) + int inset; +- int minBottomMargin = mHasFod && mUpdateMonitor.isFingerprintDetectionRunning() ? +- getResources().getDimensionPixelSize( +- R.dimen.kg_security_container_min_bottom_margin) : 0; +- + if (sNewInsetsMode == NEW_INSETS_MODE_FULL) { + int bottomInset = insets.getInsetsIgnoringVisibility(systemBars()).bottom; + int imeInset = insets.getInsets(ime()).bottom; +@@ -536,8 +524,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe + } else { + inset = insets.getSystemWindowInsetBottom(); + } +- setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), +- minBottomMargin > inset ? minBottomMargin : inset); ++ setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), inset); + return insets.inset(0, 0, 0, inset); + } + +diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FODCircleView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FODCircleView.java +deleted file mode 100644 +index 4012e6112afe..000000000000 +--- a/packages/SystemUI/src/com/android/systemui/biometrics/FODCircleView.java ++++ /dev/null +@@ -1,535 +0,0 @@ +-/** +- * Copyright (C) 2019-2020 The LineageOS Project +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-package com.android.systemui.biometrics; +- +-import android.app.admin.DevicePolicyManager; +-import android.content.Context; +-import android.content.res.Configuration; +-import android.content.res.Resources; +-import android.graphics.Canvas; +-import android.graphics.Color; +-import android.graphics.Paint; +-import android.graphics.PixelFormat; +-import android.graphics.Point; +-import android.hardware.biometrics.BiometricSourceType; +-import android.os.Handler; +-import android.os.Looper; +-import android.os.RemoteException; +-import android.provider.Settings; +-import android.view.Display; +-import android.view.Gravity; +-import android.view.MotionEvent; +-import android.view.Surface; +-import android.view.View; +-import android.view.WindowManager; +-import android.widget.ImageView; +- +-import com.android.internal.widget.LockPatternUtils; +-import com.android.keyguard.KeyguardSecurityModel.SecurityMode; +-import com.android.keyguard.KeyguardUpdateMonitor; +-import com.android.keyguard.KeyguardUpdateMonitorCallback; +-import com.android.systemui.Dependency; +-import com.android.systemui.R; +- +-import vendor.lineage.biometrics.fingerprint.inscreen.V1_0.IFingerprintInscreen; +-import vendor.lineage.biometrics.fingerprint.inscreen.V1_0.IFingerprintInscreenCallback; +- +-import java.util.NoSuchElementException; +-import java.util.Timer; +-import java.util.TimerTask; +- +-public class FODCircleView extends ImageView { +- private static final int FADE_ANIM_DURATION = 250; +- +- private final int mPositionX; +- private final int mPositionY; +- private final int mSize; +- private final int mDreamingMaxOffset; +- private final int mNavigationBarSize; +- private final boolean mShouldBoostBrightness; +- private final Paint mPaintFingerprintBackground = new Paint(); +- private final Paint mPaintFingerprint = new Paint(); +- private final WindowManager.LayoutParams mParams = new WindowManager.LayoutParams(); +- private final WindowManager.LayoutParams mPressedParams = new WindowManager.LayoutParams(); +- private final WindowManager mWindowManager; +- +- private IFingerprintInscreen mFingerprintInscreenDaemon; +- +- private int mDreamingOffsetX; +- private int mDreamingOffsetY; +- +- private boolean mFading; +- private boolean mIsBouncer; +- private boolean mIsBiometricRunning; +- private boolean mIsCircleShowing; +- private boolean mIsDreaming; +- private boolean mIsKeyguard; +- +- private Handler mHandler; +- +- private final ImageView mPressedView; +- +- private LockPatternUtils mLockPatternUtils; +- +- private Timer mBurnInProtectionTimer; +- +- private IFingerprintInscreenCallback mFingerprintInscreenCallback = +- new IFingerprintInscreenCallback.Stub() { +- @Override +- public void onFingerDown() { +- mHandler.post(() -> showCircle()); +- } +- +- @Override +- public void onFingerUp() { +- mHandler.post(() -> hideCircle()); +- } +- }; +- +- private KeyguardUpdateMonitor mUpdateMonitor; +- +- private KeyguardUpdateMonitorCallback mMonitorCallback = new KeyguardUpdateMonitorCallback() { +- @Override +- public void onBiometricAuthenticated(int userId, BiometricSourceType biometricSourceType, +- boolean isStrongBiometric) { +- // We assume that if biometricSourceType matches Fingerprint it will be +- // handled here, so we hide only when other biometric types authenticate +- if (biometricSourceType != BiometricSourceType.FINGERPRINT) { +- hide(); +- } +- } +- +- @Override +- public void onBiometricRunningStateChanged(boolean running, +- BiometricSourceType biometricSourceType) { +- if (biometricSourceType == BiometricSourceType.FINGERPRINT) { +- mIsBiometricRunning = running; +- } +- } +- +- @Override +- public void onDreamingStateChanged(boolean dreaming) { +- mIsDreaming = dreaming; +- updateAlpha(); +- +- if (mIsKeyguard && mUpdateMonitor.isFingerprintDetectionRunning()) { +- show(); +- updateAlpha(); +- } else { +- hide(); +- } +- +- if (dreaming) { +- mBurnInProtectionTimer = new Timer(); +- mBurnInProtectionTimer.schedule(new BurnInProtectionTask(), 0, 60 * 1000); +- } else if (mBurnInProtectionTimer != null) { +- mBurnInProtectionTimer.cancel(); +- } +- } +- +- @Override +- public void onKeyguardVisibilityChanged(boolean showing) { +- mIsKeyguard = showing; +- if (!showing) { +- hide(); +- } else { +- updateAlpha(); +- } +- } +- +- @Override +- public void onKeyguardBouncerChanged(boolean isBouncer) { +- mIsBouncer = isBouncer; +- if (mUpdateMonitor.isFingerprintDetectionRunning()) { +- if (isPinOrPattern(mUpdateMonitor.getCurrentUser()) || !isBouncer) { +- show(); +- } else { +- hide(); +- } +- } else { +- hide(); +- } +- } +- +- @Override +- public void onStartedGoingToSleep(int why) { +- hide(); +- } +- +- @Override +- public void onStartedWakingUp() { +- if (mUpdateMonitor.isFingerprintDetectionRunning()) { +- show(); +- } +- } +- +- @Override +- public void onScreenTurnedOn() { +- if (mUpdateMonitor.isFingerprintDetectionRunning()) { +- show(); +- } +- } +- }; +- +- public FODCircleView(Context context) { +- super(context); +- +- setScaleType(ScaleType.CENTER); +- +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- if (daemon == null) { +- throw new RuntimeException("Unable to get IFingerprintInscreen"); +- } +- +- try { +- mShouldBoostBrightness = daemon.shouldBoostBrightness(); +- mPositionX = daemon.getPositionX(); +- mPositionY = daemon.getPositionY(); +- mSize = daemon.getSize(); +- } catch (RemoteException e) { +- throw new RuntimeException("Failed to retrieve FOD circle position or size"); +- } +- +- Resources res = context.getResources(); +- +- mPaintFingerprint.setColor(res.getColor(R.color.config_fodColor)); +- mPaintFingerprint.setAntiAlias(true); +- +- mPaintFingerprintBackground.setColor(res.getColor(R.color.config_fodColorBackground)); +- mPaintFingerprintBackground.setAntiAlias(true); +- +- mWindowManager = context.getSystemService(WindowManager.class); +- +- mNavigationBarSize = res.getDimensionPixelSize(R.dimen.navigation_bar_size); +- +- mDreamingMaxOffset = (int) (mSize * 0.1f); +- +- mHandler = new Handler(Looper.getMainLooper()); +- +- mParams.height = mSize; +- mParams.width = mSize; +- mParams.format = PixelFormat.TRANSLUCENT; +- +- mParams.packageName = "android"; +- mParams.type = WindowManager.LayoutParams.TYPE_DISPLAY_OVERLAY; +- mParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | +- WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; +- mParams.gravity = Gravity.TOP | Gravity.LEFT; +- +- mPressedParams.copyFrom(mParams); +- mPressedParams.flags |= WindowManager.LayoutParams.FLAG_DIM_BEHIND; +- +- mParams.setTitle("Fingerprint on display"); +- mPressedParams.setTitle("Fingerprint on display.touched"); +- +- mPressedView = new ImageView(context) { +- @Override +- protected void onDraw(Canvas canvas) { +- if (mIsCircleShowing) { +- canvas.drawCircle(mSize / 2, mSize / 2, mSize / 2.0f, mPaintFingerprint); +- } +- super.onDraw(canvas); +- } +- }; +- mPressedView.setImageResource(R.drawable.fod_icon_pressed); +- +- mWindowManager.addView(this, mParams); +- +- updatePosition(); +- hide(); +- +- mLockPatternUtils = new LockPatternUtils(mContext); +- +- mUpdateMonitor = Dependency.get(KeyguardUpdateMonitor.class); +- mUpdateMonitor.registerCallback(mMonitorCallback); +- } +- +- @Override +- protected void onDraw(Canvas canvas) { +- if (!mIsCircleShowing) { +- canvas.drawCircle(mSize / 2, mSize / 2, mSize / 2.0f, mPaintFingerprintBackground); +- } +- super.onDraw(canvas); +- } +- +- @Override +- public boolean onTouchEvent(MotionEvent event) { +- float x = event.getAxisValue(MotionEvent.AXIS_X); +- float y = event.getAxisValue(MotionEvent.AXIS_Y); +- +- boolean newIsInside = (x > 0 && x < mSize) && (y > 0 && y < mSize); +- +- if (event.getAction() == MotionEvent.ACTION_DOWN && newIsInside) { +- showCircle(); +- return true; +- } else if (event.getAction() == MotionEvent.ACTION_UP) { +- hideCircle(); +- return true; +- } else if (event.getAction() == MotionEvent.ACTION_MOVE) { +- return true; +- } +- +- return false; +- } +- +- @Override +- public void onConfigurationChanged(Configuration newConfig) { +- updatePosition(); +- } +- +- public IFingerprintInscreen getFingerprintInScreenDaemon() { +- if (mFingerprintInscreenDaemon == null) { +- try { +- mFingerprintInscreenDaemon = IFingerprintInscreen.getService(); +- if (mFingerprintInscreenDaemon != null) { +- mFingerprintInscreenDaemon.setCallback(mFingerprintInscreenCallback); +- mFingerprintInscreenDaemon.asBinder().linkToDeath((cookie) -> { +- mFingerprintInscreenDaemon = null; +- }, 0); +- } +- } catch (NoSuchElementException | RemoteException e) { +- // do nothing +- } +- } +- return mFingerprintInscreenDaemon; +- } +- +- public void dispatchPress() { +- if (mFading) return; +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- try { +- daemon.onPress(); +- } catch (RemoteException e) { +- // do nothing +- } +- } +- +- public void dispatchRelease() { +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- try { +- daemon.onRelease(); +- } catch (RemoteException e) { +- // do nothing +- } +- } +- +- public void dispatchShow() { +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- try { +- daemon.onShowFODView(); +- } catch (RemoteException e) { +- // do nothing +- } +- } +- +- public void dispatchHide() { +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- try { +- daemon.onHideFODView(); +- } catch (RemoteException e) { +- // do nothing +- } +- } +- +- public void showCircle() { +- if (mFading) return; +- mIsCircleShowing = true; +- +- setKeepScreenOn(true); +- +- setDim(true); +- dispatchPress(); +- +- setImageDrawable(null); +- invalidate(); +- } +- +- public void hideCircle() { +- mIsCircleShowing = false; +- +- setImageResource(R.drawable.fod_icon_default); +- invalidate(); +- +- dispatchRelease(); +- setDim(false); +- +- setKeepScreenOn(false); +- } +- +- public void show() { +- if (!mUpdateMonitor.isScreenOn()) { +- // Keyguard is shown just after screen turning off +- return; +- } +- +- if (mIsBouncer && !isPinOrPattern(mUpdateMonitor.getCurrentUser())) { +- // Ignore show calls when Keyguard password screen is being shown +- return; +- } +- +- if (mIsKeyguard && mUpdateMonitor.getUserCanSkipBouncer(mUpdateMonitor.getCurrentUser())) { +- // Ignore show calls if user can skip bouncer +- return; +- } +- +- if (mIsKeyguard && !mIsBiometricRunning) { +- return; +- } +- +- updatePosition(); +- +- setVisibility(View.VISIBLE); +- animate().withStartAction(() -> mFading = true) +- .alpha(mIsDreaming ? 0.5f : 1.0f) +- .setDuration(FADE_ANIM_DURATION) +- .withEndAction(() -> mFading = false) +- .start(); +- dispatchShow(); +- } +- +- public void hide() { +- animate().withStartAction(() -> mFading = true) +- .alpha(0) +- .setDuration(FADE_ANIM_DURATION) +- .withEndAction(() -> { +- setVisibility(View.GONE); +- mFading = false; +- }) +- .start(); +- hideCircle(); +- dispatchHide(); +- } +- +- private void updateAlpha() { +- setAlpha(mIsDreaming ? 0.5f : 1.0f); +- } +- +- private void updatePosition() { +- Display defaultDisplay = mWindowManager.getDefaultDisplay(); +- +- Point size = new Point(); +- defaultDisplay.getRealSize(size); +- +- int rotation = defaultDisplay.getRotation(); +- int x, y; +- switch (rotation) { +- case Surface.ROTATION_0: +- x = mPositionX; +- y = mPositionY; +- break; +- case Surface.ROTATION_90: +- x = mPositionY; +- y = mPositionX; +- break; +- case Surface.ROTATION_180: +- x = mPositionX; +- y = size.y - mPositionY - mSize; +- break; +- case Surface.ROTATION_270: +- x = size.x - mPositionY - mSize - mNavigationBarSize; +- y = mPositionX; +- break; +- default: +- throw new IllegalArgumentException("Unknown rotation: " + rotation); +- } +- +- mPressedParams.x = mParams.x = x; +- mPressedParams.y = mParams.y = y; +- +- if (mIsDreaming) { +- mParams.x += mDreamingOffsetX; +- mParams.y += mDreamingOffsetY; +- } +- +- mWindowManager.updateViewLayout(this, mParams); +- +- if (mPressedView.getParent() != null) { +- mWindowManager.updateViewLayout(mPressedView, mPressedParams); +- } +- } +- +- private void setDim(boolean dim) { +- if (dim) { +- int curBrightness = Settings.System.getInt(getContext().getContentResolver(), +- Settings.System.SCREEN_BRIGHTNESS, 100); +- int dimAmount = 0; +- +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- try { +- dimAmount = daemon.getDimAmount(curBrightness); +- } catch (RemoteException e) { +- // do nothing +- } +- +- if (mShouldBoostBrightness) { +- mPressedParams.screenBrightness = 1.0f; +- } +- +- mPressedParams.dimAmount = dimAmount / 255.0f; +- if (mPressedView.getParent() == null) { +- mWindowManager.addView(mPressedView, mPressedParams); +- } else { +- mWindowManager.updateViewLayout(mPressedView, mPressedParams); +- } +- } else { +- if (mShouldBoostBrightness) { +- mPressedParams.screenBrightness = 0.0f; +- } +- mPressedParams.dimAmount = 0.0f; +- if (mPressedView.getParent() != null) { +- mWindowManager.removeView(mPressedView); +- } +- } +- } +- +- private boolean isPinOrPattern(int userId) { +- int passwordQuality = mLockPatternUtils.getActivePasswordQuality(userId); +- switch (passwordQuality) { +- // PIN +- case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: +- case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX: +- // Pattern +- case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: +- return true; +- } +- +- return false; +- } +- +- private class BurnInProtectionTask extends TimerTask { +- @Override +- public void run() { +- long now = System.currentTimeMillis() / 1000 / 60; +- +- mDreamingOffsetX = (int) (now % (mDreamingMaxOffset * 4)); +- if (mDreamingOffsetX > mDreamingMaxOffset * 2) { +- mDreamingOffsetX = mDreamingMaxOffset * 4 - mDreamingOffsetX; +- } +- +- // Let y to be not synchronized with x, so that we get maximum movement +- mDreamingOffsetY = (int) ((now + mDreamingMaxOffset / 3) % (mDreamingMaxOffset * 2)); +- if (mDreamingOffsetY > mDreamingMaxOffset * 2) { +- mDreamingOffsetY = mDreamingMaxOffset * 4 - mDreamingOffsetY; +- } +- +- mDreamingOffsetX -= mDreamingMaxOffset; +- mDreamingOffsetY -= mDreamingMaxOffset; +- +- mHandler.post(() -> updatePosition()); +- } +- }; +-} +diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FODCircleViewImpl.java b/packages/SystemUI/src/com/android/systemui/biometrics/FODCircleViewImpl.java +deleted file mode 100644 +index ca4fd6b99a02..000000000000 +--- a/packages/SystemUI/src/com/android/systemui/biometrics/FODCircleViewImpl.java ++++ /dev/null +@@ -1,73 +0,0 @@ +-/** +- * Copyright (C) 2019 The Android Open Source Project +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-package com.android.systemui.biometrics; +- +-import android.content.Context; +-import android.content.pm.PackageManager; +-import android.util.Slog; +-import android.view.View; +- +-import com.android.systemui.SystemUI; +-import com.android.systemui.statusbar.CommandQueue; +- +-import lineageos.app.LineageContextConstants; +- +-import javax.inject.Inject; +-import javax.inject.Singleton; +- +-@Singleton +-public class FODCircleViewImpl extends SystemUI implements CommandQueue.Callbacks { +- private static final String TAG = "FODCircleViewImpl"; +- +- private FODCircleView mFodCircleView; +- private final CommandQueue mCommandQueue; +- +- @Inject +- public FODCircleViewImpl(Context context, CommandQueue commandQueue) { +- super(context); +- mCommandQueue = commandQueue; +- } +- +- @Override +- public void start() { +- PackageManager packageManager = mContext.getPackageManager(); +- if (!packageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT) || +- !packageManager.hasSystemFeature(LineageContextConstants.Features.FOD)) { +- return; +- } +- mCommandQueue.addCallback(this); +- try { +- mFodCircleView = new FODCircleView(mContext); +- } catch (RuntimeException e) { +- Slog.e(TAG, "Failed to initialize FODCircleView", e); +- } +- } +- +- @Override +- public void showInDisplayFingerprintView() { +- if (mFodCircleView != null) { +- mFodCircleView.show(); +- } +- } +- +- @Override +- public void hideInDisplayFingerprintView() { +- if (mFodCircleView != null) { +- mFodCircleView.hide(); +- } +- } +-} +diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java +index a0a2e6f0dd6f..413a522bccdc 100644 +--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java ++++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java +@@ -24,7 +24,6 @@ import com.android.systemui.SystemUI; + import com.android.systemui.accessibility.SystemActions; + import com.android.systemui.accessibility.WindowMagnification; + import com.android.systemui.biometrics.AuthController; +-import com.android.systemui.biometrics.FODCircleViewImpl; + import com.android.systemui.bubbles.dagger.BubbleModule; + import com.android.systemui.globalactions.GlobalActionsComponent; + import com.android.systemui.keyguard.KeyguardViewMediator; +@@ -67,12 +66,6 @@ public abstract class SystemUIBinder { + @ClassKey(Divider.class) + public abstract SystemUI bindDivider(Divider sysui); + +- /** Inject into FODCircleViewImpl. */ +- @Binds +- @IntoMap +- @ClassKey(FODCircleViewImpl.class) +- public abstract SystemUI FODCircleViewImpl(FODCircleViewImpl sysui); +- + /** Inject into GarbageMonitor.Service. */ + @Binds + @IntoMap +diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +index 941bd3fdf274..6394dc9a17d8 100644 +--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java ++++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +@@ -38,7 +38,6 @@ import android.content.ContentResolver; + import android.content.Context; + import android.content.Intent; + import android.content.IntentFilter; +-import android.content.pm.PackageManager; + import android.content.pm.UserInfo; + import android.hardware.biometrics.BiometricSourceType; + import android.media.AudioAttributes; +@@ -102,7 +101,6 @@ import com.android.systemui.statusbar.phone.StatusBar; + import com.android.systemui.util.DeviceConfigProxy; + import com.android.systemui.util.InjectionInflationController; + +-import lineageos.app.LineageContextConstants; + import lineageos.app.Profile; + import lineageos.app.ProfileManager; + +@@ -387,8 +385,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { + private IKeyguardDrawnCallback mDrawnCallback; + private CharSequence mCustomMessage; + +- private boolean mHasFod; +- + private final DeviceConfig.OnPropertiesChangedListener mOnPropertiesChangedListener = + new DeviceConfig.OnPropertiesChangedListener() { + @Override +@@ -757,8 +753,6 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { + QuickStepContract.isGesturalMode(navigationModeController.addListener(mode -> { + mInGestureNavigationMode = QuickStepContract.isGesturalMode(mode); + })); +- PackageManager packageManager = context.getPackageManager(); +- mHasFod = packageManager.hasSystemFeature(LineageContextConstants.Features.FOD); + } + + public void userActivity() { +@@ -891,9 +885,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { + // explicitly DO NOT want to call + // mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(false) + // here, since that will mess with the device lock state. +- if (!mHasFod) { +- mUpdateMonitor.dispatchKeyguardGoingAway(false); +- } ++ mUpdateMonitor.dispatchKeyguardGoingAway(false); + + // Lock immediately based on setting if secure (user has a pin/pattern/password). + // This also "locks" the device when not secure to provide easy access to the +diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +index 5f3875701e48..39b6aa1a3609 100644 +--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java ++++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +@@ -126,8 +126,6 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< + private static final int MSG_HIDE_TOAST = 54 << MSG_SHIFT; + private static final int MSG_TRACING_STATE_CHANGED = 55 << MSG_SHIFT; + private static final int MSG_SUPPRESS_AMBIENT_DISPLAY = 56 << MSG_SHIFT; +- private static final int MSG_SHOW_IN_DISPLAY_FINGERPRINT_VIEW = 57 << MSG_SHIFT; +- private static final int MSG_HIDE_IN_DISPLAY_FINGERPRINT_VIEW = 58 << MSG_SHIFT; + private static final int MSG_SET_BLOCKED_GESTURAL_NAVIGATION = 59 << MSG_SHIFT; + + public static final int FLAG_EXCLUDE_NONE = 0; +@@ -271,8 +269,6 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< + default void onBiometricHelp(String message) { } + default void onBiometricError(int modality, int error, int vendorCode) { } + default void hideAuthenticationDialog() { } +- default void showInDisplayFingerprintView() { } +- default void hideInDisplayFingerprintView() { } + default void setBlockedGesturalNavigation(boolean blocked) {} + + /** +@@ -862,20 +858,6 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< + } + } + +- @Override +- public void showInDisplayFingerprintView() { +- synchronized (mLock) { +- mHandler.obtainMessage(MSG_SHOW_IN_DISPLAY_FINGERPRINT_VIEW).sendToTarget(); +- } +- } +- +- @Override +- public void hideInDisplayFingerprintView() { +- synchronized (mLock) { +- mHandler.obtainMessage(MSG_HIDE_IN_DISPLAY_FINGERPRINT_VIEW).sendToTarget(); +- } +- } +- + @Override + public void setBlockedGesturalNavigation(boolean blocked) { + synchronized (mLock) { +@@ -1335,16 +1317,6 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController< + callbacks.suppressAmbientDisplay((boolean) msg.obj); + } + break; +- case MSG_SHOW_IN_DISPLAY_FINGERPRINT_VIEW: +- for (int i = 0; i < mCallbacks.size(); i++) { +- mCallbacks.get(i).showInDisplayFingerprintView(); +- } +- break; +- case MSG_HIDE_IN_DISPLAY_FINGERPRINT_VIEW: +- for (int i = 0; i < mCallbacks.size(); i++) { +- mCallbacks.get(i).hideInDisplayFingerprintView(); +- } +- break; + case MSG_SET_BLOCKED_GESTURAL_NAVIGATION: + for (int i = 0; i < mCallbacks.size(); i++) { + mCallbacks.get(i).setBlockedGesturalNavigation((Boolean) msg.obj); +diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +index ca9e61320fd1..2097cbcf9fc8 100644 +--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java ++++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +@@ -116,7 +116,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb + + @Override + public void onStartingToShow() { +- updateStates(); + updateLockIcon(); + } + +@@ -164,7 +163,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb + protected boolean mLastShowing; + protected boolean mLastOccluded; + private boolean mLastBouncerShowing; +- private boolean mLastBouncerInTransit; + private boolean mLastBouncerDismissible; + protected boolean mLastRemoteInputActive; + private boolean mLastDozing; +@@ -811,7 +809,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb + boolean showing = mShowing; + boolean occluded = mOccluded; + boolean bouncerShowing = mBouncer.isShowing(); +- boolean bouncerInTransit = mBouncer.inTransit(); + boolean bouncerDismissible = !mBouncer.isFullscreenBouncer(); + boolean remoteInputActive = mRemoteInputActive; + +@@ -840,11 +837,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb + if ((showing && !occluded) != (mLastShowing && !mLastOccluded) || mFirstUpdate) { + mKeyguardUpdateManager.onKeyguardVisibilityChanged(showing && !occluded); + } +- +- boolean bouncerVisible = bouncerShowing || bouncerInTransit; +- boolean lastBouncerVisible = mLastBouncerShowing || mLastBouncerInTransit; +- if (bouncerVisible != lastBouncerVisible || mFirstUpdate) { +- mKeyguardUpdateManager.sendKeyguardBouncerChanged(bouncerVisible); ++ if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) { ++ mKeyguardUpdateManager.sendKeyguardBouncerChanged(bouncerShowing); + } + + mFirstUpdate = false; +@@ -852,7 +846,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb + mLastGlobalActionsVisible = mGlobalActionsVisible; + mLastOccluded = occluded; + mLastBouncerShowing = bouncerShowing; +- mLastBouncerInTransit = bouncerInTransit; + mLastBouncerDismissible = bouncerDismissible; + mLastRemoteInputActive = remoteInputActive; + mLastDozing = mDozing; +diff --git a/services/core/Android.bp b/services/core/Android.bp +index 2510f6783819..30eea474c0e5 100644 +--- a/services/core/Android.bp ++++ b/services/core/Android.bp +@@ -133,7 +133,6 @@ java_library_static { + "org.lineageos.platform.internal", + "overlayable_policy_aidl-java", + "SurfaceFlingerProperties", +- "vendor.lineage.biometrics.fingerprint.inscreen-V1.0-java", + ], + } + +diff --git a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java +index 5bb4d272eae8..70369732fead 100644 +--- a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java ++++ b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java +@@ -1047,7 +1047,7 @@ public abstract class BiometricServiceBase extends SystemService + /** + * @return true if this is keyguard package + */ +- protected boolean isKeyguard(String clientPackage) { ++ private boolean isKeyguard(String clientPackage) { + return mKeyguardPackage.equals(clientPackage); + } + +diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java +index 5b51aa6e72ac..a90fee6788a8 100644 +--- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java ++++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java +@@ -80,17 +80,12 @@ import org.json.JSONArray; + import org.json.JSONException; + import org.json.JSONObject; + +-import lineageos.app.LineageContextConstants; +- +-import vendor.lineage.biometrics.fingerprint.inscreen.V1_0.IFingerprintInscreen; +- + import java.io.File; + import java.io.FileDescriptor; + import java.io.PrintWriter; + import java.util.ArrayList; + import java.util.Collections; + import java.util.List; +-import java.util.NoSuchElementException; + import java.util.concurrent.CopyOnWriteArrayList; + + /** +@@ -112,9 +107,6 @@ public class FingerprintService extends BiometricServiceBase { + private static final long FAIL_LOCKOUT_TIMEOUT_MS = 30 * 1000; + private static final String KEY_LOCKOUT_RESET_USER = "lockout_reset_user"; + +- private final boolean mHasFod; +- private boolean mIsKeyguard; +- + private final class ResetFailedAttemptsForUserRunnable implements Runnable { + @Override + public void run() { +@@ -649,7 +641,6 @@ public class FingerprintService extends BiometricServiceBase { + + @GuardedBy("this") + private IBiometricsFingerprint mDaemon; +- private IFingerprintInscreen mFingerprintInscreenDaemon; + private final SparseBooleanArray mTimedLockoutCleared; + private final SparseIntArray mFailedAttempts; + private final AlarmManager mAlarmManager; +@@ -671,21 +662,6 @@ public class FingerprintService extends BiometricServiceBase { + new Fingerprint(getBiometricUtils().getUniqueName(getContext(), groupId), + groupId, fingerId, deviceId); + FingerprintService.super.handleEnrollResult(fingerprint, remaining); +- if (remaining == 0 && mHasFod) { +- IFingerprintInscreen fodDaemon = getFingerprintInScreenDaemon(); +- if (fodDaemon != null) { +- try { +- fodDaemon.onFinishEnroll(); +- } catch (RemoteException e) { +- Slog.e(TAG, "onFinishEnroll failed", e); +- } +- } +- try { +- mStatusBarService.hideInDisplayFingerprintView(); +- } catch (RemoteException e) { +- Slog.e(TAG, "hideInDisplayFingerprintView failed", e); +- } +- } + }); + } + +@@ -697,16 +673,6 @@ public class FingerprintService extends BiometricServiceBase { + @Override + public void onAcquired_2_2(long deviceId, int acquiredInfo, int vendorCode) { + mHandler.post(() -> { +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- if (daemon != null) { +- try { +- if (daemon.handleAcquired(acquiredInfo, vendorCode)) { +- return; +- } +- } catch (RemoteException e) { +- Slog.e(TAG, "handleError failed", e); +- } +- } + FingerprintService.super.handleAcquired(deviceId, acquiredInfo, vendorCode); + }); + } +@@ -726,29 +692,12 @@ public class FingerprintService extends BiometricServiceBase { + + final Fingerprint fp = new Fingerprint("", groupId, fingerId, deviceId); + FingerprintService.super.handleAuthenticated(authenticated, fp, token); +- if (mHasFod && fp.getBiometricId() != 0) { +- try { +- mStatusBarService.hideInDisplayFingerprintView(); +- } catch (RemoteException e) { +- Slog.e(TAG, "hideInDisplayFingerprintView failed", e); +- } +- } + }); + } + + @Override + public void onError(final long deviceId, final int error, final int vendorCode) { + mHandler.post(() -> { +- IFingerprintInscreen daemon = getFingerprintInScreenDaemon(); +- if (daemon != null) { +- try { +- if (daemon.handleError(error, vendorCode)) { +- return; +- } +- } catch (RemoteException e) { +- Slog.e(TAG, "handleError failed", e); +- } +- } + FingerprintService.super.handleError(deviceId, error, vendorCode); + // TODO: this chunk of code should be common to all biometric services + if (error == BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE) { +@@ -796,21 +745,6 @@ public class FingerprintService extends BiometricServiceBase { + Slog.w(TAG, "authenticate(): no fingerprint HAL!"); + return ERROR_ESRCH; + } +- if (mHasFod) { +- IFingerprintInscreen fodDaemon = getFingerprintInScreenDaemon(); +- if (fodDaemon != null) { +- try { +- fodDaemon.setLongPressEnabled(mIsKeyguard); +- } catch (RemoteException e) { +- Slog.e(TAG, "setLongPressEnabled failed", e); +- } +- } +- try { +- mStatusBarService.showInDisplayFingerprintView(); +- } catch (RemoteException e) { +- Slog.e(TAG, "showInDisplayFingerprintView failed", e); +- } +- } + return daemon.authenticate(operationId, groupId); + } + +@@ -821,13 +755,6 @@ public class FingerprintService extends BiometricServiceBase { + Slog.w(TAG, "cancel(): no fingerprint HAL!"); + return ERROR_ESRCH; + } +- if (mHasFod) { +- try { +- mStatusBarService.hideInDisplayFingerprintView(); +- } catch (RemoteException e) { +- Slog.e(TAG, "hideInDisplayFingerprintView failed", e); +- } +- } + return daemon.cancel(); + } + +@@ -859,21 +786,6 @@ public class FingerprintService extends BiometricServiceBase { + Slog.w(TAG, "enroll(): no fingerprint HAL!"); + return ERROR_ESRCH; + } +- if (mHasFod) { +- IFingerprintInscreen fodDaemon = getFingerprintInScreenDaemon(); +- if (fodDaemon != null) { +- try { +- fodDaemon.onStartEnroll(); +- } catch (RemoteException e) { +- Slog.e(TAG, "onStartEnroll failed", e); +- } +- } +- try { +- mStatusBarService.showInDisplayFingerprintView(); +- } catch (RemoteException e) { +- Slog.e(TAG, "showInDisplayFingerprintView failed", e); +- } +- } + return daemon.enroll(cryptoToken, groupId, timeout); + } + +@@ -893,9 +805,6 @@ public class FingerprintService extends BiometricServiceBase { + context.registerReceiver(mLockoutReceiver, new IntentFilter(getLockoutResetIntent()), + getLockoutBroadcastPermission(), null /* handler */); + mLockPatternUtils = new LockPatternUtils(context); +- +- PackageManager packageManager = context.getPackageManager(); +- mHasFod = packageManager.hasSystemFeature(LineageContextConstants.Features.FOD); + } + + @Override +@@ -980,7 +889,6 @@ public class FingerprintService extends BiometricServiceBase { + + daemon.setActiveGroup(userId, fpDir.getAbsolutePath()); + mCurrentUserId = userId; +- mIsKeyguard = isKeyguard(clientPackage); + } + mAuthenticatorIds.put(userId, + hasEnrolledBiometrics(userId) ? daemon.getAuthenticatorId() : 0L); +@@ -1118,26 +1026,6 @@ public class FingerprintService extends BiometricServiceBase { + return mDaemon; + } + +- private synchronized IFingerprintInscreen getFingerprintInScreenDaemon() { +- if (!mHasFod) { +- return null; +- } +- +- if (mFingerprintInscreenDaemon == null) { +- try { +- mFingerprintInscreenDaemon = IFingerprintInscreen.getService(); +- if (mFingerprintInscreenDaemon != null) { +- mFingerprintInscreenDaemon.asBinder().linkToDeath((cookie) -> { +- mFingerprintInscreenDaemon = null; +- }, 0); +- } +- } catch (NoSuchElementException | RemoteException e) { +- Slog.e(TAG, "Failed to get IFingerprintInscreen interface", e); +- } +- } +- return mFingerprintInscreenDaemon; +- } +- + private long startPreEnroll(IBinder token) { + IBiometricsFingerprint daemon = getFingerprintDaemon(); + if (daemon == null) { +diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java +index 2412209452ba..13b9508a9c8a 100644 +--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java ++++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java +@@ -747,28 +747,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D + return mTracingEnabled; + } + +- @Override +- public void showInDisplayFingerprintView() { +- if (mBar != null) { +- try { +- mBar.showInDisplayFingerprintView(); +- } catch (RemoteException ex) { +- // do nothing +- } +- } +- } +- +- @Override +- public void hideInDisplayFingerprintView() { +- if (mBar != null) { +- try { +- mBar.hideInDisplayFingerprintView(); +- } catch (RemoteException ex) { +- // do nothing +- } +- } +- } +- + @Override + public void setBlockedGesturalNavigation(boolean blocked) { + if (mBar != null) { +-- +2.25.1 + diff --git a/patches/0001-UI-Revive-navbar-layout-tuning-via-sysui_nav_bar-tun.patch b/patches/0001-UI-Revive-navbar-layout-tuning-via-sysui_nav_bar-tun.patch new file mode 100644 index 0000000..d3da7d2 --- /dev/null +++ b/patches/0001-UI-Revive-navbar-layout-tuning-via-sysui_nav_bar-tun.patch @@ -0,0 +1,63 @@ +From dc5694dd4956db2dbfbbea6bb2d34acb6f2a7851 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Tue, 6 Oct 2020 01:41:16 +0000 +Subject: [PATCH] UI: Revive navbar layout tuning via sysui_nav_bar tunable + +Google keeps fixing what ain't broken. +This partially undoes https://github.com/LineageOS/android_frameworks_base/commit/e0d5ccd331e694afdc3c8462a1b845df329de2b8 and https://github.com/LineageOS/android_frameworks_base/commit/d34b4e8d278386b85a00018c502bd21d00f8813b + +Change-Id: Ied7d7859e50fd0fcc346219964e747c5d5f4c352 +--- + .../statusbar/phone/NavigationBarInflaterView.java | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java +index 726a70582537..536263c83ddd 100644 +--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java ++++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java +@@ -108,6 +108,7 @@ public class NavigationBarInflaterView extends FrameLayout + + private boolean mIsVertical; + private boolean mAlternativeOrder; ++ private boolean mUsingCustomLayout; + + private OverviewProxyService mOverviewProxyService; + private int mNavBarMode = NAV_BAR_MODE_3BUTTON; +@@ -173,6 +174,7 @@ public class NavigationBarInflaterView extends FrameLayout + super.onAttachedToWindow(); + Dependency.get(TunerService.class).addTunable(this, NAV_BAR_INVERSE); + Dependency.get(TunerService.class).addTunable(this, KEY_NAVIGATION_HINT); ++ Dependency.get(TunerService.class).addTunable(this, NAV_BAR_VIEWS); + } + + @Override +@@ -191,6 +193,8 @@ public class NavigationBarInflaterView extends FrameLayout + mIsHintEnabled = TunerService.parseIntegerSwitch(newValue, true); + updateHint(); + onLikelyDefaultLayoutChange(); ++ } else if (NAV_BAR_VIEWS.equals(key)) { ++ setNavigationBarLayout(newValue); + } + } + +@@ -200,7 +204,17 @@ public class NavigationBarInflaterView extends FrameLayout + updateLayoutInversion(); + } + ++ public void setNavigationBarLayout(String layoutValue) { ++ if (!Objects.equals(mCurrentLayout, layoutValue)) { ++ mUsingCustomLayout = layoutValue != null; ++ clearViews(); ++ inflateLayout(layoutValue); ++ } ++ } ++ + public void onLikelyDefaultLayoutChange() { ++ // Don't override custom layouts ++ if (mUsingCustomLayout) return; + + // Reevaluate new layout + final String newValue = getDefaultLayout(); +-- +2.25.1 + diff --git a/patches/0001-build-Don-t-handle-apns-conf.patch b/patches/0001-build-Don-t-handle-apns-conf.patch new file mode 100644 index 0000000..e0c485c --- /dev/null +++ b/patches/0001-build-Don-t-handle-apns-conf.patch @@ -0,0 +1,62 @@ +From 861c67194b96a8eac90f5d871f6d1b350791f05a Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Mon, 5 Oct 2020 01:51:46 +0000 +Subject: [PATCH] build: Don't handle apns-conf + +Leave it to vendor/lineage instead + +Change-Id: I51fb1436ee0ee2e33b20ca0810b69e827f3f34dc +--- + target/product/aosp_product.mk | 7 ------- + target/product/full_base_telephony.mk | 5 ----- + target/product/mainline.mk | 4 ---- + 3 files changed, 16 deletions(-) + +diff --git a/target/product/aosp_product.mk b/target/product/aosp_product.mk +index 4cdb28b30..dd38847f1 100644 +--- a/target/product/aosp_product.mk ++++ b/target/product/aosp_product.mk +@@ -39,13 +39,6 @@ PRODUCT_PACKAGES += \ + preinstalled-packages-platform-aosp-product.xml \ + WallpaperPicker \ + +-# Telephony: +-# Provide a APN configuration to GSI product +-ifeq ($(LINEAGE_BUILD),) +-PRODUCT_COPY_FILES += \ +- device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml +-endif +- + # NFC: + # Provide a libnfc-nci.conf to GSI product + PRODUCT_COPY_FILES += \ +diff --git a/target/product/full_base_telephony.mk b/target/product/full_base_telephony.mk +index e3442147a..0aa9e7700 100644 +--- a/target/product/full_base_telephony.mk ++++ b/target/product/full_base_telephony.mk +@@ -30,10 +30,5 @@ endif + PRODUCT_COPY_FILES := \ + frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml + +-ifeq ($(LINEAGE_BUILD),) +-PRODUCT_COPY_FILES += \ +- device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml +-endif +- + $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) + $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk) +diff --git a/target/product/mainline.mk b/target/product/mainline.mk +index 418b1eedd..9754cc8e2 100644 +--- a/target/product/mainline.mk ++++ b/target/product/mainline.mk +@@ -40,7 +40,3 @@ endif + PRODUCT_PACKAGES += \ + PhotoTable \ + WallpaperPicker \ +- +-ifeq ($(LINEAGE_BUILD),) +-PRODUCT_COPY_FILES += device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml +-endif +-- +2.25.1 + diff --git a/patches/0001-build_soong-Disable-generated_kernel_headers.patch b/patches/0001-build_soong-Disable-generated_kernel_headers.patch new file mode 100644 index 0000000..b0fd3bf --- /dev/null +++ b/patches/0001-build_soong-Disable-generated_kernel_headers.patch @@ -0,0 +1,45 @@ +From f0b8b09faba7f40bfe376a7c6d3a0f81e7d587c4 Mon Sep 17 00:00:00 2001 +From: AndyCGYan +Date: Sun, 3 Mar 2019 14:07:33 +0800 +Subject: [PATCH] build_soong: Disable generated_kernel_headers + +...but done in a way so that there's no need to remove generated_kernel_headers from individual projects - thanks @ExpressLuke + +Change-Id: I630857cec208f1830e776bf5031d7bb9bc4435d0 +--- + build/soong/Android.bp | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/build/soong/Android.bp b/build/soong/Android.bp +index 5076e684..2279bf44 100644 +--- a/build/soong/Android.bp ++++ b/build/soong/Android.bp +@@ -20,9 +20,6 @@ bootstrap_go_package { + lineage_generator { + name: "generated_kernel_includes", + +- // The headers make command +- cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(KERNEL_BUILD_OUT_PREFIX)$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install", +- + // Directories that can be imported by a cc_* module generated_headers property + export_include_dirs: [ + "usr/audio/include/uapi", +@@ -30,15 +27,6 @@ lineage_generator { + "usr/include/audio/include/uapi", + "usr/techpack/audio/include", + ], +- +- // Sources for dependency tracking +- dep_root: "$(TARGET_KERNEL_SOURCE)", +- dep_files: [ +- "Makefile", +- "include/**/*", +- "arch/$(KERNEL_ARCH)/include/**/*", +- "techpack/audio/include/**/*", +- ], + } + + cc_library_headers { +-- +2.25.1 + diff --git a/patches/0001-sdk-Invert-per-app-stretch-to-fullscreen.patch b/patches/0001-sdk-Invert-per-app-stretch-to-fullscreen.patch new file mode 100644 index 0000000..d9229cc --- /dev/null +++ b/patches/0001-sdk-Invert-per-app-stretch-to-fullscreen.patch @@ -0,0 +1,26 @@ +From 95ef97f5aa82c15e47f9313eca4899d89dba5dd0 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Wed, 4 Jul 2018 17:59:14 +0800 +Subject: [PATCH] sdk: Invert per-app stretch-to-fullscreen implementation + +Change-Id: Idf7dab4e1e0c79953fa672f33ec65fecffb37c83 +--- + sdk/src/java/org/lineageos/internal/applications/LongScreen.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sdk/src/java/org/lineageos/internal/applications/LongScreen.java b/sdk/src/java/org/lineageos/internal/applications/LongScreen.java +index 7fe0d68..26ea349 100644 +--- a/sdk/src/java/org/lineageos/internal/applications/LongScreen.java ++++ b/sdk/src/java/org/lineageos/internal/applications/LongScreen.java +@@ -57,7 +57,7 @@ public class LongScreen { + } + + public boolean shouldForceLongScreen(String packageName) { +- return isSupported() && mApps.contains(packageName); ++ return isSupported() && !(mApps.contains(packageName)); + } + + public Set getApps() { +-- +2.7.4 + diff --git a/patches/0001-treble-Add-overlay-lineage.patch b/patches/0001-treble-Add-overlay-lineage.patch new file mode 100644 index 0000000..f8e3c35 --- /dev/null +++ b/patches/0001-treble-Add-overlay-lineage.patch @@ -0,0 +1,135 @@ +From e562ff56e4b4196d223b006a7d96b72ebc75dece Mon Sep 17 00:00:00 2001 +From: AndyCGYan +Date: Mon, 15 Jul 2019 10:43:52 +0000 +Subject: [PATCH] treble: Add overlay-lineage + +Change-Id: I9d313b1488d98acc7cf37d23820946ee99745426 +--- + base.mk | 12 ++- + .../lineage/res/res/values/config.xml | 81 +++++++++++++++++++ + 2 files changed, 90 insertions(+), 3 deletions(-) + create mode 100644 overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml + +diff --git a/base.mk b/base.mk +index 3623d42..17944f7 100644 +--- a/base.mk ++++ b/base.mk +@@ -12,7 +12,13 @@ PRODUCT_COPY_FILES += \ + device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml + + BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy +-PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay ++ ++PRODUCT_PACKAGE_OVERLAYS += \ ++ device/phh/treble/overlay \ ++ device/phh/treble/overlay-lineage ++ ++PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS += \ ++ device/phh/treble/overlay-lineage/lineage-sdk + + $(call inherit-product, vendor/hardware_overlay/overlay.mk) + $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +@@ -29,11 +35,11 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + ro.build.version.security_patch=$(PLATFORM_SECURITY_PATCH) \ + ro.adb.secure=0 \ + ro.logd.auditd=true +- ++ + #Huawei HiSuite (also other OEM custom programs I guess) it's of no use in AOSP builds + PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + persist.sys.usb.config=adb \ +- ro.cust.cdrom=/dev/null ++ ro.cust.cdrom=/dev/null + + #VNDK config files + PRODUCT_COPY_FILES += \ +diff --git a/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml b/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml +new file mode 100644 +index 0000000..8df673a +--- /dev/null ++++ b/overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml +@@ -0,0 +1,81 @@ ++ ++ ++ ++ ++ true ++ ++ ++ 255 ++ ++ ++ 127 ++ ++ ++ 127 ++ +-- +2.25.1 + diff --git a/patches/0001-treble-Don-t-specify-config_wallpaperCropperPackage.patch b/patches/0001-treble-Don-t-specify-config_wallpaperCropperPackage.patch new file mode 100644 index 0000000..b774d4e --- /dev/null +++ b/patches/0001-treble-Don-t-specify-config_wallpaperCropperPackage.patch @@ -0,0 +1,25 @@ +From 4d6f28cb695c5edf253f03c373485a21cd43d19c Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Tue, 10 Sep 2019 02:42:36 +0000 +Subject: [PATCH] treble: Don't specify config_wallpaperCropperPackage + +Change-Id: I72b59def304779e4bd9a399c01cf1180d15bf444 +--- + overlay/frameworks/base/core/res/res/values/config.xml | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml +index 28c7a28..48ca260 100644 +--- a/overlay/frameworks/base/core/res/res/values/config.xml ++++ b/overlay/frameworks/base/core/res/res/values/config.xml +@@ -22,7 +22,6 @@ + "M50 0C77.6 0 100 22.4 100 50C100 77.6 77.6 100 50 100C22.4 100 0 77.6 0 50C0 22.4 22.4 0 50 0Z" + true + +- com.android.wallpaperpicker + true + 5 + true +-- +2.17.1 + diff --git a/patches/0001-vendor_lineage-Log-privapp-permissions-whitelist-vio.patch b/patches/0001-vendor_lineage-Log-privapp-permissions-whitelist-vio.patch new file mode 100644 index 0000000..423e36e --- /dev/null +++ b/patches/0001-vendor_lineage-Log-privapp-permissions-whitelist-vio.patch @@ -0,0 +1,30 @@ +From 7a633a53d8e20e2d976597a332bf5ba855ec1f75 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Thu, 5 Sep 2019 02:08:22 +0000 +Subject: [PATCH] vendor_lineage: Log privapp-permissions whitelist violations + instead + +Change-Id: I49dba61f332253e291a65e79ca70d9a07d45bb07 +--- + config/common.mk | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/config/common.mk b/config/common.mk +index 2fe9cb01..7d971bba 100644 +--- a/config/common.mk ++++ b/config/common.mk +@@ -70,9 +70,9 @@ PRODUCT_COPY_FILES += \ + PRODUCT_COPY_FILES += \ + vendor/lineage/config/permissions/org.lineageos.android.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/org.lineageos.android.xml + +-# Enforce privapp-permissions whitelist ++# Log privapp-permissions whitelist violations + PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ +- ro.control_privapp_permissions=enforce ++ ro.control_privapp_permissions=log + + # Include AOSP audio files + include vendor/lineage/config/aosp_audio.mk +-- +2.17.1 +