commit 01693449b8a020a64582147f65e89bd5473c5aff Author: Andy CrossGate Yan Date: Sun Aug 8 02:20:00 2021 +0000 Initial unified commit for Android 11, syncing up to v311 diff --git a/patches_device/frameworks_base/0001-fwb-Start-device-specific-popup-camera-service-condi.patch b/patches_device/frameworks_base/0001-fwb-Start-device-specific-popup-camera-service-condi.patch new file mode 100644 index 0000000..5befe1c --- /dev/null +++ b/patches_device/frameworks_base/0001-fwb-Start-device-specific-popup-camera-service-condi.patch @@ -0,0 +1,133 @@ +From f63609cfc0fcc6a488ba7d024a1b1e3853637b09 Mon Sep 17 00:00:00 2001 +From: jhenrique09 +Date: Sun, 29 Mar 2020 17:38:39 -0300 +Subject: [PATCH] fwb: Start device specific popup camera service conditionally + +Change-Id: I07f97fe58495ef666fa317d14fa1334389015e11 +--- + .../custom/popupcamera/PopUpCameraUtils.java | 20 +++++++++++++++++++ + core/res/res/values/lineage_config.xml | 3 +++ + core/res/res/values/lineage_symbols.xml | 3 +++ + .../server/camera/CameraServiceProxy.java | 20 +++++++++++++++++++ + 4 files changed, 46 insertions(+) + create mode 100644 core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java + +diff --git a/core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java b/core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java +new file mode 100644 +index 00000000000..f7988608141 +--- /dev/null ++++ b/core/java/com/android/internal/util/custom/popupcamera/PopUpCameraUtils.java +@@ -0,0 +1,20 @@ ++/* ++* Copyright (C) 2019 The Pixel Experience 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.internal.util.custom.popupcamera; ++ ++public class PopUpCameraUtils { ++ public static String MANAGE_POPUP_CAMERA_SERVICE_PERMISSION = "org.pixelexperience.device.MANAGE_POPUP_CAMERA_SERVICE"; ++} +diff --git a/core/res/res/values/lineage_config.xml b/core/res/res/values/lineage_config.xml +index 4b090379f5a..3315de74147 100644 +--- a/core/res/res/values/lineage_config.xml ++++ b/core/res/res/values/lineage_config.xml +@@ -34,4 +34,7 @@ + + + ++ ++ ++ + +diff --git a/core/res/res/values/lineage_symbols.xml b/core/res/res/values/lineage_symbols.xml +index 155da4479fb..c7e58b3943f 100644 +--- a/core/res/res/values/lineage_symbols.xml ++++ b/core/res/res/values/lineage_symbols.xml +@@ -25,4 +25,7 @@ + + + ++ ++ ++ + +diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java +index 5f7a72c8512..9e72fa09993 100644 +--- a/services/core/java/com/android/server/camera/CameraServiceProxy.java ++++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java +@@ -16,6 +16,7 @@ + package com.android.server.camera; + + import android.content.BroadcastReceiver; ++import android.content.ComponentName; + import android.content.Context; + import android.content.Intent; + import android.content.IntentFilter; +@@ -32,6 +33,7 @@ import android.os.Process; + import android.os.RemoteException; + import android.os.SystemClock; + import android.os.SystemProperties; ++import android.os.UserHandle; + import android.os.UserManager; + import android.util.ArrayMap; + import android.util.ArraySet; +@@ -53,6 +55,8 @@ import java.util.Set; + import java.util.concurrent.ScheduledThreadPoolExecutor; + import java.util.concurrent.TimeUnit; + ++import com.android.internal.util.custom.popupcamera.PopUpCameraUtils; ++ + /** + * CameraServiceProxy is the system_server analog to the camera service running in cameraserver. + * +@@ -106,6 +110,8 @@ public class CameraServiceProxy extends SystemService + private final boolean mNotifyNfc; + private final boolean mAllowMediaUid; + ++ private final String mPopUpCameraServiceComponentName; ++ + private ScheduledThreadPoolExecutor mLogWriterService = new ScheduledThreadPoolExecutor( + /*corePoolSize*/ 1); + +@@ -218,6 +224,8 @@ public class CameraServiceProxy extends SystemService + // Don't keep any extra logging threads if not needed + mLogWriterService.setKeepAliveTime(1, TimeUnit.SECONDS); + mLogWriterService.allowCoreThreadTimeOut(true); ++ mPopUpCameraServiceComponentName = mContext.getResources().getString( ++ com.android.internal.R.string.config_popUpCameraServiceComponentName); + } + + @Override +@@ -338,6 +346,18 @@ public class CameraServiceProxy extends SystemService + } + } + ++ @Override ++ public void onBootPhase(int phase) { ++ if (phase == PHASE_BOOT_COMPLETED && ++ !mPopUpCameraServiceComponentName.equals("")) { ++ String perm = PopUpCameraUtils.MANAGE_POPUP_CAMERA_SERVICE_PERMISSION; ++ mContext.enforceCallingOrSelfPermission(perm, "Missing or invalid popup camera service permission: " + perm); ++ Intent i = new Intent(); ++ i.setComponent(ComponentName.unflattenFromString(mPopUpCameraServiceComponentName)); ++ mContext.startServiceAsUser(i, UserHandle.SYSTEM); ++ } ++ } ++ + /** + * Dump camera usage events to log. + * Package-private +-- +2.25.1 + diff --git a/patches_device/vendor_lineage/0001-build-Add-support-of-generating-kernel-includes-for-.patch b/patches_device/vendor_lineage/0001-build-Add-support-of-generating-kernel-includes-for-.patch new file mode 100644 index 0000000..598406e --- /dev/null +++ b/patches_device/vendor_lineage/0001-build-Add-support-of-generating-kernel-includes-for-.patch @@ -0,0 +1,69 @@ +From 9b7fb863d5b8ed266574f5bbd73dd896f8534f89 Mon Sep 17 00:00:00 2001 +From: XiNGRZ +Date: Thu, 13 Feb 2020 20:19:22 +0800 +Subject: [PATCH] build: Add support of generating kernel includes for prebuilt + kernels + +For prebuilt kernels, point TARGET_KERNEL_HEADER_SOURCE to the dummy +kernel source used to generate headers for HALs. + +Change-Id: I8dbbe3760230ae32f4252e99d1c777a029046d39 +--- + build/soong/Android.bp | 4 ++-- + config/BoardConfigKernel.mk | 4 ++++ + config/BoardConfigSoong.mk | 2 +- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/build/soong/Android.bp b/build/soong/Android.bp +index ee68c11e..03006e44 100644 +--- a/build/soong/Android.bp ++++ b/build/soong/Android.bp +@@ -21,7 +21,7 @@ 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", ++ cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_HEADER_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: [ +@@ -32,7 +32,7 @@ lineage_generator { + ], + + // Sources for dependency tracking +- dep_root: "$(TARGET_KERNEL_SOURCE)", ++ dep_root: "$(TARGET_KERNEL_HEADER_SOURCE)", + dep_files: [ + "Makefile", + "include/**/*", +diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk +index 8479369a..508927fd 100644 +--- a/config/BoardConfigKernel.mk ++++ b/config/BoardConfigKernel.mk +@@ -52,6 +52,10 @@ else + KERNEL_ARCH := $(TARGET_KERNEL_ARCH) + endif + ++ifneq ($(TARGET_KERNEL_SOURCE),) ++TARGET_KERNEL_HEADER_SOURCE := $(TARGET_KERNEL_SOURCE) ++endif ++ + CLANG_PREBUILTS := $(BUILD_TOP)/prebuilts/clang/host/$(HOST_PREBUILT_TAG)/clang-r383902b + GCC_PREBUILTS := $(BUILD_TOP)/prebuilts/gcc/$(HOST_PREBUILT_TAG) + # arm64 toolchain +diff --git a/config/BoardConfigSoong.mk b/config/BoardConfigSoong.mk +index c0b01674..aacc8c56 100644 +--- a/config/BoardConfigSoong.mk ++++ b/config/BoardConfigSoong.mk +@@ -9,7 +9,7 @@ EXPORT_TO_SOONG := \ + KERNEL_MAKE_FLAGS \ + PATH_OVERRIDE_SOONG \ + TARGET_KERNEL_CONFIG \ +- TARGET_KERNEL_SOURCE ++ TARGET_KERNEL_HEADER_SOURCE + + # Setup SOONG_CONFIG_* vars to export the vars listed above. + # Documentation here: +-- +2.25.1 + diff --git a/patches_device_personal/frameworks_base/placeholder b/patches_device_personal/frameworks_base/placeholder new file mode 100644 index 0000000..e69de29 diff --git a/patches_platform/build_make/0001-Make-broken-copy-headers-the-default.patch b/patches_platform/build_make/0001-Make-broken-copy-headers-the-default.patch new file mode 100644 index 0000000..172b153 --- /dev/null +++ b/patches_platform/build_make/0001-Make-broken-copy-headers-the-default.patch @@ -0,0 +1,28 @@ +From 381142e1299600d7b16c77c57207732dd06536fc Mon Sep 17 00:00:00 2001 +From: Alexander Koskovich +Date: Sat, 3 Oct 2020 14:28:35 -0700 +Subject: [PATCH] Make broken copy headers the default. + + * Do not take this for S unless needed, this is a hack + for this cycle. + +Change-Id: I55c8897d7d4d5c2a9e62b1a931b3856b2e38956e +--- + core/board_config.mk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/core/board_config.mk b/core/board_config.mk +index 86162b6f3..d152bdff6 100644 +--- a/core/board_config.mk ++++ b/core/board_config.mk +@@ -113,6 +113,7 @@ endif + # ############################################################### + $(foreach v,$(_build_broken_var_list),$(eval $(v) :=)) + BUILD_BROKEN_NINJA_USES_ENV_VARS := ++BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true + + # Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE) + # or under vendor/*/$(TARGET_DEVICE). Search in both places, but +-- +2.25.1 + diff --git a/patches_platform/frameworks_base/0001-UI-Revive-navbar-layout-tuning-via-sysui_nav_bar-tun.patch b/patches_platform/frameworks_base/0001-UI-Revive-navbar-layout-tuning-via-sysui_nav_bar-tun.patch new file mode 100644 index 0000000..6ce989f --- /dev/null +++ b/patches_platform/frameworks_base/0001-UI-Revive-navbar-layout-tuning-via-sysui_nav_bar-tun.patch @@ -0,0 +1,63 @@ +From 0353d82691df67c3497cc0df021d8a0850b6cfec Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Tue, 6 Oct 2020 01:41:16 +0000 +Subject: [PATCH 1/3] 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 047cb702c55..e4b3395f57a 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_platform/frameworks_base/0002-UI-Disable-wallpaper-zoom.patch b/patches_platform/frameworks_base/0002-UI-Disable-wallpaper-zoom.patch new file mode 100644 index 0000000..341e7cb --- /dev/null +++ b/patches_platform/frameworks_base/0002-UI-Disable-wallpaper-zoom.patch @@ -0,0 +1,28 @@ +From 6fdadb36add6aa2f8c6c3d25c4ff8135278a9919 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Sun, 10 Jan 2021 11:44:29 +0000 +Subject: [PATCH 2/3] UI: Disable wallpaper zoom + +It does little more than inducing motion sickness + +Change-Id: I78cc5484930b27f172cd8d8a5bd9042dce3478d0 +--- + core/res/res/values/config.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml +index 51b461e7949..f761d28e68d 100644 +--- a/core/res/res/values/config.xml ++++ b/core/res/res/values/config.xml +@@ -4384,7 +4384,7 @@ + + + +- 1.10 ++ 1 + + +-- +2.25.1 + diff --git a/patches_platform/frameworks_base/0003-Disable-vendor-mismatch-warning.patch b/patches_platform/frameworks_base/0003-Disable-vendor-mismatch-warning.patch new file mode 100644 index 0000000..01a5d45 --- /dev/null +++ b/patches_platform/frameworks_base/0003-Disable-vendor-mismatch-warning.patch @@ -0,0 +1,40 @@ +From 2fba4148047720a307d88013f20dbb87e389a751 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Thu, 5 Apr 2018 10:01:19 +0800 +Subject: [PATCH 3/3] 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 ec178a4b543..f1d9cd968bc 100644 +--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java ++++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +@@ -6494,20 +6494,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.25.1 + diff --git a/patches_platform/lineage-sdk/0001-sdk-Invert-per-app-stretch-to-fullscreen.patch b/patches_platform/lineage-sdk/0001-sdk-Invert-per-app-stretch-to-fullscreen.patch new file mode 100644 index 0000000..d9229cc --- /dev/null +++ b/patches_platform/lineage-sdk/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_platform/packages_apps_Jelly/0001-Jelly-MainActivity-Restore-applyThemeColor.patch b/patches_platform/packages_apps_Jelly/0001-Jelly-MainActivity-Restore-applyThemeColor.patch new file mode 100644 index 0000000..0e64b7d --- /dev/null +++ b/patches_platform/packages_apps_Jelly/0001-Jelly-MainActivity-Restore-applyThemeColor.patch @@ -0,0 +1,34 @@ +From 6f9026e0548bd82e7b728ef29dd7d14db93b2105 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Sat, 26 Jun 2021 14:23:09 +0000 +Subject: [PATCH] Jelly: MainActivity: Restore applyThemeColor + +Fixes black statusbar on start + +Change-Id: I6816f5b1dcb3c7bcaee2736a9e2a3ecd63217bc6 +--- + app/src/main/java/org/lineageos/jelly/MainActivity.kt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/app/src/main/java/org/lineageos/jelly/MainActivity.kt b/app/src/main/java/org/lineageos/jelly/MainActivity.kt +index 2902b0a..9ff74ed 100644 +--- a/app/src/main/java/org/lineageos/jelly/MainActivity.kt ++++ b/app/src/main/java/org/lineageos/jelly/MainActivity.kt +@@ -193,6 +193,7 @@ class MainActivity : WebViewExtActivity(), SearchBarController.OnCancelListener, + findViewById(R.id.search_menu_cancel), + this) + setUiMode() ++ applyThemeColor(mThemeColor) + try { + val httpCacheDir = File(cacheDir, "suggestion_responses") + val httpCacheSize = 1024 * 1024.toLong() // 1 MiB +@@ -763,4 +764,4 @@ class MainActivity : WebViewExtActivity(), SearchBarController.OnCancelListener, + private const val STORAGE_PERM_REQ = 423 + private const val LOCATION_PERM_REQ = 424 + } +-} +\ No newline at end of file ++} +-- +2.25.1 + diff --git a/patches_platform/packages_apps_LineageParts/0001-LineageParts-Invert-per-app-stretch-to-fullscreen.patch b/patches_platform/packages_apps_LineageParts/0001-LineageParts-Invert-per-app-stretch-to-fullscreen.patch new file mode 100644 index 0000000..f03bfb1 --- /dev/null +++ b/patches_platform/packages_apps_LineageParts/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_platform/packages_apps_Trebuchet/0001-Trebuchet-Move-clear-all-button-to-actions-view.patch b/patches_platform/packages_apps_Trebuchet/0001-Trebuchet-Move-clear-all-button-to-actions-view.patch new file mode 100644 index 0000000..a71ee3d --- /dev/null +++ b/patches_platform/packages_apps_Trebuchet/0001-Trebuchet-Move-clear-all-button-to-actions-view.patch @@ -0,0 +1,448 @@ +From 69e5c49e18b9f33cebde3d54c69477ef2c18a756 Mon Sep 17 00:00:00 2001 +From: Vachounet +Date: Tue, 24 Nov 2020 05:49:46 +0000 +Subject: [PATCH] Trebuchet: Move clear all button to actions view + +Change-Id: I9d13247501ca8e1610c17adc204ad64dd4a04cec +--- + .../RecentsViewStateController.java | 3 - + .../FallbackRecentsStateController.java | 3 - + .../quickstep/views/ClearAllButton.java | 112 ------------------ + .../android/quickstep/views/RecentsView.java | 52 ++------ + .../res/drawable/ic_clear_all_recents.xml | 21 ++++ + .../res/layout/overview_actions_container.xml | 17 ++- + .../res/layout/overview_clear_all_button.xml | 27 ----- + 7 files changed, 44 insertions(+), 191 deletions(-) + delete mode 100644 quickstep/recents_ui_overrides/src/com/android/quickstep/views/ClearAllButton.java + create mode 100644 quickstep/res/drawable/ic_clear_all_recents.xml + delete mode 100644 quickstep/res/layout/overview_clear_all_button.xml + +diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +index 5ccc1e868..bc47c5a00 100644 +--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java ++++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +@@ -35,7 +35,6 @@ import com.android.launcher3.anim.PendingAnimation; + import com.android.launcher3.anim.PropertySetter; + import com.android.launcher3.states.StateAnimationConfig; + import com.android.launcher3.util.MultiValueAlpha; +-import com.android.quickstep.views.ClearAllButton; + import com.android.quickstep.views.LauncherRecentsView; + import com.android.quickstep.views.RecentsView; + +@@ -84,8 +83,6 @@ public final class RecentsViewStateController extends + private void setAlphas(PropertySetter propertySetter, StateAnimationConfig config, + LauncherState state) { + float buttonAlpha = (state.getVisibleElements(mLauncher) & OVERVIEW_BUTTONS) != 0 ? 1 : 0; +- propertySetter.setFloat(mRecentsView.getClearAllButton(), ClearAllButton.VISIBILITY_ALPHA, +- buttonAlpha, LINEAR); + propertySetter.setFloat(mLauncher.getActionsView().getVisibilityAlpha(), + MultiValueAlpha.VALUE, buttonAlpha, config.getInterpolator( + ANIM_OVERVIEW_ACTIONS_FADE, LINEAR)); +diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +index 24a761066..7af77ef60 100644 +--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java ++++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +@@ -35,7 +35,6 @@ import com.android.launcher3.statemanager.StateManager.StateHandler; + import com.android.launcher3.states.StateAnimationConfig; + import com.android.launcher3.util.MultiValueAlpha; + import com.android.quickstep.RecentsActivity; +-import com.android.quickstep.views.ClearAllButton; + + /** + * State controller for fallback recents activity +@@ -78,8 +77,6 @@ public class FallbackRecentsStateController implements StateHandler VISIBILITY_ALPHA = +- new FloatProperty("visibilityAlpha") { +- @Override +- public Float get(ClearAllButton view) { +- return view.mVisibilityAlpha; +- } +- +- @Override +- public void setValue(ClearAllButton view, float v) { +- view.setVisibilityAlpha(v); +- } +- }; +- +- private float mScrollAlpha = 1; +- private float mContentAlpha = 1; +- private float mVisibilityAlpha = 1; +- +- private boolean mIsRtl; +- +- private int mScrollOffset; +- +- public ClearAllButton(Context context, AttributeSet attrs) { +- super(context, attrs); +- mIsRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; +- } +- +- @Override +- protected void onLayout(boolean changed, int left, int top, int right, int bottom) { +- super.onLayout(changed, left, top, right, bottom); +- PagedOrientationHandler orientationHandler = getRecentsView().getPagedOrientationHandler(); +- mScrollOffset = orientationHandler.getClearAllScrollOffset(getRecentsView(), mIsRtl); +- } +- +- private RecentsView getRecentsView() { +- return (RecentsView) getParent(); +- } +- +- @Override +- public void onRtlPropertiesChanged(int layoutDirection) { +- super.onRtlPropertiesChanged(layoutDirection); +- mIsRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; +- } +- +- @Override +- public boolean hasOverlappingRendering() { +- return false; +- } +- +- public void setContentAlpha(float alpha) { +- if (mContentAlpha != alpha) { +- mContentAlpha = alpha; +- updateAlpha(); +- } +- } +- +- public void setVisibilityAlpha(float alpha) { +- if (mVisibilityAlpha != alpha) { +- mVisibilityAlpha = alpha; +- updateAlpha(); +- } +- } +- +- @Override +- public void onPageScroll(ScrollState scrollState) { +- PagedOrientationHandler orientationHandler = getRecentsView().getPagedOrientationHandler(); +- float orientationSize = orientationHandler.getPrimaryValue(getWidth(), getHeight()); +- if (orientationSize == 0) { +- return; +- } +- +- float shift = Math.min(scrollState.scrollFromEdge, orientationSize); +- float translation = mIsRtl ? (mScrollOffset - shift) : (mScrollOffset + shift); +- orientationHandler.setPrimaryAndResetSecondaryTranslate(this, translation); +- mScrollAlpha = 1 - shift / orientationSize; +- updateAlpha(); +- } +- +- private void updateAlpha() { +- final float alpha = mScrollAlpha * mContentAlpha * mVisibilityAlpha; +- setAlpha(alpha); +- setClickable(alpha == 1); +- } +-} +diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +index 0130cae47..bfdd79e5f 100644 +--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java ++++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +@@ -85,6 +85,7 @@ import android.view.ViewGroup; + import android.view.accessibility.AccessibilityEvent; + import android.view.accessibility.AccessibilityNodeInfo; + import android.view.animation.Interpolator; ++import android.widget.Button; + import android.widget.ListView; + + import androidx.annotation.Nullable; +@@ -268,8 +269,7 @@ public abstract class RecentsView extends PagedView + private final float mFastFlingVelocity; + private final RecentsModel mModel; + private final int mTaskTopMargin; +- private final ClearAllButton mClearAllButton; +- private final Rect mClearAllButtonDeadZoneRect = new Rect(); ++ private Button mClearAllButton; + private final Rect mTaskViewDeadZoneRect = new Rect(); + + private final ScrollState mScrollState = new ScrollState(); +@@ -442,9 +442,6 @@ public abstract class RecentsView extends PagedView + mModel = RecentsModel.INSTANCE.get(context); + mIdp = InvariantDeviceProfile.INSTANCE.get(context); + +- mClearAllButton = (ClearAllButton) LayoutInflater.from(context) +- .inflate(R.layout.overview_clear_all_button, this, false); +- mClearAllButton.setOnClickListener(this::dismissAllTasks); + mTaskViewPool = new ViewPool<>(context, this, R.layout.task, 20 /* max size */, + 10 /* initial size */); + +@@ -550,6 +547,8 @@ public abstract class RecentsView extends PagedView + public void init(OverviewActionsView actionsView) { + mActionsView = actionsView; + mActionsView.updateHiddenFlags(HIDDEN_NO_TASKS, getTaskViewCount() == 0); ++ mClearAllButton = (Button) mActionsView.findViewById(R.id.clear_all); ++ mClearAllButton.setOnClickListener(this::dismissAllTasks); + } + + @Override +@@ -620,7 +619,7 @@ public abstract class RecentsView extends PagedView + } + + private void updateTaskStartIndex(View affectingView) { +- if (!(affectingView instanceof TaskView) && !(affectingView instanceof ClearAllButton)) { ++ if (!(affectingView instanceof TaskView)) { + int childCount = getChildCount(); + + mTaskViewStartIndex = 0; +@@ -674,7 +673,7 @@ public abstract class RecentsView extends PagedView + * button fully visible, center page is Clear All button. + */ + public boolean isClearAllHidden() { +- return mClearAllButton.getAlpha() != 1f; ++ return true; + } + + @Override +@@ -732,11 +731,8 @@ public abstract class RecentsView extends PagedView + mTouchDownToStartHome = true; + } else { + updateDeadZoneRects(); +- final boolean clearAllButtonDeadZoneConsumed = +- mClearAllButton.getAlpha() == 1 +- && mClearAllButtonDeadZoneRect.contains(x, y); + final boolean cameFromNavBar = (ev.getEdgeFlags() & EDGE_NAV_BAR) != 0; +- if (!clearAllButtonDeadZoneConsumed && !cameFromNavBar ++ if (!cameFromNavBar + && !mTaskViewDeadZoneRect.contains(x + getScrollX(), y)) { + mTouchDownToStartHome = true; + } +@@ -783,18 +779,12 @@ public abstract class RecentsView extends PagedView + + final int requiredTaskCount = tasks.size(); + if (getTaskViewCount() != requiredTaskCount) { +- if (indexOfChild(mClearAllButton) != -1) { +- removeView(mClearAllButton); +- } + for (int i = getTaskViewCount(); i < requiredTaskCount; i++) { + addView(mTaskViewPool.getView()); + } + while (getTaskViewCount() > requiredTaskCount) { + removeView(getChildAt(getChildCount() - 1)); + } +- if (requiredTaskCount > 0) { +- addView(mClearAllButton); +- } + } + + // Rebind and reset all task views +@@ -834,16 +824,10 @@ public abstract class RecentsView extends PagedView + for (int i = getTaskViewCount() - 1; i >= 0; i--) { + removeView(getTaskViewAt(i)); + } +- if (indexOfChild(mClearAllButton) != -1) { +- removeView(mClearAllButton); +- } + } + + public int getTaskViewCount() { + int taskViewCount = getChildCount() - mTaskViewStartIndex; +- if (indexOfChild(mClearAllButton) != -1) { +- taskViewCount--; +- } + return taskViewCount; + } + +@@ -1199,9 +1183,6 @@ public abstract class RecentsView extends PagedView + // Add an empty view for now until the task plan is loaded and applied + final TaskView taskView = mTaskViewPool.getView(); + addView(taskView, mTaskViewStartIndex); +- if (wasEmpty) { +- addView(mClearAllButton); +- } + // The temporary running task is only used for the duration between the start of the + // gesture and the task list is loaded and applied + mTmpRunningTask = Task.from(new TaskKey(runningTaskInfo), runningTaskInfo, false); +@@ -1538,7 +1519,6 @@ public abstract class RecentsView extends PagedView + removeViewInLayout(taskView); + + if (getTaskViewCount() == 0) { +- removeViewInLayout(mClearAllButton); + startHome(); + } else { + snapToPageImmediately(pageToSnapTo); +@@ -1677,7 +1657,6 @@ public abstract class RecentsView extends PagedView + child.setStableAlpha(alpha); + } + } +- mClearAllButton.setContentAlpha(mContentAlpha); + int alphaInt = Math.round(alpha * 255); + mEmptyMessagePaint.setAlpha(alphaInt); + mEmptyIcon.setAlpha(alphaInt); +@@ -1740,10 +1719,6 @@ public abstract class RecentsView extends PagedView + setLayoutDirection(mIsRtl + ? View.LAYOUT_DIRECTION_RTL + : View.LAYOUT_DIRECTION_LTR); +- mClearAllButton.setLayoutDirection(mIsRtl +- ? View.LAYOUT_DIRECTION_LTR +- : View.LAYOUT_DIRECTION_RTL); +- mClearAllButton.setRotation(mOrientationHandler.getDegreesRotated()); + mActivity.getDragLayer().recreateControllers(); + boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0 + || mOrientationState.getRecentsActivityRotation() != ROTATION_0; +@@ -1963,15 +1938,6 @@ public abstract class RecentsView extends PagedView + } + + private void updateDeadZoneRects() { +- // Get the deadzone rect surrounding the clear all button to not dismiss overview to home +- mClearAllButtonDeadZoneRect.setEmpty(); +- if (mClearAllButton.getWidth() > 0) { +- int verticalMargin = getResources() +- .getDimensionPixelSize(R.dimen.recents_clear_all_deadzone_vertical_margin); +- mClearAllButton.getHitRect(mClearAllButtonDeadZoneRect); +- mClearAllButtonDeadZoneRect.inset(-getPaddingRight() / 2, -verticalMargin); +- } +- + // Get the deadzone rect between the task views + mTaskViewDeadZoneRect.setEmpty(); + int count = getTaskViewCount(); +@@ -2304,10 +2270,6 @@ public abstract class RecentsView extends PagedView + return super.computeMaxScroll(); + } + +- public ClearAllButton getClearAllButton() { +- return mClearAllButton; +- } +- + @Override + protected boolean onOverscroll(int amount) { + // overscroll should only be accepted on -1 direction (for clear all button) +diff --git a/quickstep/res/drawable/ic_clear_all_recents.xml b/quickstep/res/drawable/ic_clear_all_recents.xml +new file mode 100644 +index 000000000..7cba0220b +--- /dev/null ++++ b/quickstep/res/drawable/ic_clear_all_recents.xml +@@ -0,0 +1,21 @@ ++ ++ ++ ++ +diff --git a/quickstep/res/layout/overview_actions_container.xml b/quickstep/res/layout/overview_actions_container.xml +index 258f24a54..302cabf8a 100644 +--- a/quickstep/res/layout/overview_actions_container.xml ++++ b/quickstep/res/layout/overview_actions_container.xml +@@ -45,6 +45,21 @@ + android:layout_height="1dp" + android:layout_weight="1" /> + ++