Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
849fb48634 | ||
|
|
e3b20ace1c | ||
|
|
cd8e39e830 | ||
|
|
3c41d0d3d3 | ||
|
|
17dc085b51 | ||
|
|
12b2241d24 | ||
|
|
bc2bbb0906 | ||
|
|
1a0d724bf1 | ||
|
|
3a82192c9d | ||
|
|
148c5438de | ||
|
|
4cd163c62b | ||
|
|
4ce6305950 | ||
|
|
800e1a579a | ||
|
|
cd68e3dcbc |
@@ -1,4 +1,4 @@
|
|||||||
From fdfbffda2815c0ac2270eae0efd0c31eb19e2dda Mon Sep 17 00:00:00 2001
|
From d893b5c1cedb6f2b2369a6d517ba6701484c3e3c Mon Sep 17 00:00:00 2001
|
||||||
From: AndyCGYan <GeForce8800Ultra@gmail.com>
|
From: AndyCGYan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Fri, 22 Mar 2019 00:41:20 +0800
|
Date: Fri, 22 Mar 2019 00:41:20 +0800
|
||||||
Subject: [PATCH 01/22] Disable FP lockouts optionally
|
Subject: [PATCH 01/22] Disable FP lockouts optionally
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From f48a8e1bb482cde1c1e0a628aea218796586130a Mon Sep 17 00:00:00 2001
|
From ffdf0faddb6e152b67714077bf79fa9109312217 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Thu, 5 Apr 2018 10:01:19 +0800
|
Date: Thu, 5 Apr 2018 10:01:19 +0800
|
||||||
Subject: [PATCH 02/22] Disable vendor mismatch warning
|
Subject: [PATCH 02/22] Disable vendor mismatch warning
|
||||||
@@ -9,10 +9,10 @@ Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
|
|||||||
1 file changed, 2 insertions(+), 14 deletions(-)
|
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
|
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
||||||
index ca45e087b60c..1d1da07f2942 100644
|
index 98091148c5bf..1d03092cfc64 100644
|
||||||
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
||||||
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
||||||
@@ -5875,20 +5875,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
@@ -5886,20 +5886,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Build.isBuildConsistent()) {
|
if (!Build.isBuildConsistent()) {
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
From d8dea7b3e03976fa4ab292f3d6fdcae84e039196 Mon Sep 17 00:00:00 2001
|
From 13ecef904ab561f69164fcd716ff13174edb9172 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Tue, 17 Jan 2023 17:19:19 +0000
|
Date: Tue, 17 Jan 2023 17:19:19 +0000
|
||||||
Subject: [PATCH 03/22] Keyguard: Fix colors of slices not updating on doze
|
Subject: [PATCH 03/22] Keyguard: Fix colors of slices not updating on doze
|
||||||
@@ -31,10 +31,10 @@ index f4c581552bc4..c0f983551877 100644
|
|||||||
* Set which clock should be displayed on the keyguard. The other one will be automatically
|
* Set which clock should be displayed on the keyguard. The other one will be automatically
|
||||||
* hidden.
|
* hidden.
|
||||||
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
|
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
|
||||||
index 1394c68ceeb7..6cb1da129b60 100644
|
index 673ce312618f..ad1804e9562e 100644
|
||||||
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
|
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
|
||||||
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
|
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
|
||||||
@@ -4422,6 +4422,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
@@ -4425,6 +4425,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
||||||
public void onDozeAmountChanged(float linearAmount, float amount) {
|
public void onDozeAmountChanged(float linearAmount, float amount) {
|
||||||
mInterpolatedDarkAmount = amount;
|
mInterpolatedDarkAmount = amount;
|
||||||
mLinearDarkAmount = linearAmount;
|
mLinearDarkAmount = linearAmount;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From b92f1ca708133033601f8f0e70a872c5a30052df Mon Sep 17 00:00:00 2001
|
From 538a4a35df63db0ee0596662bb8964e536b7b0ed Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sat, 16 Oct 2021 02:23:48 +0000
|
Date: Sat, 16 Oct 2021 02:23:48 +0000
|
||||||
Subject: [PATCH 04/22] UI: Adjust default navbar layouts
|
Subject: [PATCH 04/22] UI: Adjust default navbar layouts
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 09662a87b7db9b520aa5f996c5b837717fadfdec Mon Sep 17 00:00:00 2001
|
From a296a678b65aadf9e7865bafac04a94da852c9e0 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sun, 10 Jan 2021 11:44:29 +0000
|
Date: Sun, 10 Jan 2021 11:44:29 +0000
|
||||||
Subject: [PATCH 05/22] UI: Disable wallpaper zoom
|
Subject: [PATCH 05/22] UI: Disable wallpaper zoom
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From 6662339ff0a5507899d0f8bca883dbef8f748f1b Mon Sep 17 00:00:00 2001
|
From 6d6a5a9ffbb0028b4c9d30fc6129e58cdd7f49e4 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sun, 25 Sep 2022 02:20:52 +0000
|
Date: Sun, 25 Sep 2022 02:20:52 +0000
|
||||||
Subject: [PATCH 06/22] UI: Follow Monet and light/dark theme in user 1 icon
|
Subject: [PATCH 06/22] UI: Follow Monet and light/dark theme in user 1 icon
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 2249465d16cea6251df69dd13d331ed2fae270f0 Mon Sep 17 00:00:00 2001
|
From 90df0cb7c884014f7eb2beb7dcaec6e034538d93 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Wed, 3 Jun 2020 01:31:34 +0000
|
Date: Wed, 3 Jun 2020 01:31:34 +0000
|
||||||
Subject: [PATCH 07/22] UI: Increase default status bar height
|
Subject: [PATCH 07/22] UI: Increase default status bar height
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 380d8dff252dcde3b490cc3080bd56d2e3d21ec4 Mon Sep 17 00:00:00 2001
|
From d49dca61169377d8a07d0a19148f431adba94ba7 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sun, 25 Sep 2022 02:20:20 +0000
|
Date: Sun, 25 Sep 2022 02:20:20 +0000
|
||||||
Subject: [PATCH 08/22] UI: Remove QS footer background
|
Subject: [PATCH 08/22] UI: Remove QS footer background
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From 9f047b03021034b2cb21e7b8c2845eb8dfd577d1 Mon Sep 17 00:00:00 2001
|
From 2e4761e20020c1e0624fa5b2e76a07fb63564f3b Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sat, 19 Mar 2022 09:22:24 +0000
|
Date: Sat, 19 Mar 2022 09:22:24 +0000
|
||||||
Subject: [PATCH 09/22] UI: Restore split-screen divider to pre-Sv2 looks
|
Subject: [PATCH 09/22] UI: Restore split-screen divider to pre-Sv2 looks
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From 31f4647fa3e8662e372a3dacb08a64765f29915f Mon Sep 17 00:00:00 2001
|
From 42b0fe72055afc643d20629ef2b614ff0a744534 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Tue, 6 Oct 2020 01:41:16 +0000
|
Date: Tue, 6 Oct 2020 01:41:16 +0000
|
||||||
Subject: [PATCH 10/22] UI: Revive navbar layout tuning via sysui_nav_bar
|
Subject: [PATCH 10/22] UI: Revive navbar layout tuning via sysui_nav_bar
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From d81745ad081c1e8bbabd346deb3fa5cb3b3a1017 Mon Sep 17 00:00:00 2001
|
From a5566575757350417b9eec5b5aa2f00febbd17f9 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Sun, 26 Apr 2020 08:56:13 +0000
|
Date: Sun, 26 Apr 2020 08:56:13 +0000
|
||||||
Subject: [PATCH 11/22] UI: Use SNAP_FIXED_RATIO for multi-window globally
|
Subject: [PATCH 11/22] UI: Use SNAP_FIXED_RATIO for multi-window globally
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From a1b87f1cc52bd1d906554b94657634976b9fb776 Mon Sep 17 00:00:00 2001
|
From ef1bad1d4c5f0f00d960423f3946bfaec846339f Mon Sep 17 00:00:00 2001
|
||||||
From: Danny Lin <danny@kdrag0n.dev>
|
From: Danny Lin <danny@kdrag0n.dev>
|
||||||
Date: Tue, 3 Nov 2020 22:43:12 -0800
|
Date: Tue, 3 Nov 2020 22:43:12 -0800
|
||||||
Subject: [PATCH 12/22] core: Remove old app target SDK dialog
|
Subject: [PATCH 12/22] core: Remove old app target SDK dialog
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From 8b17b1dc3b1f373a0ae8a44d16a8adec599915b3 Mon Sep 17 00:00:00 2001
|
From 8f569b44cd1dbf6187be86e28d987f61cb74c89c Mon Sep 17 00:00:00 2001
|
||||||
From: Danny Lin <danny@kdrag0n.dev>
|
From: Danny Lin <danny@kdrag0n.dev>
|
||||||
Date: Tue, 5 Oct 2021 21:01:50 -0700
|
Date: Tue, 5 Oct 2021 21:01:50 -0700
|
||||||
Subject: [PATCH 13/22] Paint: Enable subpixel text positioning by default
|
Subject: [PATCH 13/22] Paint: Enable subpixel text positioning by default
|
||||||
|
|||||||
@@ -1,163 +0,0 @@
|
|||||||
From 482d15491c36aeb11a0e8b5c9a5205d389507034 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Danny Lin <danny@kdrag0n.dev>
|
|
||||||
Date: Sat, 16 Oct 2021 05:27:57 -0700
|
|
||||||
Subject: [PATCH 14/22] Add support for app signature spoofing
|
|
||||||
|
|
||||||
This is needed by microG GmsCore to pretend to be the official Google
|
|
||||||
Play Services package, because client apps check the package signature
|
|
||||||
to make sure it matches Google's official certificate.
|
|
||||||
|
|
||||||
This was forward-ported from the Android 10 patch by gudenau:
|
|
||||||
https://github.com/microg/android_packages_apps_GmsCore/pull/957
|
|
||||||
|
|
||||||
Changes made for Android 11:
|
|
||||||
- Updated PackageInfo calls
|
|
||||||
- Added new permission to public API surface, needed for
|
|
||||||
PermissionController which is now an updatable APEX on 11
|
|
||||||
- Added a dummy permission group to allow users to manage the
|
|
||||||
permission through the PermissionController UI
|
|
||||||
(by Vachounet <vachounet@live.fr>)
|
|
||||||
- Updated location provider comment for conciseness
|
|
||||||
|
|
||||||
Changes made for Android 12:
|
|
||||||
- Moved mayFakeSignature into lock-free Computer subclass
|
|
||||||
- Always get permissions for packages that request signature spoofing
|
|
||||||
(otherwise permissions are usually ommitted and thus the permission
|
|
||||||
check doesn't work properly)
|
|
||||||
- Optimize mayFakeSignature check order to improve performance
|
|
||||||
|
|
||||||
Changes made for Android 13:
|
|
||||||
- Computer subclass is now an independent class.
|
|
||||||
|
|
||||||
Change-Id: Ied7d6ce0b83a2d2345c3abba0429998d86494a88
|
|
||||||
---
|
|
||||||
core/api/current.txt | 2 ++
|
|
||||||
core/res/AndroidManifest.xml | 15 ++++++++++
|
|
||||||
core/res/res/values/strings.xml | 12 ++++++++
|
|
||||||
.../com/android/server/pm/ComputerEngine.java | 30 +++++++++++++++++--
|
|
||||||
4 files changed, 56 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/core/api/current.txt b/core/api/current.txt
|
|
||||||
index 487e57d114c9..04e69741b9fd 100644
|
|
||||||
--- a/core/api/current.txt
|
|
||||||
+++ b/core/api/current.txt
|
|
||||||
@@ -87,6 +87,7 @@ package android {
|
|
||||||
field public static final String DUMP = "android.permission.DUMP";
|
|
||||||
field public static final String EXPAND_STATUS_BAR = "android.permission.EXPAND_STATUS_BAR";
|
|
||||||
field public static final String FACTORY_TEST = "android.permission.FACTORY_TEST";
|
|
||||||
+ field public static final String FAKE_PACKAGE_SIGNATURE = "android.permission.FAKE_PACKAGE_SIGNATURE";
|
|
||||||
field public static final String FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE";
|
|
||||||
field public static final String GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
|
|
||||||
field public static final String GET_ACCOUNTS_PRIVILEGED = "android.permission.GET_ACCOUNTS_PRIVILEGED";
|
|
||||||
@@ -222,6 +223,7 @@ package android {
|
|
||||||
field public static final String CALL_LOG = "android.permission-group.CALL_LOG";
|
|
||||||
field public static final String CAMERA = "android.permission-group.CAMERA";
|
|
||||||
field public static final String CONTACTS = "android.permission-group.CONTACTS";
|
|
||||||
+ field public static final String FAKE_PACKAGE = "android.permission-group.FAKE_PACKAGE";
|
|
||||||
field public static final String LOCATION = "android.permission-group.LOCATION";
|
|
||||||
field public static final String MICROPHONE = "android.permission-group.MICROPHONE";
|
|
||||||
field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES";
|
|
||||||
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
|
|
||||||
index bbc3a7369423..af04d9d18fbd 100644
|
|
||||||
--- a/core/res/AndroidManifest.xml
|
|
||||||
+++ b/core/res/AndroidManifest.xml
|
|
||||||
@@ -3577,6 +3577,21 @@
|
|
||||||
android:description="@string/permdesc_getPackageSize"
|
|
||||||
android:protectionLevel="normal" />
|
|
||||||
|
|
||||||
+ <!-- Dummy user-facing group for faking package signature -->
|
|
||||||
+ <permission-group android:name="android.permission-group.FAKE_PACKAGE"
|
|
||||||
+ android:label="@string/permgrouplab_fake_package_signature"
|
|
||||||
+ android:description="@string/permgroupdesc_fake_package_signature"
|
|
||||||
+ android:request="@string/permgrouprequest_fake_package_signature"
|
|
||||||
+ android:priority="100" />
|
|
||||||
+
|
|
||||||
+ <!-- Allows an application to change the package signature as
|
|
||||||
+ seen by applications -->
|
|
||||||
+ <permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"
|
|
||||||
+ android:permissionGroup="android.permission-group.UNDEFINED"
|
|
||||||
+ android:protectionLevel="signature|privileged"
|
|
||||||
+ android:label="@string/permlab_fakePackageSignature"
|
|
||||||
+ android:description="@string/permdesc_fakePackageSignature" />
|
|
||||||
+
|
|
||||||
<!-- @deprecated No longer useful, see
|
|
||||||
{@link android.content.pm.PackageManager#addPackageToPreferred}
|
|
||||||
for details. -->
|
|
||||||
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
|
|
||||||
index 2091c0502b6f..6888edcf7d3c 100644
|
|
||||||
--- a/core/res/res/values/strings.xml
|
|
||||||
+++ b/core/res/res/values/strings.xml
|
|
||||||
@@ -982,6 +982,18 @@
|
|
||||||
|
|
||||||
<!-- Permissions -->
|
|
||||||
|
|
||||||
+ <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
|
|
||||||
+ <string name="permlab_fakePackageSignature">Spoof package signature</string>
|
|
||||||
+ <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
|
|
||||||
+ <string name="permdesc_fakePackageSignature">Allows the app to pretend to be a different app. Malicious applications might be able to use this to access private application data. Legitimate uses include an emulator pretending to be what it emulates. Grant this permission with caution only!</string>
|
|
||||||
+ <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
|
|
||||||
+ <string name="permgrouplab_fake_package_signature">Spoof package signature</string>
|
|
||||||
+ <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
|
|
||||||
+ <string name="permgroupdesc_fake_package_signature">allow to spoof package signature</string>
|
|
||||||
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
|
|
||||||
+ <string name="permgrouprequest_fake_package_signature">Allow
|
|
||||||
+ <b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g></b> to spoof package signature?</string>
|
|
||||||
+
|
|
||||||
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
|
|
||||||
<string name="permlab_statusBar">disable or modify status bar</string>
|
|
||||||
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
|
|
||||||
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
|
|
||||||
index 46b7460dff1b..40549962436f 100644
|
|
||||||
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
|
|
||||||
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
|
|
||||||
@@ -1603,6 +1603,29 @@ public class ComputerEngine implements Computer {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ private boolean requestsFakeSignature(AndroidPackage p) {
|
|
||||||
+ return p.getMetaData() != null &&
|
|
||||||
+ p.getMetaData().getString("fake-signature") != null;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private PackageInfo mayFakeSignature(AndroidPackage p, PackageInfo pi,
|
|
||||||
+ Set<String> permissions) {
|
|
||||||
+ try {
|
|
||||||
+ if (p.getMetaData() != null &&
|
|
||||||
+ p.getTargetSdkVersion() > Build.VERSION_CODES.LOLLIPOP_MR1) {
|
|
||||||
+ String sig = p.getMetaData().getString("fake-signature");
|
|
||||||
+ if (sig != null &&
|
|
||||||
+ permissions.contains("android.permission.FAKE_PACKAGE_SIGNATURE")) {
|
|
||||||
+ pi.signatures = new Signature[] {new Signature(sig)};
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } catch (Throwable t) {
|
|
||||||
+ // We should never die because of any failures, this is system code!
|
|
||||||
+ Log.w("PackageManagerService.FAKE_PACKAGE_SIGNATURE", t);
|
|
||||||
+ }
|
|
||||||
+ return pi;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public final PackageInfo generatePackageInfo(PackageStateInternal ps,
|
|
||||||
@PackageManager.PackageInfoFlagsBits long flags, int userId) {
|
|
||||||
if (!mUserManager.exists(userId)) return null;
|
|
||||||
@@ -1632,13 +1655,14 @@ public class ComputerEngine implements Computer {
|
|
||||||
final int[] gids = (flags & PackageManager.GET_GIDS) == 0 ? EMPTY_INT_ARRAY
|
|
||||||
: mPermissionManager.getGidsForUid(UserHandle.getUid(userId, ps.getAppId()));
|
|
||||||
// Compute granted permissions only if package has requested permissions
|
|
||||||
- final Set<String> permissions = ((flags & PackageManager.GET_PERMISSIONS) == 0
|
|
||||||
+ final Set<String> permissions = (((flags & PackageManager.GET_PERMISSIONS) == 0
|
|
||||||
+ && !requestsFakeSignature(p))
|
|
||||||
|| ArrayUtils.isEmpty(p.getRequestedPermissions())) ? Collections.emptySet()
|
|
||||||
: mPermissionManager.getGrantedPermissions(ps.getPackageName(), userId);
|
|
||||||
|
|
||||||
- PackageInfo packageInfo = PackageInfoUtils.generate(p, gids, flags,
|
|
||||||
+ PackageInfo packageInfo = mayFakeSignature(p, PackageInfoUtils.generate(p, gids, flags,
|
|
||||||
state.getFirstInstallTime(), ps.getLastUpdateTime(), permissions, state, userId,
|
|
||||||
- ps);
|
|
||||||
+ ps), permissions);
|
|
||||||
|
|
||||||
if (packageInfo == null) {
|
|
||||||
return null;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
From e899e501d403be5c654356d3e7830fb113468a06 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sun, 17 Mar 2024 17:10:38 +0800
|
||||||
|
Subject: [PATCH 14/22] Remove debuggable requirement for signature spoofing
|
||||||
|
|
||||||
|
Change-Id: I8d637ddbbd117a9c5b1d9c5e462b0f4b30d98333
|
||||||
|
---
|
||||||
|
services/core/java/com/android/server/pm/ComputerEngine.java | 4 ----
|
||||||
|
1 file changed, 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
|
||||||
|
index 63e3deffe97a..f6a5a7d4beec 100644
|
||||||
|
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
|
||||||
|
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
|
||||||
|
@@ -1612,10 +1612,6 @@ public class ComputerEngine implements Computer {
|
||||||
|
private static native boolean isDebuggable();
|
||||||
|
|
||||||
|
public static boolean isMicrogSigned(AndroidPackage p) {
|
||||||
|
- if (!isDebuggable()) {
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
// Allowlist the following apps:
|
||||||
|
// * com.android.vending - microG Companion
|
||||||
|
// * com.google.android.gms - microG Services
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From db27d27f48658841c6a74e55f543f417ddb16e76 Mon Sep 17 00:00:00 2001
|
From ee6873d2d3a1de9850c8076ae4436de789a131e4 Mon Sep 17 00:00:00 2001
|
||||||
From: Danny Lin <danny@kdrag0n.dev>
|
From: Danny Lin <danny@kdrag0n.dev>
|
||||||
Date: Mon, 11 Oct 2021 19:59:51 -0700
|
Date: Mon, 11 Oct 2021 19:59:51 -0700
|
||||||
Subject: [PATCH 15/22] Spoof product name for Google Play Services
|
Subject: [PATCH 15/22] Spoof product name for Google Play Services
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From dc4bd0f140c6946e01e0a3c31bfc71c884138981 Mon Sep 17 00:00:00 2001
|
From e065f29eb6d625f9fd7a2cbd7e12fe49bde437ab Mon Sep 17 00:00:00 2001
|
||||||
From: Danny Lin <danny@kdrag0n.dev>
|
From: Danny Lin <danny@kdrag0n.dev>
|
||||||
Date: Mon, 11 Oct 2021 20:00:44 -0700
|
Date: Mon, 11 Oct 2021 20:00:44 -0700
|
||||||
Subject: [PATCH 16/22] keystore: Block key attestation for SafetyNet
|
Subject: [PATCH 16/22] keystore: Block key attestation for SafetyNet
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From 05bc5fa10b4e2ebc539c32db04abbc995906ff05 Mon Sep 17 00:00:00 2001
|
From b5749dfcd4609d8e1da94bf3955b1f57206d68ce Mon Sep 17 00:00:00 2001
|
||||||
From: Danny Lin <danny@kdrag0n.dev>
|
From: Danny Lin <danny@kdrag0n.dev>
|
||||||
Date: Mon, 1 Nov 2021 20:06:48 -0700
|
Date: Mon, 1 Nov 2021 20:06:48 -0700
|
||||||
Subject: [PATCH 17/22] Limit SafetyNet workarounds to unstable GMS process
|
Subject: [PATCH 17/22] Limit SafetyNet workarounds to unstable GMS process
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From ace6036332743c6f1a5614b2fd573464ddbffef7 Mon Sep 17 00:00:00 2001
|
From 610a08dd91e00c97f96ea3591e39075279b0ed63 Mon Sep 17 00:00:00 2001
|
||||||
From: Dyneteve <dyneteve@hentaios.com>
|
From: Dyneteve <dyneteve@hentaios.com>
|
||||||
Date: Tue, 23 Aug 2022 18:57:05 +0200
|
Date: Tue, 23 Aug 2022 18:57:05 +0200
|
||||||
Subject: [PATCH 18/22] gmscompat: Apply the SafetyNet workaround to Play Store
|
Subject: [PATCH 18/22] gmscompat: Apply the SafetyNet workaround to Play Store
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From d67897a23c6e182294d6a6d137d7ccc430a1abe0 Mon Sep 17 00:00:00 2001
|
From 408575a46fdc4defebe1fd5007ca93414811d56f Mon Sep 17 00:00:00 2001
|
||||||
From: Dyneteve <dyneteve@hentaios.com>
|
From: Dyneteve <dyneteve@hentaios.com>
|
||||||
Date: Thu, 8 Sep 2022 14:39:52 +0200
|
Date: Thu, 8 Sep 2022 14:39:52 +0200
|
||||||
Subject: [PATCH 19/22] gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
|
Subject: [PATCH 19/22] gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 7893f246007a1989420583ab8728a5ced89e944d Mon Sep 17 00:00:00 2001
|
From 68768e51898fb5ce2a33bf71e0d8aa7ca4b11ef8 Mon Sep 17 00:00:00 2001
|
||||||
From: Dyneteve <dyneteve@hentaios.com>
|
From: Dyneteve <dyneteve@hentaios.com>
|
||||||
Date: Tue, 6 Dec 2022 15:59:08 +0100
|
Date: Tue, 6 Dec 2022 15:59:08 +0100
|
||||||
Subject: [PATCH 20/22] gmscompat: Use actual device model name
|
Subject: [PATCH 20/22] gmscompat: Use actual device model name
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From dd5e4484df6868958941773ac310396b281e5ceb Mon Sep 17 00:00:00 2001
|
From b9bd0ca2011b6b36a6ce46f5585d1a27ea368868 Mon Sep 17 00:00:00 2001
|
||||||
From: Anirudh Gupta <anirudhgupta109@aosip.dev>
|
From: Anirudh Gupta <anirudhgupta109@aosip.dev>
|
||||||
Date: Wed, 4 Jan 2023 18:20:56 +0000
|
Date: Wed, 4 Jan 2023 18:20:56 +0000
|
||||||
Subject: [PATCH 21/22] gmscompat: Set shipping level to 32 for devices >=33
|
Subject: [PATCH 21/22] gmscompat: Set shipping level to 32 for devices >=33
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
From 4ffed064b21d9662631ee70d20dfd8441fcec574 Mon Sep 17 00:00:00 2001
|
From 2294242196f5d82cdc929dfb0174ae08d4e67d85 Mon Sep 17 00:00:00 2001
|
||||||
From: Dyneteve <dyneteve@hentaios.com>
|
From: Dyneteve <dyneteve@hentaios.com>
|
||||||
Date: Wed, 8 Feb 2023 15:21:01 +0000
|
Date: Wed, 8 Feb 2023 15:21:01 +0000
|
||||||
Subject: [PATCH 22/22] gmscompat: Make CTS/Play Integrity pass again
|
Subject: [PATCH 22/22] gmscompat: Make CTS/Play Integrity pass again
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+23
@@ -0,0 +1,23 @@
|
|||||||
|
From 5f607c73f8601349d166c461d2d96237ce2779cf Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sun, 8 Aug 2021 09:29:32 +0000
|
||||||
|
Subject: [PATCH 2/9] treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS explicitly
|
||||||
|
|
||||||
|
Change-Id: I725443154fabde548d2e6c1b072d34c27596c421
|
||||||
|
---
|
||||||
|
board-base.mk | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/board-base.mk b/board-base.mk
|
||||||
|
index 2cb5dbc..e493d1c 100644
|
||||||
|
--- a/board-base.mk
|
||||||
|
+++ b/board-base.mk
|
||||||
|
@@ -10,3 +10,5 @@ BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs persist
|
||||||
|
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
||||||
|
|
||||||
|
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
|
||||||
|
+
|
||||||
|
+BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
From 637b46fa0db205ba2b592e8a081680d3c281c792 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Wed, 20 Oct 2021 11:30:25 +0000
|
||||||
|
Subject: [PATCH 3/9] treble: Set TARGET_NO_KERNEL_OVERRIDE
|
||||||
|
|
||||||
|
Taken from Lineage generic targets - skips building kernel cleanly
|
||||||
|
|
||||||
|
Change-Id: Id71d3a3aed56fd4e815a64ef4191b125fc5026ce
|
||||||
|
---
|
||||||
|
board-base.mk | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/board-base.mk b/board-base.mk
|
||||||
|
index e493d1c..9d1d45e 100644
|
||||||
|
--- a/board-base.mk
|
||||||
|
+++ b/board-base.mk
|
||||||
|
@@ -12,3 +12,5 @@ BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
||||||
|
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
|
||||||
|
|
||||||
|
BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
||||||
|
+
|
||||||
|
+TARGET_NO_KERNEL_OVERRIDE := true
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
From 8db167728d498636399cf2ca04cbdd4a3e23b9f9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Tue, 11 Oct 2022 11:29:02 +0000
|
||||||
|
Subject: [PATCH 4/9] treble: Enable call recording
|
||||||
|
|
||||||
|
Change-Id: I57ca3604363547419a566b37b5151b6b30c46d28
|
||||||
|
---
|
||||||
|
.../dialer/callrecord/res/values/config.xml | 20 +++++++++++++++++++
|
||||||
|
1 file changed, 20 insertions(+)
|
||||||
|
create mode 100644 overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
|
||||||
|
|
||||||
|
diff --git a/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml b/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..4cacde5
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml
|
||||||
|
@@ -0,0 +1,20 @@
|
||||||
|
+<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
+<!--
|
||||||
|
+ Copyright (C) 2021 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.
|
||||||
|
+-->
|
||||||
|
+<resources>
|
||||||
|
+ <bool name="call_recording_enabled">true</bool>
|
||||||
|
+ <integer name="call_recording_audio_source">4</integer>
|
||||||
|
+</resources>
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
From eec24080edaf13ebf8d4b58815a5ef7c22f88658 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sat, 5 Nov 2022 23:49:11 +0000
|
||||||
|
Subject: [PATCH 5/9] treble: Switch to MindTheGapps
|
||||||
|
|
||||||
|
Change-Id: I1b80d4c5176cbf4af21d147c71b0abce6027c7c7
|
||||||
|
---
|
||||||
|
generate.sh | 13 +++++++------
|
||||||
|
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/generate.sh b/generate.sh
|
||||||
|
index 89fa88b..8654eeb 100644
|
||||||
|
--- a/generate.sh
|
||||||
|
+++ b/generate.sh
|
||||||
|
@@ -24,9 +24,15 @@ for part in a ab;do
|
||||||
|
extra_packages=""
|
||||||
|
vndk="vndk.mk"
|
||||||
|
optional_base=""
|
||||||
|
+
|
||||||
|
+ baseArch="$arch"
|
||||||
|
+ if [ "$arch" = "a64" ];then
|
||||||
|
+ baseArch="arm"
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
if [ "$apps" == "gapps" ];then
|
||||||
|
apps_suffix="g"
|
||||||
|
- apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
|
||||||
|
+ apps_script='$(call inherit-product, vendor/gapps/'$baseArch'/'$baseArch'-vendor.mk)'
|
||||||
|
apps_name="with GApps"
|
||||||
|
fi
|
||||||
|
if [ "$apps" == "gapps-go" ];then
|
||||||
|
@@ -66,11 +72,6 @@ for part in a ab;do
|
||||||
|
|
||||||
|
target="lineage_${arch}_${part_suffix}${apps_suffix}${su_suffix}"
|
||||||
|
|
||||||
|
- baseArch="$arch"
|
||||||
|
- if [ "$arch" = "a64" ];then
|
||||||
|
- baseArch="arm"
|
||||||
|
- fi
|
||||||
|
-
|
||||||
|
zygote=32
|
||||||
|
if [ "$arch" = "arm64" ];then
|
||||||
|
zygote=64_32
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
From fd621da49491bdb2272a076778c7c0374b3f6d1f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Tue, 22 Nov 2022 00:36:15 +0000
|
||||||
|
Subject: [PATCH 6/9] treble: Stop securing ADB
|
||||||
|
|
||||||
|
Seems to kill USB Debugging altogether on certain devices,
|
||||||
|
and unrelated to SN anyway
|
||||||
|
Build-time macro coupled with vendor/lineage might do better...
|
||||||
|
|
||||||
|
Change-Id: I0215b3ed970dd53a124f48e30ca2cf4b0c6d2899
|
||||||
|
---
|
||||||
|
rw-system.sh | 3 ---
|
||||||
|
1 file changed, 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/rw-system.sh b/rw-system.sh
|
||||||
|
index d78d6f2..dfd9305 100644
|
||||||
|
--- a/rw-system.sh
|
||||||
|
+++ b/rw-system.sh
|
||||||
|
@@ -786,13 +786,10 @@ if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
|
||||||
|
resetprop_phh ro.boot.veritymode enforcing
|
||||||
|
resetprop_phh ro.boot.warranty_bit 0
|
||||||
|
resetprop_phh ro.warranty_bit 0
|
||||||
|
- resetprop_phh ro.debuggable 0
|
||||||
|
resetprop_phh ro.secure 1
|
||||||
|
resetprop_phh ro.build.type user
|
||||||
|
resetprop_phh ro.build.selinux 0
|
||||||
|
|
||||||
|
- resetprop_phh ro.adb.secure 1
|
||||||
|
-
|
||||||
|
# Hide system/xbin/su
|
||||||
|
mount /mnt/phh/empty_dir /system/xbin
|
||||||
|
mount /mnt/phh/empty_dir /system/app/me.phh.superuser
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
From 81f34a4c35c904fdb34fae8f35229dc2f0580df9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Thu, 29 Dec 2022 15:12:03 +0000
|
||||||
|
Subject: [PATCH 7/9] treble: Securize on-demand
|
||||||
|
|
||||||
|
Status is stored in /metadata and controlled by persist prop
|
||||||
|
|
||||||
|
Change-Id: I8069b6f471ad87ab34c18b743689ab3584cee35b
|
||||||
|
---
|
||||||
|
phh-prop-handler.sh | 14 ++++++++++++++
|
||||||
|
vndk.rc | 3 +++
|
||||||
|
2 files changed, 17 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh
|
||||||
|
index 2d30ab7..92db128 100644
|
||||||
|
--- a/phh-prop-handler.sh
|
||||||
|
+++ b/phh-prop-handler.sh
|
||||||
|
@@ -257,3 +257,17 @@ if [ "$1" == "persist.bluetooth.system_audio_hal.enabled" ]; then
|
||||||
|
restartAudio
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
+
|
||||||
|
+if [ "$1" == "persist.sys.phh.securize" ];then
|
||||||
|
+ if [[ "$prop_value" != "true" && "$prop_value" != "false" ]]; then
|
||||||
|
+ exit 1
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
+ if [[ "$prop_value" == "true" ]]; then
|
||||||
|
+ mkdir /metadata/phh
|
||||||
|
+ touch /metadata/phh/secure
|
||||||
|
+ else
|
||||||
|
+ rm /metadata/phh/secure
|
||||||
|
+ fi
|
||||||
|
+ exit
|
||||||
|
+fi
|
||||||
|
diff --git a/vndk.rc b/vndk.rc
|
||||||
|
index 823456a..1ec8ccb 100644
|
||||||
|
--- a/vndk.rc
|
||||||
|
+++ b/vndk.rc
|
||||||
|
@@ -90,3 +90,6 @@ service watchdogd-gsi /system/bin/watchdogd 10 20
|
||||||
|
class core
|
||||||
|
oneshot
|
||||||
|
seclabel u:r:watchdogd:s0
|
||||||
|
+
|
||||||
|
+on property:persist.sys.phh.securize=*
|
||||||
|
+ exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.securize"
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
From d67665b77e18082ef9362e4047f99de0a1b0f81f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Wed, 22 Mar 2023 23:37:05 +0000
|
||||||
|
Subject: [PATCH 8/9] treble: Also use /data/adb for securize status
|
||||||
|
|
||||||
|
Change-Id: I778f2be5407ae0a548a098c72031cce9be83cf96
|
||||||
|
---
|
||||||
|
phh-prop-handler.sh | 5 ++++-
|
||||||
|
rw-system.sh | 2 +-
|
||||||
|
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh
|
||||||
|
index 92db128..0b862d1 100644
|
||||||
|
--- a/phh-prop-handler.sh
|
||||||
|
+++ b/phh-prop-handler.sh
|
||||||
|
@@ -264,10 +264,13 @@ if [ "$1" == "persist.sys.phh.securize" ];then
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$prop_value" == "true" ]]; then
|
||||||
|
- mkdir /metadata/phh
|
||||||
|
+ mkdir -p /metadata/phh
|
||||||
|
touch /metadata/phh/secure
|
||||||
|
+ mkdir -p /data/adb/phh
|
||||||
|
+ touch /data/adb/phh/secure
|
||||||
|
else
|
||||||
|
rm /metadata/phh/secure
|
||||||
|
+ rm /data/adb/phh/secure
|
||||||
|
fi
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
diff --git a/rw-system.sh b/rw-system.sh
|
||||||
|
index dfd9305..a716c9b 100644
|
||||||
|
--- a/rw-system.sh
|
||||||
|
+++ b/rw-system.sh
|
||||||
|
@@ -749,7 +749,7 @@ copyprop() {
|
||||||
|
resetprop_phh "$1" "$(getprop "$2")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
-if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
|
||||||
|
+if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ] || [ -f /data/adb/phh/secure ];then
|
||||||
|
copyprop ro.build.device ro.vendor.build.device
|
||||||
|
copyprop ro.system.build.fingerprint ro.vendor.build.fingerprint
|
||||||
|
copyprop ro.bootimage.build.fingerprint ro.vendor.build.fingerprint
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +0,0 @@
|
|||||||
From eca6f07922f3804f6f1844f067941fc8097459c5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Sat, 24 Mar 2018 08:01:48 +0100
|
|
||||||
Subject: [PATCH 2/3] LightsService: Alternative backlight scale
|
|
||||||
|
|
||||||
Reserved a manual override just in case
|
|
||||||
|
|
||||||
Change-Id: I46ae69c758d1a4609d89cf1c293488ea5fc76787
|
|
||||||
---
|
|
||||||
.../com/android/server/lights/LightsService.java | 13 +++++++++++++
|
|
||||||
1 file changed, 13 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
|
||||||
index fea6b29d9260..2a9a3b63ea2e 100644
|
|
||||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
|
||||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
|
||||||
@@ -32,6 +32,7 @@ import android.os.IBinder;
|
|
||||||
import android.os.Looper;
|
|
||||||
import android.os.RemoteException;
|
|
||||||
import android.os.ServiceManager;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
import android.os.Trace;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.util.Slog;
|
|
||||||
@@ -295,6 +296,18 @@ public class LightsService extends SystemService {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness);
|
|
||||||
+ if (mHwLight.id == 0) {
|
|
||||||
+ int scaleOverrideValue = SystemProperties.getInt("persist.sys.treble.backlight_scale.override_value", -1);
|
|
||||||
+ if (scaleOverrideValue != -1) {
|
|
||||||
+ setLightLocked(brightnessInt * scaleOverrideValue / 255, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ int scaleValue = SystemProperties.getInt("persist.sys.treble.backlight_scale.value", -1);
|
|
||||||
+ if (scaleValue != -1) {
|
|
||||||
+ setLightLocked(brightnessInt * scaleValue / 255, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
int color = brightnessInt & 0x000000ff;
|
|
||||||
color = 0xff000000 | (color << 16) | (color << 8) | color;
|
|
||||||
setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
From 25edd8e7b0afd85ea1bc6f39878b557c47366518 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Fri, 30 Sep 2022 11:32:24 +0000
|
|
||||||
Subject: [PATCH] Add an enum for Treble settings
|
|
||||||
|
|
||||||
Change-Id: I8dc25afa27e938ee82594a8343e73c7c494003e2
|
|
||||||
---
|
|
||||||
stats/enums/app/settings_enums.proto | 3 +++
|
|
||||||
1 file changed, 3 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/stats/enums/app/settings_enums.proto b/stats/enums/app/settings_enums.proto
|
|
||||||
index ed241b6c..41b5efe0 100644
|
|
||||||
--- a/stats/enums/app/settings_enums.proto
|
|
||||||
+++ b/stats/enums/app/settings_enums.proto
|
|
||||||
@@ -2006,6 +2006,9 @@ enum PageId {
|
|
||||||
// OPEN: Settings > System > Input & Gesture > Double twist gesture
|
|
||||||
SETTINGS_GESTURE_DOUBLE_TWIST = 755;
|
|
||||||
|
|
||||||
+ // OPEN: Settings > Treble Settings
|
|
||||||
+ SETTINGS_TREBLE_CATEGORY = 777;
|
|
||||||
+
|
|
||||||
// OPEN: Settings > Apps > Default Apps > Default browser
|
|
||||||
DEFAULT_BROWSER_PICKER = 785;
|
|
||||||
// OPEN: Settings > Apps > Default Apps > Default emergency app
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
+309
@@ -0,0 +1,309 @@
|
|||||||
|
From f68ae539a97bd8f1ec566a34cf68f5ee4a14af00 Mon Sep 17 00:00:00 2001
|
||||||
|
From: TogoFire <italomellopereira@gmail.com>
|
||||||
|
Date: Fri, 6 Aug 2021 08:54:07 -0300
|
||||||
|
Subject: [PATCH 1/2] Revert "[Wi-Fi] Remove 'Do not validate' option in CA
|
||||||
|
certificate spinner"
|
||||||
|
|
||||||
|
This is not a definitive fix, so revert it. WPA2-Enterprise (802.1X) or
|
||||||
|
WPA2-PSK.
|
||||||
|
|
||||||
|
[xawlw]:
|
||||||
|
- Sometimes we can't connect to some Enterprise WiFi networks because we
|
||||||
|
don't know its domain so let's revert this 'Security' feature
|
||||||
|
- Read more about it here:
|
||||||
|
https://www.xda-developers.com/android-11-break-enterprise-wifi-connection/
|
||||||
|
|
||||||
|
This reverts commit 33cde5dbeee934269f16d72e26e651d56a13733e.
|
||||||
|
This reverts commit 94b8579607c6f1201cea9d6601e88cec897b2ff6.
|
||||||
|
|
||||||
|
Signed-off-by: TogoFire <italomellopereira@gmail.com>
|
||||||
|
Signed-off-by: xawlw <abdulazizawlw@gmail.com>
|
||||||
|
Change-Id: I3cec92b74a419b5463c5e5db496863e66d034703
|
||||||
|
---
|
||||||
|
res/layout/wifi_network_config.xml | 12 +++++++
|
||||||
|
res/values/custom_strings.xml | 5 +++
|
||||||
|
.../settings/wifi/WifiConfigController.java | 33 +++++++++++++------
|
||||||
|
.../settings/wifi/WifiConfigController2.java | 33 +++++++++++++------
|
||||||
|
4 files changed, 63 insertions(+), 20 deletions(-)
|
||||||
|
create mode 100644 res/values/custom_strings.xml
|
||||||
|
|
||||||
|
diff --git a/res/layout/wifi_network_config.xml b/res/layout/wifi_network_config.xml
|
||||||
|
index f91f7385c1..e7b8df3c2a 100644
|
||||||
|
--- a/res/layout/wifi_network_config.xml
|
||||||
|
+++ b/res/layout/wifi_network_config.xml
|
||||||
|
@@ -206,6 +206,18 @@
|
||||||
|
android:entries="@array/eap_ocsp_type"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
+ <LinearLayout android:id="@+id/no_ca_cert_warning"
|
||||||
|
+ android:layout_width="match_parent"
|
||||||
|
+ android:layout_height="wrap_content"
|
||||||
|
+ android:visibility="gone"
|
||||||
|
+ style="@style/wifi_item" >
|
||||||
|
+ <TextView
|
||||||
|
+ android:layout_width="wrap_content"
|
||||||
|
+ android:layout_height="wrap_content"
|
||||||
|
+ style="@style/wifi_item_warning"
|
||||||
|
+ android:text="@string/wifi_do_not_validate_eap_server_warning" />
|
||||||
|
+ </LinearLayout>
|
||||||
|
+
|
||||||
|
<LinearLayout android:id="@+id/l_domain"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..14462c36a4
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/res/values/custom_strings.xml
|
||||||
|
@@ -0,0 +1,5 @@
|
||||||
|
+<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
+ <!-- Warning message displayed if user choses not to validate the EAP server -->
|
||||||
|
+ <string name="wifi_do_not_validate_eap_server_warning">No certificate specified. Your connection will not be private.</string>
|
||||||
|
+</resources>
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
|
||||||
|
index 0c063db8a7..306576d102 100644
|
||||||
|
--- a/src/com/android/settings/wifi/WifiConfigController.java
|
||||||
|
+++ b/src/com/android/settings/wifi/WifiConfigController.java
|
||||||
|
@@ -166,6 +166,7 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
private String mMultipleCertSetString;
|
||||||
|
private String mUseSystemCertsString;
|
||||||
|
private String mDoNotProvideEapUserCertString;
|
||||||
|
+ private String mDoNotValidateEapServerString;
|
||||||
|
|
||||||
|
private Spinner mSecuritySpinner;
|
||||||
|
@VisibleForTesting Spinner mEapMethodSpinner;
|
||||||
|
@@ -272,6 +273,8 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
mUseSystemCertsString = mContext.getString(R.string.wifi_use_system_certs);
|
||||||
|
mDoNotProvideEapUserCertString =
|
||||||
|
mContext.getString(R.string.wifi_do_not_provide_eap_user_cert);
|
||||||
|
+ mDoNotValidateEapServerString =
|
||||||
|
+ mContext.getString(R.string.wifi_do_not_validate_eap_server);
|
||||||
|
|
||||||
|
mSsidScanButton = (ImageButton) mView.findViewById(R.id.ssid_scanner_button);
|
||||||
|
mIpSettingsSpinner = (Spinner) mView.findViewById(R.id.ip_settings);
|
||||||
|
@@ -544,7 +547,8 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
// Disallow submit if the user has not selected a CA certificate for an EAP network
|
||||||
|
// configuration.
|
||||||
|
enabled = false;
|
||||||
|
- } else if (mEapDomainView != null
|
||||||
|
+ } else if (!caCertSelection.equals(mDoNotValidateEapServerString)
|
||||||
|
+ && mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
// Disallow submit if the user chooses to use a certificate for EAP server
|
||||||
|
@@ -566,6 +570,7 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
}
|
||||||
|
|
||||||
|
void showWarningMessagesIfAppropriate() {
|
||||||
|
+ mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.GONE);
|
||||||
|
mView.findViewById(R.id.no_user_cert_warning).setVisibility(View.GONE);
|
||||||
|
mView.findViewById(R.id.no_domain_warning).setVisibility(View.GONE);
|
||||||
|
mView.findViewById(R.id.ssid_too_long_warning).setVisibility(View.GONE);
|
||||||
|
@@ -578,7 +583,13 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
}
|
||||||
|
if (mEapCaCertSpinner != null
|
||||||
|
&& mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
|
||||||
|
- if (mEapDomainView != null
|
||||||
|
+ String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
|
||||||
|
+ if (caCertSelection.equals(mDoNotValidateEapServerString)) {
|
||||||
|
+ // Display warning if user chooses not to validate the EAP server with a
|
||||||
|
+ // user-supplied CA certificate in an EAP network configuration.
|
||||||
|
+ mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.VISIBLE);
|
||||||
|
+ } else if (!caCertSelection.equals(mUnspecifiedCertString)
|
||||||
|
+ && mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
// Display warning if user chooses to use a certificate without restricting the
|
||||||
|
@@ -719,7 +730,8 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
config.enterpriseConfig.setCaCertificateAliases(null);
|
||||||
|
config.enterpriseConfig.setCaPath(null);
|
||||||
|
config.enterpriseConfig.setDomainSuffixMatch(mEapDomainView.getText().toString());
|
||||||
|
- if (caCert.equals(mUnspecifiedCertString)) {
|
||||||
|
+ if (caCert.equals(mUnspecifiedCertString)
|
||||||
|
+ || caCert.equals(mDoNotValidateEapServerString)) {
|
||||||
|
// ca_cert already set to null, so do nothing.
|
||||||
|
} else if (caCert.equals(mUseSystemCertsString)) {
|
||||||
|
config.enterpriseConfig.setCaPath(SYSTEM_CA_STORE_PATH);
|
||||||
|
@@ -753,7 +765,8 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only set OCSP option if there is a valid CA certificate.
|
||||||
|
- if (caCert.equals(mUnspecifiedCertString)) {
|
||||||
|
+ if (caCert.equals(mUnspecifiedCertString)
|
||||||
|
+ || caCert.equals(mDoNotValidateEapServerString)) {
|
||||||
|
config.enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_NONE);
|
||||||
|
} else {
|
||||||
|
config.enterpriseConfig.setOcsp(mEapOcspSpinner.getSelectedItemPosition());
|
||||||
|
@@ -1057,7 +1070,7 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
loadCertificates(
|
||||||
|
mEapCaCertSpinner,
|
||||||
|
androidKeystoreAliasLoader.getCaCertAliases(),
|
||||||
|
- null /* noCertificateString */,
|
||||||
|
+ mDoNotValidateEapServerString /* noCertificateString */,
|
||||||
|
false /* showMultipleCerts */,
|
||||||
|
true /* showUsePreinstalledCertOption */);
|
||||||
|
loadCertificates(
|
||||||
|
@@ -1141,7 +1154,7 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
} else {
|
||||||
|
String[] caCerts = enterpriseConfig.getCaCertificateAliases();
|
||||||
|
if (caCerts == null) {
|
||||||
|
- setSelection(mEapCaCertSpinner, mUnspecifiedCertString);
|
||||||
|
+ setSelection(mEapCaCertSpinner, mDoNotValidateEapServerString);
|
||||||
|
} else if (caCerts.length == 1) {
|
||||||
|
setSelection(mEapCaCertSpinner, caCerts[0]);
|
||||||
|
} else {
|
||||||
|
@@ -1152,7 +1165,7 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
loadCertificates(
|
||||||
|
mEapCaCertSpinner,
|
||||||
|
androidKeystoreAliasLoader.getCaCertAliases(),
|
||||||
|
- null /* noCertificateString */,
|
||||||
|
+ mDoNotValidateEapServerString /* noCertificateString */,
|
||||||
|
true /* showMultipleCerts */,
|
||||||
|
true /* showUsePreinstalledCertOption */);
|
||||||
|
setSelection(mEapCaCertSpinner, mMultipleCertSetString);
|
||||||
|
@@ -1285,7 +1298,8 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
|
||||||
|
if (mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
|
||||||
|
String eapCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
|
||||||
|
- if (eapCertSelection.equals(mUnspecifiedCertString)) {
|
||||||
|
+ if (eapCertSelection.equals(mDoNotValidateEapServerString)
|
||||||
|
+ || eapCertSelection.equals(mUnspecifiedCertString)) {
|
||||||
|
// Domain suffix matching is not relevant if the user hasn't chosen a CA
|
||||||
|
// certificate yet, or chooses not to validate the EAP server.
|
||||||
|
setDomainInvisible();
|
||||||
|
@@ -1546,8 +1560,7 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!TextUtils.isEmpty(noCertificateString)
|
||||||
|
- && mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B) {
|
||||||
|
+ if (mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B) {
|
||||||
|
certs.add(noCertificateString);
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/com/android/settings/wifi/WifiConfigController2.java b/src/com/android/settings/wifi/WifiConfigController2.java
|
||||||
|
index ab13405232..01353b38fc 100644
|
||||||
|
--- a/src/com/android/settings/wifi/WifiConfigController2.java
|
||||||
|
+++ b/src/com/android/settings/wifi/WifiConfigController2.java
|
||||||
|
@@ -172,6 +172,7 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
private String mUseSystemCertsString;
|
||||||
|
private String mTrustOnFirstUse;
|
||||||
|
private String mDoNotProvideEapUserCertString;
|
||||||
|
+ private String mDoNotValidateEapServerString;
|
||||||
|
@VisibleForTesting String mInstallCertsString;
|
||||||
|
|
||||||
|
private Spinner mSecuritySpinner;
|
||||||
|
@@ -275,6 +276,8 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
mTrustOnFirstUse = mContext.getString(R.string.wifi_trust_on_first_use);
|
||||||
|
mDoNotProvideEapUserCertString =
|
||||||
|
mContext.getString(R.string.wifi_do_not_provide_eap_user_cert);
|
||||||
|
+ mDoNotValidateEapServerString =
|
||||||
|
+ mContext.getString(R.string.wifi_do_not_validate_eap_server);
|
||||||
|
mInstallCertsString = mContext.getString(R.string.wifi_install_credentials);
|
||||||
|
|
||||||
|
mSsidScanButton = (ImageButton) mView.findViewById(R.id.ssid_scanner_button);
|
||||||
|
@@ -528,7 +531,8 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
// Disallow submit if the user has not selected a CA certificate for an EAP network
|
||||||
|
// configuration.
|
||||||
|
enabled = false;
|
||||||
|
- } else if (mEapDomainView != null
|
||||||
|
+ } else if (!caCertSelection.equals(mDoNotValidateEapServerString)
|
||||||
|
+ && mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
// Disallow submit if the user chooses to use a certificate for EAP server
|
||||||
|
@@ -550,6 +554,7 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
}
|
||||||
|
|
||||||
|
void showWarningMessagesIfAppropriate() {
|
||||||
|
+ mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.GONE);
|
||||||
|
mView.findViewById(R.id.no_user_cert_warning).setVisibility(View.GONE);
|
||||||
|
mView.findViewById(R.id.no_domain_warning).setVisibility(View.GONE);
|
||||||
|
mView.findViewById(R.id.ssid_too_long_warning).setVisibility(View.GONE);
|
||||||
|
@@ -562,7 +567,13 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
}
|
||||||
|
if (mEapCaCertSpinner != null
|
||||||
|
&& mView.findViewById(R.id.l_ca_cert).getVisibility() != View.GONE) {
|
||||||
|
- if (mEapDomainView != null
|
||||||
|
+ String caCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
|
||||||
|
+ if (caCertSelection.equals(mDoNotValidateEapServerString)) {
|
||||||
|
+ // Display warning if user chooses not to validate the EAP server with a
|
||||||
|
+ // user-supplied CA certificate in an EAP network configuration.
|
||||||
|
+ mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.VISIBLE);
|
||||||
|
+ } else if (!caCertSelection.equals(mUnspecifiedCertString)
|
||||||
|
+ && mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
// Display warning if user chooses to use a certificate without restricting the
|
||||||
|
@@ -710,7 +721,8 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
config.enterpriseConfig.setCaCertificateAliases(null);
|
||||||
|
config.enterpriseConfig.setCaPath(null);
|
||||||
|
config.enterpriseConfig.setDomainSuffixMatch(mEapDomainView.getText().toString());
|
||||||
|
- if (caCert.equals(mUnspecifiedCertString)) {
|
||||||
|
+ if (caCert.equals(mUnspecifiedCertString)
|
||||||
|
+ || caCert.equals(mDoNotValidateEapServerString)) {
|
||||||
|
// ca_cert already set to null, so do nothing.
|
||||||
|
} else if (mIsTrustOnFirstUseSupported && caCert.equals(mTrustOnFirstUse)) {
|
||||||
|
config.enterpriseConfig.enableTrustOnFirstUse(true);
|
||||||
|
@@ -745,7 +757,8 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only set OCSP option if there is a valid CA certificate.
|
||||||
|
- if (caCert.equals(mUnspecifiedCertString)) {
|
||||||
|
+ if (caCert.equals(mUnspecifiedCertString)
|
||||||
|
+ || caCert.equals(mDoNotValidateEapServerString)) {
|
||||||
|
config.enterpriseConfig.setOcsp(WifiEnterpriseConfig.OCSP_NONE);
|
||||||
|
} else {
|
||||||
|
config.enterpriseConfig.setOcsp(mEapOcspSpinner.getSelectedItemPosition());
|
||||||
|
@@ -1045,7 +1058,7 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
loadCertificates(
|
||||||
|
mEapCaCertSpinner,
|
||||||
|
androidKeystoreAliasLoader.getCaCertAliases(),
|
||||||
|
- null /* noCertificateString */,
|
||||||
|
+ mDoNotValidateEapServerString /* noCertificateString */,
|
||||||
|
false /* showMultipleCerts */,
|
||||||
|
true /* showUsePreinstalledCertOption */);
|
||||||
|
loadCertificates(
|
||||||
|
@@ -1131,7 +1144,7 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
&& enterpriseConfig.isTrustOnFirstUseEnabled()) {
|
||||||
|
setSelection(mEapCaCertSpinner, mTrustOnFirstUse);
|
||||||
|
} else {
|
||||||
|
- setSelection(mEapCaCertSpinner, mUnspecifiedCertString);
|
||||||
|
+ setSelection(mEapCaCertSpinner, mDoNotValidateEapServerString);
|
||||||
|
}
|
||||||
|
} else if (caCerts.length == 1) {
|
||||||
|
setSelection(mEapCaCertSpinner, caCerts[0]);
|
||||||
|
@@ -1142,7 +1155,7 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
loadCertificates(
|
||||||
|
mEapCaCertSpinner,
|
||||||
|
androidKeystoreAliasLoader.getCaCertAliases(),
|
||||||
|
- null /* noCertificateString */,
|
||||||
|
+ mDoNotValidateEapServerString /* noCertificateString */,
|
||||||
|
true /* showMultipleCerts */,
|
||||||
|
true /* showUsePreinstalledCertOption */);
|
||||||
|
setSelection(mEapCaCertSpinner, mMultipleCertSetString);
|
||||||
|
@@ -1277,7 +1290,8 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
String eapCertSelection = (String) mEapCaCertSpinner.getSelectedItem();
|
||||||
|
if (eapCertSelection.equals(mUnspecifiedCertString)
|
||||||
|
|| (mIsTrustOnFirstUseSupported
|
||||||
|
- && eapCertSelection.equals(mTrustOnFirstUse))) {
|
||||||
|
+ && eapCertSelection.equals(mTrustOnFirstUse))
|
||||||
|
+ || eapCertSelection.equals(mUnspecifiedCertString)) {
|
||||||
|
// Domain suffix matching is not relevant if the user hasn't chosen a CA
|
||||||
|
// certificate yet, or chooses not to validate the EAP server.
|
||||||
|
setDomainInvisible();
|
||||||
|
@@ -1550,8 +1564,7 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!TextUtils.isEmpty(noCertificateString)
|
||||||
|
- && mWifiEntrySecurity != WifiEntry.SECURITY_EAP_SUITE_B) {
|
||||||
|
+ if (mWifiEntrySecurity != WifiEntry.SECURITY_EAP_SUITE_B) {
|
||||||
|
certs.add(noCertificateString);
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
-360
@@ -1,360 +0,0 @@
|
|||||||
From 67b3720b1972d7290e93a9369b9a319583bba482 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Thu, 22 Sep 2022 12:37:50 +0000
|
|
||||||
Subject: [PATCH 1/8] TrebleSettings: Screen resolution & refresh rate
|
|
||||||
|
|
||||||
Change-Id: I4a4679cdb6d4ede55479e9ab2f014342025b0fec
|
|
||||||
---
|
|
||||||
AndroidManifest.xml | 8 +
|
|
||||||
res/drawable/ic_settings_treble.xml | 10 +
|
|
||||||
res/values/menu_keys.xml | 1 +
|
|
||||||
res/values/strings.xml | 10 +
|
|
||||||
res/xml/top_level_settings.xml | 9 +
|
|
||||||
res/xml/treble_settings.xml | 18 ++
|
|
||||||
...lutionRefreshRatePreferenceController.java | 173 ++++++++++++++++++
|
|
||||||
.../settings/treble/TrebleSettings.java | 39 ++++
|
|
||||||
8 files changed, 268 insertions(+)
|
|
||||||
create mode 100644 res/drawable/ic_settings_treble.xml
|
|
||||||
create mode 100644 res/xml/treble_settings.xml
|
|
||||||
create mode 100644 src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java
|
|
||||||
create mode 100644 src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
|
|
||||||
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
|
|
||||||
index 80e0f4b61b..6b138b1f60 100644
|
|
||||||
--- a/AndroidManifest.xml
|
|
||||||
+++ b/AndroidManifest.xml
|
|
||||||
@@ -223,6 +223,14 @@
|
|
||||||
android:value="com.android.settings.shortcut.CreateShortcut" />
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
+ <receiver
|
|
||||||
+ android:name=".treble.ScreenResolutionRefreshRatePreferenceController$BootReceiver"
|
|
||||||
+ android:exported="true">
|
|
||||||
+ <intent-filter>
|
|
||||||
+ <action android:name="android.intent.action.BOOT_COMPLETED"/>
|
|
||||||
+ </intent-filter>
|
|
||||||
+ </receiver>
|
|
||||||
+
|
|
||||||
<!-- Wireless Controls -->
|
|
||||||
<activity
|
|
||||||
android:name=".Settings$NetworkDashboardActivity"
|
|
||||||
diff --git a/res/drawable/ic_settings_treble.xml b/res/drawable/ic_settings_treble.xml
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..3c56ed7032
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/res/drawable/ic_settings_treble.xml
|
|
||||||
@@ -0,0 +1,10 @@
|
|
||||||
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
+ android:width="24dp"
|
|
||||||
+ android:height="24dp"
|
|
||||||
+ android:viewportWidth="24.0"
|
|
||||||
+ android:viewportHeight="24.0"
|
|
||||||
+ android:tint="?attr/colorControlNormal">
|
|
||||||
+ <path
|
|
||||||
+ android:fillColor="@android:color/white"
|
|
||||||
+ android:pathData="M10.82 12.49c.02-.16.04-.32.04-.49 0-.17-.02-.33-.04-.49l1.08-.82c.1-.07.12-.21.06-.32l-1.03-1.73c-.06-.11-.2-.15-.31-.11l-1.28.5c-.27-.2-.56-.36-.87-.49l-.2-1.33c0-.12-.11-.21-.24-.21H5.98c-.13 0-.24.09-.26.21l-.2 1.32c-.31.12-.6.3-.87.49l-1.28-.5c-.12-.05-.25 0-.31.11l-1.03 1.73c-.06.12-.03.25.07.33l1.08.82c-.02.16-.03.33-.03.49 0 .17.02.33.04.49l-1.09.83c-.1.07-.12.21-.06.32l1.03 1.73c.06.11.2.15.31.11l1.28-.5c.27.2.56.36.87.49l.2 1.32c.01.12.12.21.25.21h2.06c.13 0 .24-.09.25-.21l.2-1.32c.31-.12.6-.3.87-.49l1.28.5c.12.05.25 0 .31-.11l1.03-1.73c.06-.11.04-.24-.06-.32l-1.1-.83zM7 13.75c-.99 0-1.8-.78-1.8-1.75s.81-1.75 1.8-1.75 1.8.78 1.8 1.75S8 13.75 7 13.75zM18 1.01L8 1c-1.1 0-2 .9-2 2v3h2V5h10v14H8v-1H6v3c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99z"/>
|
|
||||||
+</vector>
|
|
||||||
diff --git a/res/values/menu_keys.xml b/res/values/menu_keys.xml
|
|
||||||
index 27e9639122..ef25f9971c 100755
|
|
||||||
--- a/res/values/menu_keys.xml
|
|
||||||
+++ b/res/values/menu_keys.xml
|
|
||||||
@@ -16,6 +16,7 @@
|
|
||||||
|
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
|
||||||
|
|
||||||
+ <string name="menu_key_treble" translatable="false">top_level_treble</string>
|
|
||||||
<string name="menu_key_network" translatable="false">top_level_network</string>
|
|
||||||
<string name="menu_key_communal" translatable="false">top_level_communal</string>
|
|
||||||
<string name="menu_key_connected_devices" translatable="false">top_level_connected_devices</string>
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index d8a2c3b41c..ae520f9c64 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8498,6 +8498,16 @@
|
|
||||||
<item quantity="other">Show %d hidden items</item>
|
|
||||||
</plurals>
|
|
||||||
|
|
||||||
+ <!-- Title for setting tile leading to Treble settings [CHAR LIMIT=40]-->
|
|
||||||
+ <string name="treble_settings">Treble settings</string>
|
|
||||||
+ <!-- Summary for Treble settings [CHAR LIMIT=NONE]-->
|
|
||||||
+ <string name="treble_settings_summary">Fixes & tweaks for GSIs</string>
|
|
||||||
+ <!-- Display category name [CHAR LIMIT=none] -->
|
|
||||||
+ <string name="treble_settings_category_name_display">Display</string>
|
|
||||||
+
|
|
||||||
+ <!-- Treble settings screen, screen resolution and refresh rate settings title -->
|
|
||||||
+ <string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
|
||||||
+
|
|
||||||
<!-- Title for setting tile leading to network and Internet settings [CHAR LIMIT=40]-->
|
|
||||||
<string name="network_dashboard_title">Network & internet</string>
|
|
||||||
<!-- Summary for Network and Internet settings, explaining it contains mobile, wifi setting and data usage settings [CHAR LIMIT=NONE]-->
|
|
||||||
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
|
|
||||||
index 8c82b67168..04f763514e 100644
|
|
||||||
--- a/res/xml/top_level_settings.xml
|
|
||||||
+++ b/res/xml/top_level_settings.xml
|
|
||||||
@@ -20,6 +20,15 @@
|
|
||||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:key="top_level_settings">
|
|
||||||
|
|
||||||
+ <com.android.settings.widget.HomepagePreference
|
|
||||||
+ android:fragment="com.android.settings.treble.TrebleSettings"
|
|
||||||
+ android:icon="@drawable/ic_settings_treble"
|
|
||||||
+ android:key="top_level_treble"
|
|
||||||
+ android:order="-160"
|
|
||||||
+ android:title="@string/treble_settings"
|
|
||||||
+ android:summary="@string/treble_settings_summary"
|
|
||||||
+ settings:highlightableMenuKey="@string/menu_key_treble"/>
|
|
||||||
+
|
|
||||||
<com.android.settings.widget.HomepagePreference
|
|
||||||
android:fragment="com.android.settings.network.NetworkDashboardFragment"
|
|
||||||
android:icon="@drawable/ic_settings_wireless"
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..1a82c468a2
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -0,0 +1,18 @@
|
|
||||||
+<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
+
|
|
||||||
+<PreferenceScreen
|
|
||||||
+ xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
|
|
||||||
+ android:key="treble_settings_screen"
|
|
||||||
+ android:title="@string/treble_settings">
|
|
||||||
+
|
|
||||||
+ <PreferenceCategory
|
|
||||||
+ android:title="@string/treble_settings_category_name_display">
|
|
||||||
+
|
|
||||||
+ <ListPreference
|
|
||||||
+ android:key="screen_resolution_refresh_rate"
|
|
||||||
+ android:title="@string/screen_resolution_refresh_rate_title" />
|
|
||||||
+
|
|
||||||
+ </PreferenceCategory>
|
|
||||||
+
|
|
||||||
+</PreferenceScreen>
|
|
||||||
diff --git a/src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java b/src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..35d67f2da1
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/ScreenResolutionRefreshRatePreferenceController.java
|
|
||||||
@@ -0,0 +1,173 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import static android.content.Intent.ACTION_BOOT_COMPLETED;
|
|
||||||
+
|
|
||||||
+import android.app.ActivityManager;
|
|
||||||
+import android.content.BroadcastReceiver;
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.content.Intent;
|
|
||||||
+import android.os.IBinder;
|
|
||||||
+import android.os.Parcel;
|
|
||||||
+import android.os.RemoteException;
|
|
||||||
+import android.os.ServiceManager;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+import android.view.SurfaceControl;
|
|
||||||
+import android.view.SurfaceControl.DisplayMode;
|
|
||||||
+
|
|
||||||
+import androidx.preference.ListPreference;
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+import java.util.ArrayList;
|
|
||||||
+import java.util.Collections;
|
|
||||||
+import java.util.Comparator;
|
|
||||||
+import java.util.HashSet;
|
|
||||||
+import java.util.List;
|
|
||||||
+import java.util.Set;
|
|
||||||
+
|
|
||||||
+public class ScreenResolutionRefreshRatePreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String SCREEN_RESOLUTION_REFRESH_RATE_KEY = "screen_resolution_refresh_rate";
|
|
||||||
+ private static final String SURFACE_FLINGER_SERVICE_KEY = "SurfaceFlinger";
|
|
||||||
+ private static final String SURFACE_COMPOSER_INTERFACE_KEY = "android.ui.ISurfaceComposer";
|
|
||||||
+ private static final int SURFACE_FLINGER_CODE = 1035;
|
|
||||||
+ private static final String TREBLE_DISPLAY_MODE_PROPERTY = "persist.sys.treble.display_mode";
|
|
||||||
+ private static final String SYSTEMUI_PACKAGE_NAME = "com.android.systemui";
|
|
||||||
+
|
|
||||||
+ private ActivityManager mAm;
|
|
||||||
+ private ListPreference mListPreference;
|
|
||||||
+ private List<DisplayMode> mModes = new ArrayList<>();
|
|
||||||
+ private List<String> mEntries = new ArrayList<>();
|
|
||||||
+ private List<String> mValues = new ArrayList<>();
|
|
||||||
+
|
|
||||||
+ public ScreenResolutionRefreshRatePreferenceController(Context context) {
|
|
||||||
+ super(context, SCREEN_RESOLUTION_REFRESH_RATE_KEY);
|
|
||||||
+
|
|
||||||
+ mAm = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
|
||||||
+
|
|
||||||
+ DisplayMode[] supportedDisplayModes =
|
|
||||||
+ SurfaceControl.getDynamicDisplayInfo(SurfaceControl.getInternalDisplayToken()).supportedDisplayModes;
|
|
||||||
+ Set<String> summarySet = new HashSet<>();
|
|
||||||
+ for (DisplayMode m : supportedDisplayModes) {
|
|
||||||
+ String summary = String.format("%dx%d @ %dHz", m.width, m.height, Math.round(m.refreshRate));
|
|
||||||
+ if (!summarySet.contains(summary)) {
|
|
||||||
+ summarySet.add(summary);
|
|
||||||
+ mModes.add(m);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ Collections.sort(mModes, Comparator.comparing((DisplayMode m)->m.width)
|
|
||||||
+ .thenComparing(m->m.height)
|
|
||||||
+ .thenComparing(m->m.refreshRate)
|
|
||||||
+ .thenComparing(m->m.id));
|
|
||||||
+ for (DisplayMode m : mModes) {
|
|
||||||
+ String summary = String.format("%dx%d @ %dHz", m.width, m.height, Math.round(m.refreshRate));
|
|
||||||
+ mEntries.add(summary);
|
|
||||||
+ mValues.add(String.valueOf(m.id));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return SCREEN_RESOLUTION_REFRESH_RATE_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mListPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ mListPreference.setEntries(mEntries.toArray(new String[mEntries.size()]));
|
|
||||||
+ mListPreference.setEntryValues(mValues.toArray(new String[mValues.size()]));
|
|
||||||
+
|
|
||||||
+ if (mEntries.size() <= 1) {
|
|
||||||
+ mListPreference.setEnabled(false);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ int id = SurfaceControl.getDynamicDisplayInfo(SurfaceControl.getInternalDisplayToken()).activeDisplayModeId;
|
|
||||||
+ int index = mListPreference.findIndexOfValue(String.valueOf(id));
|
|
||||||
+ try {
|
|
||||||
+ mListPreference.setValueIndex(index);
|
|
||||||
+ mListPreference.setSummary(mListPreference.getEntries()[index]);
|
|
||||||
+ } catch (ArrayIndexOutOfBoundsException e) {
|
|
||||||
+ e.printStackTrace();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ DisplayMode currentMode = getCurrentMode();
|
|
||||||
+ int id = Integer.valueOf((String) newValue);
|
|
||||||
+ DisplayMode newMode = getModeById(id);
|
|
||||||
+ setModeFromBackdoor(id);
|
|
||||||
+ SystemProperties.set(TREBLE_DISPLAY_MODE_PROPERTY, (String) newValue);
|
|
||||||
+ int index = mListPreference.findIndexOfValue((String) newValue);
|
|
||||||
+ mListPreference.setValueIndex(index);
|
|
||||||
+ mListPreference.setSummary(mListPreference.getEntries()[index]);
|
|
||||||
+ if ((newMode.width != currentMode.width) || (newMode.height != currentMode.height)) {
|
|
||||||
+ try {
|
|
||||||
+ for (ActivityManager.RunningAppProcessInfo app: mAm.getRunningAppProcesses()) {
|
|
||||||
+ if (app.processName.equals(SYSTEMUI_PACKAGE_NAME)) {
|
|
||||||
+ ActivityManager.getService().killApplicationProcess(app.processName, app.uid);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } catch (Exception e) {
|
|
||||||
+ e.printStackTrace();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private DisplayMode getCurrentMode() {
|
|
||||||
+ int id = SurfaceControl.getDynamicDisplayInfo(SurfaceControl.getInternalDisplayToken()).activeDisplayModeId;
|
|
||||||
+ return getModeById(id);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private DisplayMode getModeById(int id) {
|
|
||||||
+ for (DisplayMode m : mModes) {
|
|
||||||
+ if (m.id == id) {
|
|
||||||
+ return m;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void setModeFromBackdoor(int id) {
|
|
||||||
+ IBinder surfaceFlinger = ServiceManager.getService(SURFACE_FLINGER_SERVICE_KEY);
|
|
||||||
+ try {
|
|
||||||
+ if (surfaceFlinger != null) {
|
|
||||||
+ Parcel data = Parcel.obtain();
|
|
||||||
+ data.writeInterfaceToken(SURFACE_COMPOSER_INTERFACE_KEY);
|
|
||||||
+ data.writeInt(id);
|
|
||||||
+ surfaceFlinger.transact(SURFACE_FLINGER_CODE, data, null, 0);
|
|
||||||
+ data.recycle();
|
|
||||||
+ }
|
|
||||||
+ } catch (RemoteException ex) {}
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static class BootReceiver extends BroadcastReceiver {
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void onReceive(Context context, Intent intent) {
|
|
||||||
+ if (ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
|
||||||
+ int id = SystemProperties.getInt(TREBLE_DISPLAY_MODE_PROPERTY, -1);
|
|
||||||
+ if (id != -1) {
|
|
||||||
+ setModeFromBackdoor(id);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..e581539229
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -0,0 +1,39 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.app.settings.SettingsEnums;
|
|
||||||
+import android.content.Context;
|
|
||||||
+
|
|
||||||
+import com.android.settings.R;
|
|
||||||
+import com.android.settings.dashboard.DashboardFragment;
|
|
||||||
+import com.android.settingslib.core.AbstractPreferenceController;
|
|
||||||
+
|
|
||||||
+import java.util.ArrayList;
|
|
||||||
+import java.util.List;
|
|
||||||
+
|
|
||||||
+public class TrebleSettings extends DashboardFragment {
|
|
||||||
+
|
|
||||||
+ private static final String TAG = "TrebleSettings";
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ protected int getPreferenceScreenResId() {
|
|
||||||
+ return R.xml.treble_settings;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ protected String getLogTag() {
|
|
||||||
+ return TAG;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getMetricsCategory() {
|
|
||||||
+ return SettingsEnums.SETTINGS_TREBLE_CATEGORY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
|
||||||
+ final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
|
||||||
+ controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
|
||||||
+ return controllers;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
+191
@@ -0,0 +1,191 @@
|
|||||||
|
From f6313909d7124630fc1146b72d847f19a026dcf6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Fri, 16 Feb 2024 22:06:59 +0800
|
||||||
|
Subject: [PATCH 2/2] Revert "[Wi-Fi] Check if domain field is not empty when
|
||||||
|
users choose a ca certificate"
|
||||||
|
|
||||||
|
This reverts commit 8d5c8c2611adadbd5baf81d8157871005ff87497.
|
||||||
|
---
|
||||||
|
.../settings/wifi/WifiConfigController.java | 16 +++++-----
|
||||||
|
.../settings/wifi/WifiConfigController2.java | 16 +++++-----
|
||||||
|
.../wifi/WifiConfigController2Test.java | 29 -------------------
|
||||||
|
.../wifi/WifiConfigControllerTest.java | 29 -------------------
|
||||||
|
4 files changed, 18 insertions(+), 72 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
|
||||||
|
index 306576d102..53053c28ad 100644
|
||||||
|
--- a/src/com/android/settings/wifi/WifiConfigController.java
|
||||||
|
+++ b/src/com/android/settings/wifi/WifiConfigController.java
|
||||||
|
@@ -547,11 +547,12 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
// Disallow submit if the user has not selected a CA certificate for an EAP network
|
||||||
|
// configuration.
|
||||||
|
enabled = false;
|
||||||
|
- } else if (!caCertSelection.equals(mDoNotValidateEapServerString)
|
||||||
|
+ }
|
||||||
|
+ if (caCertSelection.equals(mUseSystemCertsString)
|
||||||
|
&& mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
- // Disallow submit if the user chooses to use a certificate for EAP server
|
||||||
|
+ // Disallow submit if the user chooses to use system certificates for EAP server
|
||||||
|
// validation, but does not provide a domain.
|
||||||
|
enabled = false;
|
||||||
|
}
|
||||||
|
@@ -588,12 +589,14 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
// Display warning if user chooses not to validate the EAP server with a
|
||||||
|
// user-supplied CA certificate in an EAP network configuration.
|
||||||
|
mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.VISIBLE);
|
||||||
|
- } else if (!caCertSelection.equals(mUnspecifiedCertString)
|
||||||
|
+ }
|
||||||
|
+ if (caCertSelection.equals(mUseSystemCertsString)
|
||||||
|
&& mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
- // Display warning if user chooses to use a certificate without restricting the
|
||||||
|
- // server domain that these certificates can be used to validate.
|
||||||
|
+ // Display warning if user chooses to use pre-installed public CA certificates
|
||||||
|
+ // without restricting the server domain that these certificates can be used to
|
||||||
|
+ // validate.
|
||||||
|
mView.findViewById(R.id.no_domain_warning).setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1793,8 +1796,7 @@ public class WifiConfigController implements TextWatcher,
|
||||||
|
mContext.getResources().getStringArray(contentStringArrayResId));
|
||||||
|
}
|
||||||
|
|
||||||
|
- @VisibleForTesting
|
||||||
|
- ArrayAdapter<CharSequence> getSpinnerAdapter(
|
||||||
|
+ private ArrayAdapter<CharSequence> getSpinnerAdapter(
|
||||||
|
String[] contentStringArray) {
|
||||||
|
ArrayAdapter<CharSequence> spinnerAdapter = new ArrayAdapter<>(mContext,
|
||||||
|
android.R.layout.simple_spinner_item, contentStringArray);
|
||||||
|
diff --git a/src/com/android/settings/wifi/WifiConfigController2.java b/src/com/android/settings/wifi/WifiConfigController2.java
|
||||||
|
index 01353b38fc..b08315c0f5 100644
|
||||||
|
--- a/src/com/android/settings/wifi/WifiConfigController2.java
|
||||||
|
+++ b/src/com/android/settings/wifi/WifiConfigController2.java
|
||||||
|
@@ -531,11 +531,12 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
// Disallow submit if the user has not selected a CA certificate for an EAP network
|
||||||
|
// configuration.
|
||||||
|
enabled = false;
|
||||||
|
- } else if (!caCertSelection.equals(mDoNotValidateEapServerString)
|
||||||
|
+ }
|
||||||
|
+ if (caCertSelection.equals(mUseSystemCertsString)
|
||||||
|
&& mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
- // Disallow submit if the user chooses to use a certificate for EAP server
|
||||||
|
+ // Disallow submit if the user chooses to use system certificates for EAP server
|
||||||
|
// validation, but does not provide a domain.
|
||||||
|
enabled = false;
|
||||||
|
}
|
||||||
|
@@ -572,12 +573,14 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
// Display warning if user chooses not to validate the EAP server with a
|
||||||
|
// user-supplied CA certificate in an EAP network configuration.
|
||||||
|
mView.findViewById(R.id.no_ca_cert_warning).setVisibility(View.VISIBLE);
|
||||||
|
- } else if (!caCertSelection.equals(mUnspecifiedCertString)
|
||||||
|
+ }
|
||||||
|
+ if (caCertSelection.equals(mUseSystemCertsString)
|
||||||
|
&& mEapDomainView != null
|
||||||
|
&& mView.findViewById(R.id.l_domain).getVisibility() != View.GONE
|
||||||
|
&& TextUtils.isEmpty(mEapDomainView.getText().toString())) {
|
||||||
|
- // Display warning if user chooses to use a certificate without restricting the
|
||||||
|
- // server domain that these certificates can be used to validate.
|
||||||
|
+ // Display warning if user chooses to use pre-installed public CA certificates
|
||||||
|
+ // without restricting the server domain that these certificates can be used to
|
||||||
|
+ // validate.
|
||||||
|
mView.findViewById(R.id.no_domain_warning).setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1858,8 +1861,7 @@ public class WifiConfigController2 implements TextWatcher,
|
||||||
|
mContext.getResources().getStringArray(contentStringArrayResId));
|
||||||
|
}
|
||||||
|
|
||||||
|
- @VisibleForTesting
|
||||||
|
- ArrayAdapter<CharSequence> getSpinnerAdapter(
|
||||||
|
+ private ArrayAdapter<CharSequence> getSpinnerAdapter(
|
||||||
|
String[] contentStringArray) {
|
||||||
|
ArrayAdapter<CharSequence> spinnerAdapter = new ArrayAdapter<>(mContext,
|
||||||
|
android.R.layout.simple_spinner_item, contentStringArray);
|
||||||
|
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java
|
||||||
|
index 9139a285e1..d2de325d00 100644
|
||||||
|
--- a/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java
|
||||||
|
+++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigController2Test.java
|
||||||
|
@@ -269,35 +269,6 @@ public class WifiConfigController2Test {
|
||||||
|
assertThat(mController.isSubmittable()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
- @Test
|
||||||
|
- public void isSubmittable_caCertWithoutDomain_shouldReturnFalse() {
|
||||||
|
- when(mWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
|
||||||
|
- mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
|
||||||
|
- WifiConfigUiBase2.MODE_CONNECT);
|
||||||
|
- mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
|
||||||
|
- final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
|
||||||
|
- eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
|
||||||
|
- eapCaCertSpinner.setSelection(0);
|
||||||
|
- mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
|
||||||
|
-
|
||||||
|
- assertThat(mController.isSubmittable()).isFalse();
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Test
|
||||||
|
- public void isSubmittable_caCertWithDomain_shouldReturnTrue() {
|
||||||
|
- when(mWifiEntry.getSecurity()).thenReturn(WifiEntry.SECURITY_EAP);
|
||||||
|
- mController = new TestWifiConfigController2(mConfigUiBase, mView, mWifiEntry,
|
||||||
|
- WifiConfigUiBase2.MODE_CONNECT);
|
||||||
|
- mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
|
||||||
|
- final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
|
||||||
|
- eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
|
||||||
|
- eapCaCertSpinner.setSelection(0);
|
||||||
|
- mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
|
||||||
|
- ((TextView) mView.findViewById(R.id.domain)).setText("fakeDomain");
|
||||||
|
-
|
||||||
|
- assertThat(mController.isSubmittable()).isTrue();
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
@Test
|
||||||
|
public void getSignalString_notReachable_shouldHaveNoSignalString() {
|
||||||
|
when(mWifiEntry.getLevel()).thenReturn(WifiEntry.WIFI_LEVEL_UNREACHABLE);
|
||||||
|
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
|
||||||
|
index 8ecbaf64b1..a8fde6dd29 100644
|
||||||
|
--- a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
|
||||||
|
+++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
|
||||||
|
@@ -228,35 +228,6 @@ public class WifiConfigControllerTest {
|
||||||
|
assertThat(mController.isSubmittable()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
- @Test
|
||||||
|
- public void isSubmittable_caCertWithoutDomain_shouldReturnFalse() {
|
||||||
|
- when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
|
||||||
|
- mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
|
||||||
|
- WifiConfigUiBase.MODE_CONNECT);
|
||||||
|
- mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
|
||||||
|
- final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
|
||||||
|
- eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
|
||||||
|
- eapCaCertSpinner.setSelection(0);
|
||||||
|
- mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
|
||||||
|
-
|
||||||
|
- assertThat(mController.isSubmittable()).isFalse();
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Test
|
||||||
|
- public void isSubmittable_caCertWithDomain_shouldReturnTrue() {
|
||||||
|
- when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_EAP);
|
||||||
|
- mController = new TestWifiConfigController(mConfigUiBase, mView, mAccessPoint,
|
||||||
|
- WifiConfigUiBase.MODE_CONNECT);
|
||||||
|
- mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
|
||||||
|
- final Spinner eapCaCertSpinner = mView.findViewById(R.id.ca_cert);
|
||||||
|
- eapCaCertSpinner.setAdapter(mController.getSpinnerAdapter(new String[]{"certificate"}));
|
||||||
|
- eapCaCertSpinner.setSelection(0);
|
||||||
|
- mView.findViewById(R.id.l_domain).setVisibility(View.VISIBLE);
|
||||||
|
- ((TextView) mView.findViewById(R.id.domain)).setText("fakeDomain");
|
||||||
|
-
|
||||||
|
- assertThat(mController.isSubmittable()).isTrue();
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
@Test
|
||||||
|
public void getSignalString_notReachable_shouldHaveNoSignalString() {
|
||||||
|
when(mAccessPoint.isReachable()).thenReturn(false);
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
-288
@@ -1,288 +0,0 @@
|
|||||||
From 5e8b0836fb7eff4ea034ce5b9981ce9e9971ec4b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 24 Sep 2022 03:38:41 +0000
|
|
||||||
Subject: [PATCH 2/8] TrebleSettings: Basic audio and display fixes
|
|
||||||
|
|
||||||
- Alternative audio policy
|
|
||||||
- Disable soundvolume effect
|
|
||||||
- Alternative backlight scale
|
|
||||||
|
|
||||||
Change-Id: I4f22dcd9c59c40b3fd70ba642db35b9466467b7d
|
|
||||||
---
|
|
||||||
res/values/strings.xml | 8 +++
|
|
||||||
res/xml/treble_settings.xml | 17 ++++++
|
|
||||||
...SoundvolumeEffectPreferenceController.java | 59 +++++++++++++++++++
|
|
||||||
.../settings/treble/TrebleSettings.java | 3 +
|
|
||||||
...nativeAudioPolicyPreferenceController.java | 59 +++++++++++++++++++
|
|
||||||
...iveBacklightScalePreferenceController.java | 53 +++++++++++++++++
|
|
||||||
6 files changed, 199 insertions(+)
|
|
||||||
create mode 100644 src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java
|
|
||||||
create mode 100644 src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java
|
|
||||||
create mode 100644 src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java
|
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index ae520f9c64..df16c68eab 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8502,11 +8502,19 @@
|
|
||||||
<string name="treble_settings">Treble settings</string>
|
|
||||||
<!-- Summary for Treble settings [CHAR LIMIT=NONE]-->
|
|
||||||
<string name="treble_settings_summary">Fixes & tweaks for GSIs</string>
|
|
||||||
+ <!-- Audio category name [CHAR LIMIT=none] -->
|
|
||||||
+ <string name="treble_settings_category_name_audio">Audio</string>
|
|
||||||
<!-- Display category name [CHAR LIMIT=none] -->
|
|
||||||
<string name="treble_settings_category_name_display">Display</string>
|
|
||||||
|
|
||||||
+ <!-- Treble settings screen, use alternative audio policy title -->
|
|
||||||
+ <string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
|
|
||||||
+ <!-- Treble settings screen, disable soundvolume effect title -->
|
|
||||||
+ <string name="disable_soundvolume_effect_title">Disable soundvolume effect</string>
|
|
||||||
<!-- Treble settings screen, screen resolution and refresh rate settings title -->
|
|
||||||
<string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
|
||||||
+ <!-- Treble settings screen, use alternative backlight scale title -->
|
|
||||||
+ <string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
|
|
||||||
|
|
||||||
<!-- Title for setting tile leading to network and Internet settings [CHAR LIMIT=40]-->
|
|
||||||
<string name="network_dashboard_title">Network & internet</string>
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
index 1a82c468a2..336137c95f 100644
|
|
||||||
--- a/res/xml/treble_settings.xml
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -6,6 +6,19 @@
|
|
||||||
android:key="treble_settings_screen"
|
|
||||||
android:title="@string/treble_settings">
|
|
||||||
|
|
||||||
+ <PreferenceCategory
|
|
||||||
+ android:title="@string/treble_settings_category_name_audio">
|
|
||||||
+
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="use_alternative_audio_policy"
|
|
||||||
+ android:title="@string/use_alternative_audio_policy_title" />
|
|
||||||
+
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="disable_soundvolume_effect"
|
|
||||||
+ android:title="@string/disable_soundvolume_effect_title" />
|
|
||||||
+
|
|
||||||
+ </PreferenceCategory>
|
|
||||||
+
|
|
||||||
<PreferenceCategory
|
|
||||||
android:title="@string/treble_settings_category_name_display">
|
|
||||||
|
|
||||||
@@ -13,6 +26,10 @@
|
|
||||||
android:key="screen_resolution_refresh_rate"
|
|
||||||
android:title="@string/screen_resolution_refresh_rate_title" />
|
|
||||||
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="use_alternative_backlight_scale"
|
|
||||||
+ android:title="@string/use_alternative_backlight_scale_title" />
|
|
||||||
+
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
||||||
diff --git a/src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java b/src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..8feb318f55
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/DisableSoundvolumeEffectPreferenceController.java
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class DisableSoundvolumeEffectPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String DISABLE_SOUNDVOLUME_EFFECT_KEY = "disable_soundvolume_effect";
|
|
||||||
+ private static final String RO_HARDWARE_PROPERTY = "ro.hardware";
|
|
||||||
+ private static final String TREBLE_CAF_DISABLE_SOUNDVOLUME_EFFECT_PROPERTY = "persist.sys.treble.caf.disable_soundvolume_effect";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public DisableSoundvolumeEffectPreferenceController(Context context) {
|
|
||||||
+ super(context, DISABLE_SOUNDVOLUME_EFFECT_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return DISABLE_SOUNDVOLUME_EFFECT_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+
|
|
||||||
+ if (!SystemProperties.get(RO_HARDWARE_PROPERTY, "N/A").equals("qcom")) {
|
|
||||||
+ mSwitchPreference.setEnabled(false);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(TREBLE_CAF_DISABLE_SOUNDVOLUME_EFFECT_PROPERTY, false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(TREBLE_CAF_DISABLE_SOUNDVOLUME_EFFECT_PROPERTY, String.valueOf((boolean) newValue));
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
index e581539229..5c1611c053 100644
|
|
||||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -32,7 +32,10 @@ public class TrebleSettings extends DashboardFragment {
|
|
||||||
@Override
|
|
||||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
|
||||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
|
||||||
+ controllers.add(new UseAlternativeAudioPolicyPreferenceController(context));
|
|
||||||
+ controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
|
||||||
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
|
||||||
+ controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
|
||||||
return controllers;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java b/src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..fbc327cba0
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/UseAlternativeAudioPolicyPreferenceController.java
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class UseAlternativeAudioPolicyPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String USE_ALTERNATIVE_AUDIO_POLICY_KEY = "use_alternative_audio_policy";
|
|
||||||
+ private static final String RO_HARDWARE_PROPERTY = "ro.hardware";
|
|
||||||
+ private static final String TREBLE_CAF_AUDIO_POLICY_PROPERTY = "persist.sys.treble.caf.audio_policy";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public UseAlternativeAudioPolicyPreferenceController(Context context) {
|
|
||||||
+ super(context, USE_ALTERNATIVE_AUDIO_POLICY_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return USE_ALTERNATIVE_AUDIO_POLICY_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+
|
|
||||||
+ if (!SystemProperties.get(RO_HARDWARE_PROPERTY, "N/A").equals("qcom")) {
|
|
||||||
+ mSwitchPreference.setEnabled(false);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(TREBLE_CAF_AUDIO_POLICY_PROPERTY, false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(TREBLE_CAF_AUDIO_POLICY_PROPERTY, String.valueOf((boolean) newValue));
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java b/src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..bd9de82d90
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/UseAlternativeBacklightScalePreferenceController.java
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class UseAlternativeBacklightScalePreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String USE_ALTERNATIVE_BACKLIGHT_SCALE_KEY = "use_alternative_backlight_scale";
|
|
||||||
+ private static final String TREBLE_BACKLIGHT_SCALE_PROPERTY = "persist.sys.treble.backlight_scale";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public UseAlternativeBacklightScalePreferenceController(Context context) {
|
|
||||||
+ super(context, USE_ALTERNATIVE_BACKLIGHT_SCALE_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return USE_ALTERNATIVE_BACKLIGHT_SCALE_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(TREBLE_BACKLIGHT_SCALE_PROPERTY, false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(TREBLE_BACKLIGHT_SCALE_PROPERTY, String.valueOf((boolean) newValue));
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -1,390 +0,0 @@
|
|||||||
From 25ef7392032f02607cbaab2165927d4c3f45368f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Tue, 11 Oct 2022 10:29:36 +0000
|
|
||||||
Subject: [PATCH 3/8] TrebleSettings: IMS
|
|
||||||
|
|
||||||
Change-Id: Id7a12e150d4a3dc988f8ce1a888ad88443fa0ea4
|
|
||||||
---
|
|
||||||
Android.bp | 1 +
|
|
||||||
res/values/strings.xml | 9 +
|
|
||||||
res/xml/treble_settings.xml | 13 +
|
|
||||||
.../InstallImsApkPreferenceController.java | 225 ++++++++++++++++++
|
|
||||||
...VolteAvailabilityPreferenceController.java | 59 +++++
|
|
||||||
.../settings/treble/TrebleSettings.java | 2 +
|
|
||||||
6 files changed, 309 insertions(+)
|
|
||||||
create mode 100644 src/com/android/settings/treble/InstallImsApkPreferenceController.java
|
|
||||||
create mode 100644 src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java
|
|
||||||
|
|
||||||
diff --git a/Android.bp b/Android.bp
|
|
||||||
index 0307ccbf82..748b62f520 100644
|
|
||||||
--- a/Android.bp
|
|
||||||
+++ b/Android.bp
|
|
||||||
@@ -93,6 +93,7 @@ android_library {
|
|
||||||
"LineagePreferenceLib",
|
|
||||||
"vendor.lineage.fastcharge-V1.0-java",
|
|
||||||
"SystemUISharedLib",
|
|
||||||
+ "android.hidl.manager-V1.0-java",
|
|
||||||
],
|
|
||||||
|
|
||||||
libs: [
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index df16c68eab..eef415cc89 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8506,6 +8506,8 @@
|
|
||||||
<string name="treble_settings_category_name_audio">Audio</string>
|
|
||||||
<!-- Display category name [CHAR LIMIT=none] -->
|
|
||||||
<string name="treble_settings_category_name_display">Display</string>
|
|
||||||
+ <!-- IMS category name [CHAR LIMIT=none] -->
|
|
||||||
+ <string name="treble_settings_category_name_ims">IMS</string>
|
|
||||||
|
|
||||||
<!-- Treble settings screen, use alternative audio policy title -->
|
|
||||||
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
|
|
||||||
@@ -8515,6 +8517,13 @@
|
|
||||||
<string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
|
||||||
<!-- Treble settings screen, use alternative backlight scale title -->
|
|
||||||
<string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
|
|
||||||
+ <!-- Treble settings screen, install IMS APK title -->
|
|
||||||
+ <string name="install_ims_apk_title">Install IMS APK</string>
|
|
||||||
+ <!-- Treble settings screen, install IMS APK toasts -->
|
|
||||||
+ <string name="install_ims_apk_toast_downloading">Downloading IMS APK...</string>
|
|
||||||
+ <string name="install_ims_apk_toast_completed">IMS APK installed. Reboot required.</string>
|
|
||||||
+ <!-- Treble settings screen, override VoLTE availability title -->
|
|
||||||
+ <string name="override_volte_availability_title">Override VoLTE availability</string>
|
|
||||||
|
|
||||||
<!-- Title for setting tile leading to network and Internet settings [CHAR LIMIT=40]-->
|
|
||||||
<string name="network_dashboard_title">Network & internet</string>
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
index 336137c95f..09e6bc5d00 100644
|
|
||||||
--- a/res/xml/treble_settings.xml
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -32,4 +32,17 @@
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
+ <PreferenceCategory
|
|
||||||
+ android:title="@string/treble_settings_category_name_ims">
|
|
||||||
+
|
|
||||||
+ <Preference
|
|
||||||
+ android:key="install_ims_apk"
|
|
||||||
+ android:title="@string/install_ims_apk_title" />
|
|
||||||
+
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="override_volte_availability"
|
|
||||||
+ android:title="@string/override_volte_availability_title" />
|
|
||||||
+
|
|
||||||
+ </PreferenceCategory>
|
|
||||||
+
|
|
||||||
</PreferenceScreen>
|
|
||||||
diff --git a/src/com/android/settings/treble/InstallImsApkPreferenceController.java b/src/com/android/settings/treble/InstallImsApkPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..e5ec05a820
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/InstallImsApkPreferenceController.java
|
|
||||||
@@ -0,0 +1,225 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.app.DownloadManager;
|
|
||||||
+import android.app.PendingIntent;
|
|
||||||
+import android.content.BroadcastReceiver;
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.content.Intent;
|
|
||||||
+import android.content.IntentFilter;
|
|
||||||
+import android.content.pm.PackageInstaller;
|
|
||||||
+import android.database.Cursor;
|
|
||||||
+import android.hidl.manager.V1_0.IServiceManager;
|
|
||||||
+import android.net.Uri;
|
|
||||||
+import android.os.Environment;
|
|
||||||
+import android.os.RemoteException;
|
|
||||||
+import android.os.ServiceManager;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+import android.util.Log;
|
|
||||||
+import android.widget.Toast;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+
|
|
||||||
+import com.android.settings.R;
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+import java.io.File;
|
|
||||||
+import java.io.FileInputStream;
|
|
||||||
+import java.io.IOException;
|
|
||||||
+import java.io.InputStream;
|
|
||||||
+import java.io.OutputStream;
|
|
||||||
+
|
|
||||||
+public class InstallImsApkPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceClickListener {
|
|
||||||
+
|
|
||||||
+ private static final String TAG = "TrebleSettings";
|
|
||||||
+ private static final String INSTALL_IMS_APK_KEY = "install_ims_apk";
|
|
||||||
+ private static final String[] IMS_SLOTS = {
|
|
||||||
+ "imsrild1", "imsrild2", "imsrild3",
|
|
||||||
+ "slot1", "slot2", "slot3",
|
|
||||||
+ "imsSlot1", "imsSlot2",
|
|
||||||
+ "mtkSlot1", "mtkSlot2",
|
|
||||||
+ "imsradio0", "imsradio1"
|
|
||||||
+ };
|
|
||||||
+ private static final String RO_PRODUCT_VENDOR_BRAND_PROPERTY = "ro.product.vendor.brand";
|
|
||||||
+
|
|
||||||
+ private Preference mPreference;
|
|
||||||
+ private String mImsType = "none";
|
|
||||||
+ private String mImsApkUrl = "";
|
|
||||||
+
|
|
||||||
+ public InstallImsApkPreferenceController(Context context) {
|
|
||||||
+ super(context, INSTALL_IMS_APK_KEY);
|
|
||||||
+
|
|
||||||
+ mImsType = getImsType();
|
|
||||||
+ Log.d(TAG, "IMS type = " + mImsType);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return INSTALL_IMS_APK_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+
|
|
||||||
+ if (mImsType.equals("none")) {
|
|
||||||
+ mPreference.setEnabled(false);
|
|
||||||
+ } else {
|
|
||||||
+ mPreference.setOnPreferenceClickListener(this);
|
|
||||||
+ String summary = "IMS type: ";
|
|
||||||
+ switch (mImsType) {
|
|
||||||
+ case "qcom_hidl_moto":
|
|
||||||
+ summary += "Qualcomm pre-S (Motorola)";
|
|
||||||
+ break;
|
|
||||||
+ case "qcom_hidl":
|
|
||||||
+ summary += "Qualcomm pre-S";
|
|
||||||
+ break;
|
|
||||||
+ case "qcom_aidl":
|
|
||||||
+ summary += "Qualcomm S+";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_p":
|
|
||||||
+ summary += "MediaTek P";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_q":
|
|
||||||
+ summary += "MediaTek Q";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_r":
|
|
||||||
+ summary += "MediaTek R";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_s":
|
|
||||||
+ summary += "MediaTek S";
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ mPreference.setSummary(summary);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceClick(Preference preference) {
|
|
||||||
+ switch (mImsType) {
|
|
||||||
+ case "qcom_hidl_moto":
|
|
||||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-caf-moto.apk";
|
|
||||||
+ break;
|
|
||||||
+ case "qcom_hidl":
|
|
||||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-q.64.apk";
|
|
||||||
+ break;
|
|
||||||
+ case "qcom_aidl":
|
|
||||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-caf-s.apk";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_p":
|
|
||||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-p.apk";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_q":
|
|
||||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-q.apk";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_r":
|
|
||||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-r.apk";
|
|
||||||
+ break;
|
|
||||||
+ case "mtk_s":
|
|
||||||
+ mImsApkUrl = "https://treble.phh.me/stable/ims-mtk-s.apk";
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ Context context = preference.getContext();
|
|
||||||
+ DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
|
||||||
+ DownloadManager.Request request = new DownloadManager.Request(Uri.parse(mImsApkUrl));
|
|
||||||
+ request.setTitle("IMS APK");
|
|
||||||
+ request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
|
|
||||||
+ request.setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, "ims.apk");
|
|
||||||
+ long id = dm.enqueue(request);
|
|
||||||
+ Toast.makeText(context, context.getString(R.string.install_ims_apk_toast_downloading), Toast.LENGTH_LONG).show();
|
|
||||||
+
|
|
||||||
+ context.registerReceiver(new BroadcastReceiver() {
|
|
||||||
+ @Override
|
|
||||||
+ public void onReceive(Context context, Intent intent) {
|
|
||||||
+ if (intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1L) != id) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ Cursor cursor = dm.query(new DownloadManager.Query().setFilterById(id));
|
|
||||||
+ if (!cursor.moveToFirst()) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ Uri localUri = Uri.parse(cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI)));
|
|
||||||
+ String path = localUri.getPath();
|
|
||||||
+ if (path == null) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ long fileSize = 0;
|
|
||||||
+ File file = new File(path);
|
|
||||||
+ if (file.isFile()) {
|
|
||||||
+ fileSize = file.length();
|
|
||||||
+ } else {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ try (InputStream in = new FileInputStream(path)) {
|
|
||||||
+ PackageInstaller pi = context.getPackageManager().getPackageInstaller();
|
|
||||||
+ int sessionId = pi.createSession(new PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL));
|
|
||||||
+ PackageInstaller.Session session = pi.openSession(sessionId);
|
|
||||||
+ try (OutputStream out = session.openWrite(TAG, 0, fileSize)) {
|
|
||||||
+ byte[] buffer = new byte[512 * 1024];
|
|
||||||
+ while (in.available() > 0) {
|
|
||||||
+ int l = in.read(buffer);
|
|
||||||
+ out.write(buffer, 0, l);
|
|
||||||
+ }
|
|
||||||
+ session.fsync(out);
|
|
||||||
+ }
|
|
||||||
+ String action = TAG + "_" + sessionId;
|
|
||||||
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(context, sessionId,
|
|
||||||
+ new Intent(action), PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
|
|
||||||
+ context.registerReceiver(new BroadcastReceiver() {
|
|
||||||
+ @Override
|
|
||||||
+ public void onReceive(Context context, Intent intent) {
|
|
||||||
+ Toast.makeText(context, context.getString(R.string.install_ims_apk_toast_completed), Toast.LENGTH_LONG).show();
|
|
||||||
+ }
|
|
||||||
+ }, new IntentFilter(action));
|
|
||||||
+ session.commit(pendingIntent.getIntentSender());
|
|
||||||
+ context.unregisterReceiver(this);
|
|
||||||
+ } catch (IOException ex) {
|
|
||||||
+ Log.d(TAG, "IOException while installing IMS APK");
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
|
||||||
+
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected static String getImsType() {
|
|
||||||
+ try {
|
|
||||||
+ IServiceManager hidlManager = IServiceManager.getService();
|
|
||||||
+ for (String slot: IMS_SLOTS) {
|
|
||||||
+ if (hidlManager.get("vendor.qti.hardware.radio.ims@1.0::IImsRadio", slot) != null) {
|
|
||||||
+ if (SystemProperties.get(RO_PRODUCT_VENDOR_BRAND_PROPERTY, "N/A").equals("motorola")) {
|
|
||||||
+ return "qcom_hidl_moto";
|
|
||||||
+ }
|
|
||||||
+ return "qcom_hidl";
|
|
||||||
+ } else if (ServiceManager.getService("vendor.qti.hardware.radio.ims.IImsRadio/" + slot) != null) {
|
|
||||||
+ return "qcom_aidl";
|
|
||||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.radio@3.0::IRadio", slot) != null) {
|
|
||||||
+ return "mtk_p";
|
|
||||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.mtkradioex@1.0::IMtkRadioEx", slot) != null) {
|
|
||||||
+ return "mtk_q";
|
|
||||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.mtkradioex@2.0::IMtkRadioEx", slot) != null) {
|
|
||||||
+ return "mtk_r";
|
|
||||||
+ } else if (hidlManager.get("vendor.mediatek.hardware.mtkradioex@3.0::IMtkRadioEx", slot) != null) {
|
|
||||||
+ return "mtk_s";
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ } catch (RemoteException ex) {}
|
|
||||||
+
|
|
||||||
+ return "none";
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java b/src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..1ab12d3ca0
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/OverrideVolteAvailabilityPreferenceController.java
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class OverrideVolteAvailabilityPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String OVERRIDE_VOLTE_AVAILABILITY_KEY = "override_volte_availability";
|
|
||||||
+ private static final String[] IMSMANAGER_DEBUG_OVERRIDE_PROPERTIES = {
|
|
||||||
+ "persist.dbg.volte_avail_ovr",
|
|
||||||
+ "persist.dbg.wfc_avail_ovr",
|
|
||||||
+ "persist.dbg.allow_ims_off"
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public OverrideVolteAvailabilityPreferenceController(Context context) {
|
|
||||||
+ super(context, OVERRIDE_VOLTE_AVAILABILITY_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return OVERRIDE_VOLTE_AVAILABILITY_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(IMSMANAGER_DEBUG_OVERRIDE_PROPERTIES[0], false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ for (String prop: IMSMANAGER_DEBUG_OVERRIDE_PROPERTIES) {
|
|
||||||
+ SystemProperties.set(prop, ((boolean) newValue) ? "1" : "0");
|
|
||||||
+ }
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
index 5c1611c053..50e3eda8c6 100644
|
|
||||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -36,6 +36,8 @@ public class TrebleSettings extends DashboardFragment {
|
|
||||||
controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
|
||||||
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
|
||||||
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
|
||||||
+ controllers.add(new InstallImsApkPreferenceController(context));
|
|
||||||
+ controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
|
||||||
return controllers;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
From 944adfb3d9a4f18bdda1e92b80f720bb33aed0eb Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 10 Dec 2022 12:04:37 +0000
|
|
||||||
Subject: [PATCH 4/8] TrebleSettings: Disable A2DP offload
|
|
||||||
|
|
||||||
Change-Id: I737f49d146f83d96793f4436850529e3c528acbe
|
|
||||||
---
|
|
||||||
res/values/strings.xml | 2 +
|
|
||||||
res/xml/treble_settings.xml | 4 ++
|
|
||||||
...isableA2DPOffloadPreferenceController.java | 53 +++++++++++++++++++
|
|
||||||
.../settings/treble/TrebleSettings.java | 1 +
|
|
||||||
4 files changed, 60 insertions(+)
|
|
||||||
create mode 100644 src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java
|
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index eef415cc89..bfa28394c7 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8513,6 +8513,8 @@
|
|
||||||
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
|
|
||||||
<!-- Treble settings screen, disable soundvolume effect title -->
|
|
||||||
<string name="disable_soundvolume_effect_title">Disable soundvolume effect</string>
|
|
||||||
+ <!-- Treble settings screen, disable A2DP offload title -->
|
|
||||||
+ <string name="disable_a2dp_offload_title">Disable A2DP offload</string>
|
|
||||||
<!-- Treble settings screen, screen resolution and refresh rate settings title -->
|
|
||||||
<string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
|
||||||
<!-- Treble settings screen, use alternative backlight scale title -->
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
index 09e6bc5d00..b58e7a1282 100644
|
|
||||||
--- a/res/xml/treble_settings.xml
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -17,6 +17,10 @@
|
|
||||||
android:key="disable_soundvolume_effect"
|
|
||||||
android:title="@string/disable_soundvolume_effect_title" />
|
|
||||||
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="disable_a2dp_offload"
|
|
||||||
+ android:title="@string/disable_a2dp_offload_title" />
|
|
||||||
+
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
diff --git a/src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java b/src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..f53103160d
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/DisableA2DPOffloadPreferenceController.java
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class DisableA2DPOffloadPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String DISABLE_A2DP_OFFLOAD_KEY = "disable_a2dp_offload";
|
|
||||||
+ private static final String A2DP_OFFLOAD_DISABLED_PROPERTY = "persist.bluetooth.a2dp_offload.disabled";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public DisableA2DPOffloadPreferenceController(Context context) {
|
|
||||||
+ super(context, DISABLE_A2DP_OFFLOAD_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return DISABLE_A2DP_OFFLOAD_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(A2DP_OFFLOAD_DISABLED_PROPERTY, false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(A2DP_OFFLOAD_DISABLED_PROPERTY, String.valueOf((boolean) newValue));
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
index 50e3eda8c6..5e9b7f88e2 100644
|
|
||||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -34,6 +34,7 @@ public class TrebleSettings extends DashboardFragment {
|
|
||||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
|
||||||
controllers.add(new UseAlternativeAudioPolicyPreferenceController(context));
|
|
||||||
controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
|
||||||
+ controllers.add(new DisableA2DPOffloadPreferenceController(context));
|
|
||||||
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
|
||||||
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
|
||||||
controllers.add(new InstallImsApkPreferenceController(context));
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
-116
@@ -1,116 +0,0 @@
|
|||||||
From 08b78bde66809487d882ebb101d379d5de808af4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 10 Dec 2022 14:16:50 +0000
|
|
||||||
Subject: [PATCH 5/8] TrebleSettings: Alternative audio jack detection
|
|
||||||
|
|
||||||
Change-Id: I5d6d48f26a4a2134fd6edf996eca89a1fc42e6de
|
|
||||||
---
|
|
||||||
res/values/strings.xml | 2 +
|
|
||||||
res/xml/treble_settings.xml | 4 ++
|
|
||||||
.../settings/treble/TrebleSettings.java | 1 +
|
|
||||||
...udioJackDetectionPreferenceController.java | 53 +++++++++++++++++++
|
|
||||||
4 files changed, 60 insertions(+)
|
|
||||||
create mode 100644 src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java
|
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index bfa28394c7..be942eb6d9 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8515,6 +8515,8 @@
|
|
||||||
<string name="disable_soundvolume_effect_title">Disable soundvolume effect</string>
|
|
||||||
<!-- Treble settings screen, disable A2DP offload title -->
|
|
||||||
<string name="disable_a2dp_offload_title">Disable A2DP offload</string>
|
|
||||||
+ <!-- Treble settings screen, use alternative audio jack detection title -->
|
|
||||||
+ <string name="use_alternative_audio_jack_detection_title">Use alternative audio jack detection</string>
|
|
||||||
<!-- Treble settings screen, screen resolution and refresh rate settings title -->
|
|
||||||
<string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
|
||||||
<!-- Treble settings screen, use alternative backlight scale title -->
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
index b58e7a1282..47097a14c7 100644
|
|
||||||
--- a/res/xml/treble_settings.xml
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -21,6 +21,10 @@
|
|
||||||
android:key="disable_a2dp_offload"
|
|
||||||
android:title="@string/disable_a2dp_offload_title" />
|
|
||||||
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="use_alternative_audio_jack_detection"
|
|
||||||
+ android:title="@string/use_alternative_audio_jack_detection_title" />
|
|
||||||
+
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
index 5e9b7f88e2..09aa001e82 100644
|
|
||||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -35,6 +35,7 @@ public class TrebleSettings extends DashboardFragment {
|
|
||||||
controllers.add(new UseAlternativeAudioPolicyPreferenceController(context));
|
|
||||||
controllers.add(new DisableSoundvolumeEffectPreferenceController(context));
|
|
||||||
controllers.add(new DisableA2DPOffloadPreferenceController(context));
|
|
||||||
+ controllers.add(new UseAlternativeAudioJackDetectionPreferenceController(context));
|
|
||||||
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
|
||||||
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
|
||||||
controllers.add(new InstallImsApkPreferenceController(context));
|
|
||||||
diff --git a/src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java b/src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..0d60b72db1
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/UseAlternativeAudioJackDetectionPreferenceController.java
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class UseAlternativeAudioJackDetectionPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String USE_ALTERNATIVE_AUDIO_JACK_DETECTION_KEY = "use_alternative_audio_jack_detection";
|
|
||||||
+ private static final String DEVINPUT_JACK_PROPERTY = "persist.sys.overlay.devinputjack";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public UseAlternativeAudioJackDetectionPreferenceController(Context context) {
|
|
||||||
+ super(context, USE_ALTERNATIVE_AUDIO_JACK_DETECTION_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return USE_ALTERNATIVE_AUDIO_JACK_DETECTION_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(DEVINPUT_JACK_PROPERTY, false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(DEVINPUT_JACK_PROPERTY, String.valueOf((boolean) newValue));
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
-116
@@ -1,116 +0,0 @@
|
|||||||
From e87ca51ba6e4bcdb29449e3bd896a2d7166bad7a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 17 Dec 2022 10:29:05 +0000
|
|
||||||
Subject: [PATCH 6/8] TrebleSettings: Override minimum brightness
|
|
||||||
|
|
||||||
Change-Id: I6d621f7dd04b675b6e2e851a5e474dc9a9841eb0
|
|
||||||
---
|
|
||||||
res/values/strings.xml | 2 +
|
|
||||||
res/xml/treble_settings.xml | 4 ++
|
|
||||||
...MinimumBrightnessPreferenceController.java | 53 +++++++++++++++++++
|
|
||||||
.../settings/treble/TrebleSettings.java | 1 +
|
|
||||||
4 files changed, 60 insertions(+)
|
|
||||||
create mode 100644 src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java
|
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index be942eb6d9..6db51f1f44 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8521,6 +8521,8 @@
|
|
||||||
<string name="screen_resolution_refresh_rate_title">Screen resolution & refresh rate</string>
|
|
||||||
<!-- Treble settings screen, use alternative backlight scale title -->
|
|
||||||
<string name="use_alternative_backlight_scale_title">Use alternative backlight scale</string>
|
|
||||||
+ <!-- Treble settings screen, override minimum brightness title -->
|
|
||||||
+ <string name="override_minimum_brightness_title">Override minimum brightness</string>
|
|
||||||
<!-- Treble settings screen, install IMS APK title -->
|
|
||||||
<string name="install_ims_apk_title">Install IMS APK</string>
|
|
||||||
<!-- Treble settings screen, install IMS APK toasts -->
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
index 47097a14c7..5c18461b69 100644
|
|
||||||
--- a/res/xml/treble_settings.xml
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -38,6 +38,10 @@
|
|
||||||
android:key="use_alternative_backlight_scale"
|
|
||||||
android:title="@string/use_alternative_backlight_scale_title" />
|
|
||||||
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="override_minimum_brightness"
|
|
||||||
+ android:title="@string/override_minimum_brightness_title" />
|
|
||||||
+
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
diff --git a/src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java b/src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..95200fbeaa
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/OverrideMinimumBrightnessPreferenceController.java
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class OverrideMinimumBrightnessPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String OVERRIDE_MINIMUM_BRIGHTNESS_KEY = "override_minimum_brightness";
|
|
||||||
+ private static final String MINIMAL_BRIGHTNESS_PROPERTY = "persist.sys.overlay.minimal_brightness";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public OverrideMinimumBrightnessPreferenceController(Context context) {
|
|
||||||
+ super(context, OVERRIDE_MINIMUM_BRIGHTNESS_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return OVERRIDE_MINIMUM_BRIGHTNESS_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(MINIMAL_BRIGHTNESS_PROPERTY, false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(MINIMAL_BRIGHTNESS_PROPERTY, String.valueOf((boolean) newValue));
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
index 09aa001e82..39a0e19972 100644
|
|
||||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -38,6 +38,7 @@ public class TrebleSettings extends DashboardFragment {
|
|
||||||
controllers.add(new UseAlternativeAudioJackDetectionPreferenceController(context));
|
|
||||||
controllers.add(new ScreenResolutionRefreshRatePreferenceController(context));
|
|
||||||
controllers.add(new UseAlternativeBacklightScalePreferenceController(context));
|
|
||||||
+ controllers.add(new OverrideMinimumBrightnessPreferenceController(context));
|
|
||||||
controllers.add(new InstallImsApkPreferenceController(context));
|
|
||||||
controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
|
||||||
return controllers;
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
-128
@@ -1,128 +0,0 @@
|
|||||||
From aaa4bae7bf8f22569f434f0b183d7dfc3c547ed6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 17 Dec 2022 11:00:38 +0000
|
|
||||||
Subject: [PATCH 7/8] TrebleSettings: Override navbar availability
|
|
||||||
|
|
||||||
Change-Id: I7c771caf6274543fed23a8cc47411bf8c369ac2c
|
|
||||||
---
|
|
||||||
res/values/strings.xml | 4 ++
|
|
||||||
res/xml/treble_settings.xml | 9 ++++
|
|
||||||
...avbarAvailabilityPreferenceController.java | 53 +++++++++++++++++++
|
|
||||||
.../settings/treble/TrebleSettings.java | 1 +
|
|
||||||
4 files changed, 67 insertions(+)
|
|
||||||
create mode 100644 src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java
|
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index 6db51f1f44..6230aae707 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8508,6 +8508,8 @@
|
|
||||||
<string name="treble_settings_category_name_display">Display</string>
|
|
||||||
<!-- IMS category name [CHAR LIMIT=none] -->
|
|
||||||
<string name="treble_settings_category_name_ims">IMS</string>
|
|
||||||
+ <!-- UI category name [CHAR LIMIT=none] -->
|
|
||||||
+ <string name="treble_settings_category_name_ui">UI</string>
|
|
||||||
|
|
||||||
<!-- Treble settings screen, use alternative audio policy title -->
|
|
||||||
<string name="use_alternative_audio_policy_title">Use alternative audio policy</string>
|
|
||||||
@@ -8530,6 +8532,8 @@
|
|
||||||
<string name="install_ims_apk_toast_completed">IMS APK installed. Reboot required.</string>
|
|
||||||
<!-- Treble settings screen, override VoLTE availability title -->
|
|
||||||
<string name="override_volte_availability_title">Override VoLTE availability</string>
|
|
||||||
+ <!-- Treble settings screen, override navbar availability title -->
|
|
||||||
+ <string name="override_navbar_availability_title">Override navigation bar availability</string>
|
|
||||||
|
|
||||||
<!-- Title for setting tile leading to network and Internet settings [CHAR LIMIT=40]-->
|
|
||||||
<string name="network_dashboard_title">Network & internet</string>
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
index 5c18461b69..250a8ee75a 100644
|
|
||||||
--- a/res/xml/treble_settings.xml
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -57,4 +57,13 @@
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
+ <PreferenceCategory
|
|
||||||
+ android:title="@string/treble_settings_category_name_ui">
|
|
||||||
+
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="override_navbar_availability"
|
|
||||||
+ android:title="@string/override_navbar_availability_title" />
|
|
||||||
+
|
|
||||||
+ </PreferenceCategory>
|
|
||||||
+
|
|
||||||
</PreferenceScreen>
|
|
||||||
diff --git a/src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java b/src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..d6baa33739
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/OverrideNavbarAvailabilityPreferenceController.java
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class OverrideNavbarAvailabilityPreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String OVERRIDE_NAVBAR_AVAILABILITY_KEY = "override_navbar_availability";
|
|
||||||
+ private static final String TREBLE_MAINKEYS_PROPERTY = "persist.sys.treble.mainkeys";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public OverrideNavbarAvailabilityPreferenceController(Context context) {
|
|
||||||
+ super(context, OVERRIDE_NAVBAR_AVAILABILITY_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return OVERRIDE_NAVBAR_AVAILABILITY_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = (SystemProperties.getInt(TREBLE_MAINKEYS_PROPERTY, 0) == 0);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(TREBLE_MAINKEYS_PROPERTY, ((boolean) newValue) ? "0" : "1");
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
index 39a0e19972..634b7ce3ce 100644
|
|
||||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -41,6 +41,7 @@ public class TrebleSettings extends DashboardFragment {
|
|
||||||
controllers.add(new OverrideMinimumBrightnessPreferenceController(context));
|
|
||||||
controllers.add(new InstallImsApkPreferenceController(context));
|
|
||||||
controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
|
||||||
+ controllers.add(new OverrideNavbarAvailabilityPreferenceController(context));
|
|
||||||
return controllers;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
From 382deaccfef1178077cd9c697e42d5bdcbe8c743 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 17 Dec 2022 14:30:52 +0000
|
|
||||||
Subject: [PATCH 8/8] TrebleSettings: Securize on-demand
|
|
||||||
|
|
||||||
Change-Id: I76f54620277ccdc41636d74d1afa6330c382ce6a
|
|
||||||
---
|
|
||||||
res/values/strings.xml | 6 +++
|
|
||||||
res/xml/treble_settings.xml | 10 ++++
|
|
||||||
.../treble/SecurizePreferenceController.java | 53 +++++++++++++++++++
|
|
||||||
.../settings/treble/TrebleSettings.java | 1 +
|
|
||||||
4 files changed, 70 insertions(+)
|
|
||||||
create mode 100644 src/com/android/settings/treble/SecurizePreferenceController.java
|
|
||||||
|
|
||||||
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
||||||
index 6230aae707..62062b5fe8 100644
|
|
||||||
--- a/res/values/strings.xml
|
|
||||||
+++ b/res/values/strings.xml
|
|
||||||
@@ -8508,6 +8508,8 @@
|
|
||||||
<string name="treble_settings_category_name_display">Display</string>
|
|
||||||
<!-- IMS category name [CHAR LIMIT=none] -->
|
|
||||||
<string name="treble_settings_category_name_ims">IMS</string>
|
|
||||||
+ <!-- System category name [CHAR LIMIT=none] -->
|
|
||||||
+ <string name="treble_settings_category_name_system">System</string>
|
|
||||||
<!-- UI category name [CHAR LIMIT=none] -->
|
|
||||||
<string name="treble_settings_category_name_ui">UI</string>
|
|
||||||
|
|
||||||
@@ -8532,6 +8534,10 @@
|
|
||||||
<string name="install_ims_apk_toast_completed">IMS APK installed. Reboot required.</string>
|
|
||||||
<!-- Treble settings screen, override VoLTE availability title -->
|
|
||||||
<string name="override_volte_availability_title">Override VoLTE availability</string>
|
|
||||||
+ <!-- Treble settings screen, securize title -->
|
|
||||||
+ <string name="securize_title">Spoof system properties</string>
|
|
||||||
+ <!-- Treble settings screen, securize summary -->
|
|
||||||
+ <string name="securize_summary">For better chances of passing SafetyNet\nMight cause bootloop on some devices</string>
|
|
||||||
<!-- Treble settings screen, override navbar availability title -->
|
|
||||||
<string name="override_navbar_availability_title">Override navigation bar availability</string>
|
|
||||||
|
|
||||||
diff --git a/res/xml/treble_settings.xml b/res/xml/treble_settings.xml
|
|
||||||
index 250a8ee75a..1f24352421 100644
|
|
||||||
--- a/res/xml/treble_settings.xml
|
|
||||||
+++ b/res/xml/treble_settings.xml
|
|
||||||
@@ -57,6 +57,16 @@
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
+ <PreferenceCategory
|
|
||||||
+ android:title="@string/treble_settings_category_name_system">
|
|
||||||
+
|
|
||||||
+ <SwitchPreference
|
|
||||||
+ android:key="securize"
|
|
||||||
+ android:title="@string/securize_title"
|
|
||||||
+ android:summary="@string/securize_summary" />
|
|
||||||
+
|
|
||||||
+ </PreferenceCategory>
|
|
||||||
+
|
|
||||||
<PreferenceCategory
|
|
||||||
android:title="@string/treble_settings_category_name_ui">
|
|
||||||
|
|
||||||
diff --git a/src/com/android/settings/treble/SecurizePreferenceController.java b/src/com/android/settings/treble/SecurizePreferenceController.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..0b59bbad81
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/com/android/settings/treble/SecurizePreferenceController.java
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+package com.android.settings.treble;
|
|
||||||
+
|
|
||||||
+import android.content.Context;
|
|
||||||
+import android.os.SystemProperties;
|
|
||||||
+
|
|
||||||
+import androidx.preference.Preference;
|
|
||||||
+import androidx.preference.PreferenceScreen;
|
|
||||||
+import androidx.preference.SwitchPreference;
|
|
||||||
+
|
|
||||||
+import com.android.settings.core.BasePreferenceController;
|
|
||||||
+
|
|
||||||
+public class SecurizePreferenceController extends BasePreferenceController
|
|
||||||
+ implements Preference.OnPreferenceChangeListener {
|
|
||||||
+
|
|
||||||
+ private static final String SECURIZE_KEY = "securize";
|
|
||||||
+ private static final String SECURIZE_PROPERTY = "persist.sys.treble.securize";
|
|
||||||
+
|
|
||||||
+ private SwitchPreference mSwitchPreference;
|
|
||||||
+
|
|
||||||
+ public SecurizePreferenceController(Context context) {
|
|
||||||
+ super(context, SECURIZE_KEY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public int getAvailabilityStatus() {
|
|
||||||
+ return AVAILABLE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public String getPreferenceKey() {
|
|
||||||
+ return SECURIZE_KEY;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void displayPreference(PreferenceScreen screen) {
|
|
||||||
+ mSwitchPreference = screen.findPreference(getPreferenceKey());
|
|
||||||
+ super.displayPreference(screen);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void updateState(Preference preference) {
|
|
||||||
+ boolean checked = SystemProperties.getBoolean(SECURIZE_PROPERTY, false);
|
|
||||||
+ mSwitchPreference.setChecked(checked);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
+ SystemProperties.set(SECURIZE_PROPERTY, String.valueOf((boolean) newValue));
|
|
||||||
+ mSwitchPreference.setChecked((boolean) newValue);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/com/android/settings/treble/TrebleSettings.java b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
index 634b7ce3ce..149c18f231 100644
|
|
||||||
--- a/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
+++ b/src/com/android/settings/treble/TrebleSettings.java
|
|
||||||
@@ -41,6 +41,7 @@ public class TrebleSettings extends DashboardFragment {
|
|
||||||
controllers.add(new OverrideMinimumBrightnessPreferenceController(context));
|
|
||||||
controllers.add(new InstallImsApkPreferenceController(context));
|
|
||||||
controllers.add(new OverrideVolteAvailabilityPreferenceController(context));
|
|
||||||
+ controllers.add(new SecurizePreferenceController(context));
|
|
||||||
controllers.add(new OverrideNavbarAvailabilityPreferenceController(context));
|
|
||||||
return controllers;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
From 29ccba624ae893659126b2f6562c16909c2691c5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Mon, 26 Sep 2022 14:41:41 +0000
|
|
||||||
Subject: [PATCH 1/4] Make xbin and su executable by other
|
|
||||||
|
|
||||||
Needed by PHH-SU
|
|
||||||
|
|
||||||
Change-Id: I5304b787ce4602036904a373a409bb08f8f969de
|
|
||||||
---
|
|
||||||
libcutils/fs_config.cpp | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
|
|
||||||
index a6835fc70..a703993f6 100644
|
|
||||||
--- a/libcutils/fs_config.cpp
|
|
||||||
+++ b/libcutils/fs_config.cpp
|
|
||||||
@@ -86,7 +86,7 @@ static const struct fs_path_config android_dirs[] = {
|
|
||||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system/bin" },
|
|
||||||
{ 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" },
|
|
||||||
{ 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" },
|
|
||||||
- { 00750, AID_ROOT, AID_SHELL, 0, "system/xbin" },
|
|
||||||
+ { 00755, AID_ROOT, AID_SHELL, 0, "system/xbin" },
|
|
||||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" },
|
|
||||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" },
|
|
||||||
{ 00751, AID_ROOT, AID_SHELL, 0, "system_ext/apex/*/bin" },
|
|
||||||
@@ -190,7 +190,7 @@ static const struct fs_path_config android_files[] = {
|
|
||||||
// the following two files are INTENTIONALLY set-uid, but they
|
|
||||||
// are NOT included on user builds.
|
|
||||||
{ 06755, AID_ROOT, AID_ROOT, 0, "system/xbin/procmem" },
|
|
||||||
- { 04750, AID_ROOT, AID_SHELL, 0, "system/xbin/su" },
|
|
||||||
+ { 04755, AID_ROOT, AID_SHELL, 0, "system/xbin/su" },
|
|
||||||
|
|
||||||
// the following files have enhanced capabilities and ARE included
|
|
||||||
// in user builds.
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
From b58f1976ed11252c29c1ecb711dd073856998d7d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
|
||||||
Date: Thu, 7 Oct 2021 15:48:11 -0400
|
|
||||||
Subject: [PATCH 3/4] Stop overriding system properties from vendor
|
|
||||||
|
|
||||||
This is annoying to disable apexes, or force adb
|
|
||||||
|
|
||||||
Change-Id: Ifd0072c631349b23945df4ab401ba26eca07131f
|
|
||||||
---
|
|
||||||
init/property_service.cpp | 1 -
|
|
||||||
1 file changed, 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/init/property_service.cpp b/init/property_service.cpp
|
|
||||||
index 8db414a97..ff79ce8a0 100644
|
|
||||||
--- a/init/property_service.cpp
|
|
||||||
+++ b/init/property_service.cpp
|
|
||||||
@@ -727,7 +727,6 @@ static void LoadProperties(char* data, const char* filter, const char* filename,
|
|
||||||
} else if (it->second != value) {
|
|
||||||
LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second
|
|
||||||
<< "' with new value '" << value << "'";
|
|
||||||
- it->second = value;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG(ERROR) << "Do not have permissions to set '" << key << "' to '" << value
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
+99
@@ -0,0 +1,99 @@
|
|||||||
|
From 66534cd4c678494e0aa0e74197a39fcee57e313a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Thu, 29 Dec 2022 15:08:49 +0000
|
||||||
|
Subject: [PATCH] Simplify Securize to CheckBoxPreference and persist prop
|
||||||
|
|
||||||
|
For "Securize on-demand"
|
||||||
|
---
|
||||||
|
app/src/main/java/me/phh/treble/app/Misc.kt | 5 +++
|
||||||
|
.../java/me/phh/treble/app/MiscSettings.kt | 33 -------------------
|
||||||
|
app/src/main/res/xml/pref_misc.xml | 7 ++--
|
||||||
|
3 files changed, 10 insertions(+), 35 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/app/src/main/java/me/phh/treble/app/Misc.kt b/app/src/main/java/me/phh/treble/app/Misc.kt
|
||||||
|
index a56b460..8861d51 100644
|
||||||
|
--- a/app/src/main/java/me/phh/treble/app/Misc.kt
|
||||||
|
+++ b/app/src/main/java/me/phh/treble/app/Misc.kt
|
||||||
|
@@ -302,6 +302,10 @@ object Misc: EntryStartup {
|
||||||
|
val value = sp.getString(key, "0")
|
||||||
|
SystemProperties.set("persist.sys.bt.esco_transport_unit_size", value)
|
||||||
|
}
|
||||||
|
+ MiscSettings.securize -> {
|
||||||
|
+ val value = sp.getBoolean(key, false)
|
||||||
|
+ SystemProperties.set("persist.sys.phh.securize", if (value) "true" else "false")
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -328,5 +332,6 @@ object Misc: EntryStartup {
|
||||||
|
spListener.onSharedPreferenceChanged(sp, MiscSettings.noHwcomposer)
|
||||||
|
spListener.onSharedPreferenceChanged(sp, MiscSettings.storageFUSE)
|
||||||
|
spListener.onSharedPreferenceChanged(sp, MiscSettings.dt2w)
|
||||||
|
+ spListener.onSharedPreferenceChanged(sp, MiscSettings.securize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/app/src/main/java/me/phh/treble/app/MiscSettings.kt b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
|
||||||
|
index e3b5312..5fe481f 100644
|
||||||
|
--- a/app/src/main/java/me/phh/treble/app/MiscSettings.kt
|
||||||
|
+++ b/app/src/main/java/me/phh/treble/app/MiscSettings.kt
|
||||||
|
@@ -56,39 +56,6 @@ class MiscSettingsFragment : SettingsFragment() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
super.onCreatePreferences(savedInstanceState, rootKey)
|
||||||
|
|
||||||
|
- val securizePref = findPreference<Preference>(MiscSettings.securize)
|
||||||
|
- securizePref!!.setOnPreferenceClickListener {
|
||||||
|
- val builder = AlertDialog.Builder( this.getActivity() )
|
||||||
|
- builder.setTitle(getString(R.string.remove_root))
|
||||||
|
- builder.setMessage(getString(R.string.continue_question))
|
||||||
|
-
|
||||||
|
- builder.setPositiveButton(android.R.string.yes) { dialog, which ->
|
||||||
|
-
|
||||||
|
- var cmds = listOf(
|
||||||
|
- arrayOf("/sbin/su", "-c", "/system/bin/phh-securize.sh"),
|
||||||
|
- arrayOf("/system/xbin/su", "-c", "/system/bin/phh-securize.sh"),
|
||||||
|
- arrayOf("/system/xbin/phh-su", "-c", "/system/bin/phh-securize.sh"),
|
||||||
|
- arrayOf("/sbin/su", "0", "/system/bin/phh-securize.sh"),
|
||||||
|
- arrayOf("/system/xbin/su", "0", "/system/bin/phh-securize.sh"),
|
||||||
|
- arrayOf("/system/xbin/phh-su", "0", "/system/bin/phh-securize.sh")
|
||||||
|
- )
|
||||||
|
- for (cmd in cmds) {
|
||||||
|
- try {
|
||||||
|
- Runtime.getRuntime().exec(cmd).waitFor()
|
||||||
|
- break
|
||||||
|
- } catch (t: Throwable) {
|
||||||
|
- Log.d("PHH", "Failed to exec \"" + cmd.joinToString(separator = " ") + "\", skipping")
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- builder.setNegativeButton(android.R.string.no) { dialog, which ->
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- builder.show()
|
||||||
|
- return@setOnPreferenceClickListener true
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
val removeTelephonyPref = findPreference<Preference>(MiscSettings.removeTelephony)
|
||||||
|
removeTelephonyPref!!.setOnPreferenceClickListener {
|
||||||
|
|
||||||
|
diff --git a/app/src/main/res/xml/pref_misc.xml b/app/src/main/res/xml/pref_misc.xml
|
||||||
|
index e41659d..bdf1147 100644
|
||||||
|
--- a/app/src/main/res/xml/pref_misc.xml
|
||||||
|
+++ b/app/src/main/res/xml/pref_misc.xml
|
||||||
|
@@ -193,8 +193,11 @@
|
||||||
|
android:entryValues="@array/pref_misc_fod_color_values"
|
||||||
|
android:key="key_misc_fod_color"
|
||||||
|
android:title="Under-display fp color" />
|
||||||
|
- <Preference android:title="Securize"
|
||||||
|
- android:key="key_misc_securize" />
|
||||||
|
+ <CheckBoxPreference
|
||||||
|
+ android:defaultValue="false"
|
||||||
|
+ android:key="key_misc_securize"
|
||||||
|
+ android:title="Spoof system properties"
|
||||||
|
+ android:summary="For better chances of passing SafetyNet\nMight cause bootloop on some devices" />
|
||||||
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory android:title="Debugging">
|
||||||
|
<Preference android:title="Debug Sensors">
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
From 563510f6f9c387d14055a17673d6812db6843f41 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Wed, 21 Sep 2022 13:36:07 +0000
|
|
||||||
Subject: [PATCH 1/2] Exclude TrebleApp & co.
|
|
||||||
|
|
||||||
Change-Id: Ieb62801a79c6e015634fd58b654c63c1de5aef7e
|
|
||||||
---
|
|
||||||
overlay.mk | 3 ---
|
|
||||||
1 file changed, 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/overlay.mk b/overlay.mk
|
|
||||||
index 9a7a31e..e71c479 100644
|
|
||||||
--- a/overlay.mk
|
|
||||||
+++ b/overlay.mk
|
|
||||||
@@ -1,7 +1,4 @@
|
|
||||||
PRODUCT_PACKAGES += \
|
|
||||||
- HardwareOverlayPicker \
|
|
||||||
- QtiAudio \
|
|
||||||
- TrebleApp \
|
|
||||||
treble-overlay-NavBar \
|
|
||||||
treble-overlay-NightMode \
|
|
||||||
treble-overlay-SystemUI-FalseLocks \
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
-135
@@ -1,135 +0,0 @@
|
|||||||
From a08b8d0b89937d9ce8c50e339fd089bd2da44075 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Tue, 11 Oct 2022 10:53:34 +0000
|
|
||||||
Subject: [PATCH 2/2] Enable IMS overlays statically on QCOM/MTK devices
|
|
||||||
|
|
||||||
Change-Id: I851cf859328cc431e8bb163297c33837d4270f58
|
|
||||||
---
|
|
||||||
CAF-IMS/AndroidManifest.xml | 8 ++++----
|
|
||||||
CAF-IMS/res/values/config.xml | 4 ++--
|
|
||||||
MTK-IMS/AndroidManifest.xml | 8 ++++----
|
|
||||||
MTK-IMS/res/values/config.xml | 8 +++++---
|
|
||||||
Telephony/CAF-IMS/AndroidManifest.xml | 6 ++++--
|
|
||||||
Telephony/CAF-IMS/res/values/config.xml | 2 +-
|
|
||||||
Telephony/MTK-IMS/AndroidManifest.xml | 6 ++++--
|
|
||||||
Telephony/MTK-IMS/res/values/config.xml | 3 +--
|
|
||||||
8 files changed, 25 insertions(+), 20 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/CAF-IMS/AndroidManifest.xml b/CAF-IMS/AndroidManifest.xml
|
|
||||||
index 47236c6..5376fb8 100644
|
|
||||||
--- a/CAF-IMS/AndroidManifest.xml
|
|
||||||
+++ b/CAF-IMS/AndroidManifest.xml
|
|
||||||
@@ -3,8 +3,8 @@
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0">
|
|
||||||
<overlay android:targetPackage="android"
|
|
||||||
- android:requiredSystemPropertyName="persist.sys.phh.ims.caf"
|
|
||||||
- android:requiredSystemPropertyValue="true"
|
|
||||||
- android:priority="39"
|
|
||||||
- android:isStatic="true" />
|
|
||||||
+ android:requiredSystemPropertyName="ro.hardware"
|
|
||||||
+ android:requiredSystemPropertyValue="qcom"
|
|
||||||
+ android:priority="39"
|
|
||||||
+ android:isStatic="true" />
|
|
||||||
</manifest>
|
|
||||||
diff --git a/CAF-IMS/res/values/config.xml b/CAF-IMS/res/values/config.xml
|
|
||||||
index 1af87c7..5b85ebd 100644
|
|
||||||
--- a/CAF-IMS/res/values/config.xml
|
|
||||||
+++ b/CAF-IMS/res/values/config.xml
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
- <string name="config_ims_package">org.codeaurora.ims</string>
|
|
||||||
- <bool name="config_dynamic_bind_ims">true</bool>
|
|
||||||
+ <string name="config_ims_package">org.codeaurora.ims</string>
|
|
||||||
+ <bool name="config_dynamic_bind_ims">true</bool>
|
|
||||||
<bool name="config_carrier_volte_available">true</bool>
|
|
||||||
<bool name="config_device_volte_available">true</bool>
|
|
||||||
<bool name="config_device_wfc_ims_available">true</bool>
|
|
||||||
diff --git a/MTK-IMS/AndroidManifest.xml b/MTK-IMS/AndroidManifest.xml
|
|
||||||
index 96ba83e..33132cc 100644
|
|
||||||
--- a/MTK-IMS/AndroidManifest.xml
|
|
||||||
+++ b/MTK-IMS/AndroidManifest.xml
|
|
||||||
@@ -3,8 +3,8 @@
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0">
|
|
||||||
<overlay android:targetPackage="android"
|
|
||||||
- android:requiredSystemPropertyName="persist.sys.phh.ims.mtk"
|
|
||||||
- android:requiredSystemPropertyValue="true"
|
|
||||||
- android:priority="79"
|
|
||||||
- android:isStatic="true" />
|
|
||||||
+ android:requiredSystemPropertyName="ro.hardware"
|
|
||||||
+ android:requiredSystemPropertyValue="+mt6*"
|
|
||||||
+ android:priority="79"
|
|
||||||
+ android:isStatic="true" />
|
|
||||||
</manifest>
|
|
||||||
diff --git a/MTK-IMS/res/values/config.xml b/MTK-IMS/res/values/config.xml
|
|
||||||
index f5e0486..2d49a11 100644
|
|
||||||
--- a/MTK-IMS/res/values/config.xml
|
|
||||||
+++ b/MTK-IMS/res/values/config.xml
|
|
||||||
@@ -1,6 +1,8 @@
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
- <string name="config_ims_package">com.mediatek.ims</string>
|
|
||||||
- <bool name="config_carrier_volte_available">true</bool>
|
|
||||||
- <bool name="config_dynamic_bind_ims">true</bool>
|
|
||||||
+ <string name="config_ims_package">com.mediatek.ims</string>
|
|
||||||
+ <bool name="config_dynamic_bind_ims">true</bool>
|
|
||||||
+ <bool name="config_carrier_volte_available">true</bool>
|
|
||||||
+ <bool name="config_device_volte_available">true</bool>
|
|
||||||
+ <bool name="config_device_wfc_ims_available">true</bool>
|
|
||||||
</resources>
|
|
||||||
diff --git a/Telephony/CAF-IMS/AndroidManifest.xml b/Telephony/CAF-IMS/AndroidManifest.xml
|
|
||||||
index 2267406..365525c 100644
|
|
||||||
--- a/Telephony/CAF-IMS/AndroidManifest.xml
|
|
||||||
+++ b/Telephony/CAF-IMS/AndroidManifest.xml
|
|
||||||
@@ -3,6 +3,8 @@
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0">
|
|
||||||
<overlay android:targetPackage="com.android.phone"
|
|
||||||
- android:priority="79"
|
|
||||||
- />
|
|
||||||
+ android:requiredSystemPropertyName="ro.hardware"
|
|
||||||
+ android:requiredSystemPropertyValue="qcom"
|
|
||||||
+ android:priority="79"
|
|
||||||
+ android:isStatic="true" />
|
|
||||||
</manifest>
|
|
||||||
diff --git a/Telephony/CAF-IMS/res/values/config.xml b/Telephony/CAF-IMS/res/values/config.xml
|
|
||||||
index 565ee42..ddf685d 100644
|
|
||||||
--- a/Telephony/CAF-IMS/res/values/config.xml
|
|
||||||
+++ b/Telephony/CAF-IMS/res/values/config.xml
|
|
||||||
@@ -1,4 +1,4 @@
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
- <string name="config_ims_mmtel_package">org.codeaurora.ims</string>
|
|
||||||
+ <string name="config_ims_mmtel_package">org.codeaurora.ims</string>
|
|
||||||
</resources>
|
|
||||||
diff --git a/Telephony/MTK-IMS/AndroidManifest.xml b/Telephony/MTK-IMS/AndroidManifest.xml
|
|
||||||
index 5afe885..644d06b 100644
|
|
||||||
--- a/Telephony/MTK-IMS/AndroidManifest.xml
|
|
||||||
+++ b/Telephony/MTK-IMS/AndroidManifest.xml
|
|
||||||
@@ -3,6 +3,8 @@
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0">
|
|
||||||
<overlay android:targetPackage="com.android.phone"
|
|
||||||
- android:priority="79"
|
|
||||||
- />
|
|
||||||
+ android:requiredSystemPropertyName="ro.hardware"
|
|
||||||
+ android:requiredSystemPropertyValue="+mt6*"
|
|
||||||
+ android:priority="79"
|
|
||||||
+ android:isStatic="true" />
|
|
||||||
</manifest>
|
|
||||||
diff --git a/Telephony/MTK-IMS/res/values/config.xml b/Telephony/MTK-IMS/res/values/config.xml
|
|
||||||
index ead0cc2..01eca95 100644
|
|
||||||
--- a/Telephony/MTK-IMS/res/values/config.xml
|
|
||||||
+++ b/Telephony/MTK-IMS/res/values/config.xml
|
|
||||||
@@ -1,5 +1,4 @@
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
- <string name="config_ims_mmtel_package">com.mediatek.ims</string>
|
|
||||||
-
|
|
||||||
+ <string name="config_ims_mmtel_package">com.mediatek.ims</string>
|
|
||||||
</resources>
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
From 4ce07285aaa23a2dfe6d6bd19fe21fea8f3d5271 Mon Sep 17 00:00:00 2001
|
||||||
|
From: AndyCGYan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sun, 3 Mar 2019 14:07:33 +0800
|
||||||
|
Subject: [PATCH 1/2] 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 870d3b73..7dfcb27b 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",
|
||||||
|
@@ -31,15 +28,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
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
From 2ca5e1edd3f512c4ba1341148da811e9f7449a1f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 24 Sep 2022 11:40:52 +0000
|
|
||||||
Subject: [PATCH 1/2] vendor_lineage: Commonly build some packages
|
|
||||||
|
|
||||||
These were in handheld_product.mk and thus weren't included in GSI targets:
|
|
||||||
Contacts, DeskClock, Gallery2, SettingsIntelligence, fwb overlays
|
|
||||||
|
|
||||||
Change-Id: I00cc5918164ed70c612c5caa31eb8d2d0cd05b62
|
|
||||||
---
|
|
||||||
config/common_full.mk | 3 +++
|
|
||||||
config/common_mobile.mk | 4 +++-
|
|
||||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/config/common_full.mk b/config/common_full.mk
|
|
||||||
index f7eecd84..51e1e022 100644
|
|
||||||
--- a/config/common_full.mk
|
|
||||||
+++ b/config/common_full.mk
|
|
||||||
@@ -9,8 +9,11 @@ $(call inherit-product-if-exists, external/google-fonts/rubik/fonts.mk)
|
|
||||||
|
|
||||||
# Apps
|
|
||||||
PRODUCT_PACKAGES += \
|
|
||||||
+ Contacts \
|
|
||||||
+ DeskClock \
|
|
||||||
Eleven \
|
|
||||||
Etar \
|
|
||||||
+ Gallery2 \
|
|
||||||
Profiles \
|
|
||||||
Recorder \
|
|
||||||
Seedvault
|
|
||||||
diff --git a/config/common_mobile.mk b/config/common_mobile.mk
|
|
||||||
index 6edeb2b1..7ecc198b 100644
|
|
||||||
--- a/config/common_mobile.mk
|
|
||||||
+++ b/config/common_mobile.mk
|
|
||||||
@@ -16,7 +16,9 @@ PRODUCT_PRODUCT_PROPERTIES += \
|
|
||||||
PRODUCT_PACKAGES += \
|
|
||||||
Backgrounds \
|
|
||||||
ExactCalculator \
|
|
||||||
- Jelly
|
|
||||||
+ Jelly \
|
|
||||||
+ SettingsIntelligence \
|
|
||||||
+ frameworks-base-overlays
|
|
||||||
|
|
||||||
ifeq ($(PRODUCT_TYPE), go)
|
|
||||||
PRODUCT_PACKAGES += \
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
From 53612ea872c8a87c058a3d97de45952a54a92be4 Mon Sep 17 00:00:00 2001
|
From 4c6bf1998d42e14a1c3390331c0083b4d4461fd8 Mon Sep 17 00:00:00 2001
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
Date: Tue, 19 Oct 2021 15:48:43 +0000
|
Date: Tue, 19 Oct 2021 15:48:43 +0000
|
||||||
Subject: [PATCH 2/2] vendor_lineage: Disable ADB authentication
|
Subject: [PATCH 2/2] vendor_lineage: Disable ADB authentication
|
||||||
@@ -9,7 +9,7 @@ Change-Id: I4370583ecab1c88ef6f42e29d3eaa52c24d13f09
|
|||||||
1 file changed, 5 deletions(-)
|
1 file changed, 5 deletions(-)
|
||||||
|
|
||||||
diff --git a/config/common.mk b/config/common.mk
|
diff --git a/config/common.mk b/config/common.mk
|
||||||
index 18413708..f98e5616 100644
|
index bb84f0cd..a6703855 100644
|
||||||
--- a/config/common.mk
|
--- a/config/common.mk
|
||||||
+++ b/config/common.mk
|
+++ b/config/common.mk
|
||||||
@@ -13,16 +13,11 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
|
@@ -13,16 +13,11 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
|
||||||
@@ -30,5 +30,5 @@ index 18413708..f98e5616 100644
|
|||||||
# Backup Tool
|
# Backup Tool
|
||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
--
|
--
|
||||||
2.34.1
|
2.25.1
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
From a1ae87fa01e6e31fb733045d05a956ba4dfd00d6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
||||||
Date: Sat, 24 Sep 2022 07:44:20 +0000
|
|
||||||
Subject: [PATCH] Skip mounting /my_manifest on GSIs
|
|
||||||
|
|
||||||
On OPlus devices, /my_manifest/build.prop unnecessarily overrides a ton of props
|
|
||||||
All my_* partitions are supposedly useless on GSIs, but only skip this for now
|
|
||||||
|
|
||||||
Change-Id: I638fd8ed2cfd7ca835a8e46fd235ebf08c2460a4
|
|
||||||
---
|
|
||||||
target/product/gsi/gsi_skip_mount.cfg | 3 +++
|
|
||||||
1 file changed, 3 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/target/product/gsi/gsi_skip_mount.cfg b/target/product/gsi/gsi_skip_mount.cfg
|
|
||||||
index 28f434966..612c3bc81 100644
|
|
||||||
--- a/target/product/gsi/gsi_skip_mount.cfg
|
|
||||||
+++ b/target/product/gsi/gsi_skip_mount.cfg
|
|
||||||
@@ -7,3 +7,6 @@
|
|
||||||
/product/*
|
|
||||||
/system_ext/*
|
|
||||||
/system/*
|
|
||||||
+# Skip OPlus "my_manifest" mountpoints.
|
|
||||||
+/mnt/vendor/my_manifest
|
|
||||||
+/my_manifest
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
@@ -0,0 +1,431 @@
|
|||||||
|
From c329331ba9e37c24809afbd026bcc770f7950384 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Tue, 22 Jun 2021 13:38:31 +0000
|
||||||
|
Subject: [PATCH 1/3] Add Meizu 18 vibrator support
|
||||||
|
|
||||||
|
Thanks to:
|
||||||
|
- @phhusson for guidance
|
||||||
|
- Google for marlin HAL as reference in implementing 1.0
|
||||||
|
- @xingrz for Meizu 16th HAL as reference in implementing 1.3
|
||||||
|
|
||||||
|
Change-Id: Iecf12cd814e8773abfd78a19f98e31125a73761a
|
||||||
|
---
|
||||||
|
base.mk | 4 +
|
||||||
|
meizu-vibrator/Android.bp | 32 ++++
|
||||||
|
meizu-vibrator/Vibrator.cpp | 140 ++++++++++++++++++
|
||||||
|
meizu-vibrator/Vibrator.h | 60 ++++++++
|
||||||
|
...oid.hardware.vibrator@1.3-service.meizu.rc | 5 +
|
||||||
|
...id.hardware.vibrator@1.3-service.meizu.xml | 11 ++
|
||||||
|
meizu-vibrator/service.cpp | 72 +++++++++
|
||||||
|
sepolicy/file_contexts | 1 +
|
||||||
|
sepolicy/hal.te | 11 ++
|
||||||
|
9 files changed, 336 insertions(+)
|
||||||
|
create mode 100644 meizu-vibrator/Android.bp
|
||||||
|
create mode 100644 meizu-vibrator/Vibrator.cpp
|
||||||
|
create mode 100644 meizu-vibrator/Vibrator.h
|
||||||
|
create mode 100644 meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
|
||||||
|
create mode 100644 meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
|
||||||
|
create mode 100644 meizu-vibrator/service.cpp
|
||||||
|
|
||||||
|
diff --git a/base.mk b/base.mk
|
||||||
|
index 49c4da6..3a99248 100644
|
||||||
|
--- a/base.mk
|
||||||
|
+++ b/base.mk
|
||||||
|
@@ -259,3 +259,7 @@ PRODUCT_PACKAGES += \
|
||||||
|
# Two-pane layout in Settings
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
androidx.window.extensions
|
||||||
|
+
|
||||||
|
+# Meizu vibrator
|
||||||
|
+PRODUCT_PACKAGES += \
|
||||||
|
+ android.hardware.vibrator@1.3-service.meizu
|
||||||
|
diff --git a/meizu-vibrator/Android.bp b/meizu-vibrator/Android.bp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..76ad034
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/meizu-vibrator/Android.bp
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+//
|
||||||
|
+// Copyright (C) 2017 The Android Open Source Project
|
||||||
|
+//
|
||||||
|
+// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
+// you may not use this file except in compliance with the License.
|
||||||
|
+// You may obtain a copy of the License at
|
||||||
|
+//
|
||||||
|
+// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
+//
|
||||||
|
+// Unless required by applicable law or agreed to in writing, software
|
||||||
|
+// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
+// See the License for the specific language governing permissions and
|
||||||
|
+// limitations under the License.
|
||||||
|
+cc_binary {
|
||||||
|
+ name: "android.hardware.vibrator@1.3-service.meizu",
|
||||||
|
+ relative_install_path: "hw",
|
||||||
|
+ vintf_fragments: ["android.hardware.vibrator@1.3-service.meizu.xml"],
|
||||||
|
+ init_rc: ["android.hardware.vibrator@1.3-service.meizu.rc"],
|
||||||
|
+ srcs: ["service.cpp", "Vibrator.cpp"],
|
||||||
|
+ cflags: ["-Wall", "-Werror"],
|
||||||
|
+ shared_libs: [
|
||||||
|
+ "libhidlbase",
|
||||||
|
+ "liblog",
|
||||||
|
+ "libutils",
|
||||||
|
+ "libhardware",
|
||||||
|
+ "android.hardware.vibrator@1.0",
|
||||||
|
+ "android.hardware.vibrator@1.1",
|
||||||
|
+ "android.hardware.vibrator@1.2",
|
||||||
|
+ "android.hardware.vibrator@1.3",
|
||||||
|
+ ],
|
||||||
|
+}
|
||||||
|
diff --git a/meizu-vibrator/Vibrator.cpp b/meizu-vibrator/Vibrator.cpp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..8f12987
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/meizu-vibrator/Vibrator.cpp
|
||||||
|
@@ -0,0 +1,140 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (C) 2017 The Android Open Source Project
|
||||||
|
+ *
|
||||||
|
+ * Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
+ * you may not use this file except in compliance with the License.
|
||||||
|
+ * You may obtain a copy of the License at
|
||||||
|
+ *
|
||||||
|
+ * http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
+ *
|
||||||
|
+ * Unless required by applicable law or agreed to in writing, software
|
||||||
|
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
+ * See the License for the specific language governing permissions and
|
||||||
|
+ * limitations under the License.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#define LOG_TAG "VibratorService"
|
||||||
|
+
|
||||||
|
+#include <log/log.h>
|
||||||
|
+
|
||||||
|
+#include <hardware/hardware.h>
|
||||||
|
+#include <hardware/vibrator.h>
|
||||||
|
+
|
||||||
|
+#include "Vibrator.h"
|
||||||
|
+
|
||||||
|
+#include <cinttypes>
|
||||||
|
+#include <cmath>
|
||||||
|
+#include <iostream>
|
||||||
|
+#include <fstream>
|
||||||
|
+#include <thread>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+
|
||||||
|
+namespace android {
|
||||||
|
+namespace hardware {
|
||||||
|
+namespace vibrator {
|
||||||
|
+namespace V1_3 {
|
||||||
|
+namespace implementation {
|
||||||
|
+
|
||||||
|
+Vibrator::Vibrator(std::ofstream&& timeoutAndAmplitude, std::ofstream&& waveNumber, std::ofstream&& effectTrigger) :
|
||||||
|
+ mTimeoutAndAmplitude(std::move(timeoutAndAmplitude)),
|
||||||
|
+ mWaveNumber(std::move(waveNumber)),
|
||||||
|
+ mEffectTrigger(std::move(effectTrigger)) {}
|
||||||
|
+
|
||||||
|
+Return<Status> Vibrator::on(uint32_t timeout_ms) {
|
||||||
|
+ // Wave number 12 for vibrations slightly stronger than stock (13)
|
||||||
|
+ mWaveNumber << 12 << std::endl;
|
||||||
|
+ mTimeoutAndAmplitude << timeout_ms << std::endl;
|
||||||
|
+ if (!mTimeoutAndAmplitude) {
|
||||||
|
+ ALOGE("Failed to turn vibrator on (%d): %s", errno, strerror(errno));
|
||||||
|
+ return Status::UNKNOWN_ERROR;
|
||||||
|
+ }
|
||||||
|
+ return Status::OK;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<Status> Vibrator::off() {
|
||||||
|
+ mTimeoutAndAmplitude << 0 << std::endl;
|
||||||
|
+ if (!mTimeoutAndAmplitude) {
|
||||||
|
+ ALOGE("Failed to turn vibrator off (%d): %s", errno, strerror(errno));
|
||||||
|
+ return Status::UNKNOWN_ERROR;
|
||||||
|
+ }
|
||||||
|
+ return Status::OK;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<bool> Vibrator::supportsAmplitudeControl() {
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<Status> Vibrator::setAmplitude(uint8_t) {
|
||||||
|
+ return Status::UNSUPPORTED_OPERATION;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
|
||||||
|
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<void> Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, perform_cb _hidl_cb) {
|
||||||
|
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<void> Vibrator::perform_1_2(V1_2::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
|
||||||
|
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<void> Vibrator::perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
|
||||||
|
+ return perform<decltype(effect)>(effect, strength, _hidl_cb);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<bool> Vibrator::supportsExternalControl() {
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<Status> Vibrator::setExternalControl(bool) {
|
||||||
|
+ return Status::UNSUPPORTED_OPERATION;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Return<void> Vibrator::perform(Effect effect, EffectStrength, perform_cb _hidl_cb) {
|
||||||
|
+ uint32_t id;
|
||||||
|
+ switch (effect) {
|
||||||
|
+ case Effect::CLICK:
|
||||||
|
+ id = 31008;
|
||||||
|
+ break;
|
||||||
|
+ case Effect::DOUBLE_CLICK:
|
||||||
|
+ id = 31003;
|
||||||
|
+ break;
|
||||||
|
+ case Effect::TICK:
|
||||||
|
+ case Effect::TEXTURE_TICK:
|
||||||
|
+ id = 21000;
|
||||||
|
+ break;
|
||||||
|
+ case Effect::THUD:
|
||||||
|
+ id = 30900;
|
||||||
|
+ break;
|
||||||
|
+ case Effect::POP:
|
||||||
|
+ id = 22520;
|
||||||
|
+ break;
|
||||||
|
+ case Effect::HEAVY_CLICK:
|
||||||
|
+ id = 30900;
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
|
||||||
|
+ return Void();
|
||||||
|
+ }
|
||||||
|
+ mEffectTrigger << id << std::endl;
|
||||||
|
+ _hidl_cb(Status::OK, 200);
|
||||||
|
+ return Void();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+template <typename T> Return<void> Vibrator::perform(T effect, EffectStrength strength, perform_cb _hidl_cb) {
|
||||||
|
+ auto validRange = hidl_enum_range<T>();
|
||||||
|
+ if (effect < *validRange.begin() || effect > *std::prev(validRange.end())) {
|
||||||
|
+ _hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
|
||||||
|
+ return Void();
|
||||||
|
+ }
|
||||||
|
+ return perform(static_cast<Effect>(effect), strength, _hidl_cb);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+} // namespace implementation
|
||||||
|
+} // namespace V1_3
|
||||||
|
+} // namespace vibrator
|
||||||
|
+} // namespace hardware
|
||||||
|
+} // namespace android
|
||||||
|
diff --git a/meizu-vibrator/Vibrator.h b/meizu-vibrator/Vibrator.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..df901aa
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/meizu-vibrator/Vibrator.h
|
||||||
|
@@ -0,0 +1,60 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (C) 2017 The Android Open Source Project
|
||||||
|
+ *
|
||||||
|
+ * Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
+ * you may not use this file except in compliance with the License.
|
||||||
|
+ * You may obtain a copy of the License at
|
||||||
|
+ *
|
||||||
|
+ * http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
+ *
|
||||||
|
+ * Unless required by applicable law or agreed to in writing, software
|
||||||
|
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
+ * See the License for the specific language governing permissions and
|
||||||
|
+ * limitations under the License.
|
||||||
|
+ */
|
||||||
|
+#ifndef ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
|
||||||
|
+#define ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
|
||||||
|
+
|
||||||
|
+#include <android/hardware/vibrator/1.3/IVibrator.h>
|
||||||
|
+#include <hidl/Status.h>
|
||||||
|
+
|
||||||
|
+#include <fstream>
|
||||||
|
+
|
||||||
|
+namespace android {
|
||||||
|
+namespace hardware {
|
||||||
|
+namespace vibrator {
|
||||||
|
+namespace V1_3 {
|
||||||
|
+namespace implementation {
|
||||||
|
+
|
||||||
|
+using android::hardware::vibrator::V1_0::EffectStrength;
|
||||||
|
+using android::hardware::vibrator::V1_0::Status;
|
||||||
|
+
|
||||||
|
+class Vibrator : public IVibrator {
|
||||||
|
+public:
|
||||||
|
+ Vibrator(std::ofstream&& timeoutAndAmplitude, std::ofstream&& waveNumber, std::ofstream&& effectTrigger);
|
||||||
|
+ Return<Status> on(uint32_t timeoutMs) override;
|
||||||
|
+ Return<Status> off() override;
|
||||||
|
+ Return<bool> supportsAmplitudeControl() override;
|
||||||
|
+ Return<Status> setAmplitude(uint8_t amplitude) override;
|
||||||
|
+ Return<void> perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
||||||
|
+ Return<void> perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
||||||
|
+ Return<void> perform_1_2(V1_2::Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
||||||
|
+ Return<void> perform_1_3(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
|
||||||
|
+ Return<bool> supportsExternalControl() override;
|
||||||
|
+ Return<Status> setExternalControl(bool enabled) override;
|
||||||
|
+
|
||||||
|
+private:
|
||||||
|
+ Return<void> perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb);
|
||||||
|
+ template <typename T> Return<void> perform(T effect, EffectStrength strength, perform_cb _hidl_cb);
|
||||||
|
+ std::ofstream mTimeoutAndAmplitude;
|
||||||
|
+ std::ofstream mWaveNumber;
|
||||||
|
+ std::ofstream mEffectTrigger;
|
||||||
|
+};
|
||||||
|
+} // namespace implementation
|
||||||
|
+} // namespace V1_3
|
||||||
|
+} // namespace vibrator
|
||||||
|
+} // namespace hardware
|
||||||
|
+} // namespace android
|
||||||
|
+
|
||||||
|
+#endif // ANDROID_HARDWARE_VIBRATOR_V1_3_VIBRATOR_H
|
||||||
|
diff --git a/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..527ff66
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.rc
|
||||||
|
@@ -0,0 +1,5 @@
|
||||||
|
+service vibrator.meizu /system/bin/hw/android.hardware.vibrator@1.3-service.meizu
|
||||||
|
+ class late_start
|
||||||
|
+ user system
|
||||||
|
+ group system
|
||||||
|
+ oneshot
|
||||||
|
diff --git a/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..d1b836e
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/meizu-vibrator/android.hardware.vibrator@1.3-service.meizu.xml
|
||||||
|
@@ -0,0 +1,11 @@
|
||||||
|
+<manifest version="1.0" type="framework">
|
||||||
|
+ <hal format="hidl">
|
||||||
|
+ <name>android.hardware.vibrator</name>
|
||||||
|
+ <transport>hwbinder</transport>
|
||||||
|
+ <version>1.3</version>
|
||||||
|
+ <interface>
|
||||||
|
+ <name>IVibrator</name>
|
||||||
|
+ <instance>default</instance>
|
||||||
|
+ </interface>
|
||||||
|
+ </hal>
|
||||||
|
+</manifest>
|
||||||
|
diff --git a/meizu-vibrator/service.cpp b/meizu-vibrator/service.cpp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..1405dfb
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/meizu-vibrator/service.cpp
|
||||||
|
@@ -0,0 +1,72 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (C) 2017 The Android Open Source Project
|
||||||
|
+ *
|
||||||
|
+ * Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
+ * you may not use this file except in compliance with the License.
|
||||||
|
+ * You may obtain a copy of the License at
|
||||||
|
+ *
|
||||||
|
+ * http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
+ *
|
||||||
|
+ * Unless required by applicable law or agreed to in writing, software
|
||||||
|
+ * distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
+ * See the License for the specific language governing permissions and
|
||||||
|
+ * limitations under the License.
|
||||||
|
+ */
|
||||||
|
+#define LOG_TAG "android.hardware.vibrator@1.3-service.meizu"
|
||||||
|
+
|
||||||
|
+#include <android/hardware/vibrator/1.3/IVibrator.h>
|
||||||
|
+#include <hidl/HidlSupport.h>
|
||||||
|
+#include <hidl/HidlTransportSupport.h>
|
||||||
|
+#include <utils/Errors.h>
|
||||||
|
+#include <utils/StrongPointer.h>
|
||||||
|
+
|
||||||
|
+#include "Vibrator.h"
|
||||||
|
+
|
||||||
|
+using android::hardware::configureRpcThreadpool;
|
||||||
|
+using android::hardware::joinRpcThreadpool;
|
||||||
|
+using android::hardware::vibrator::V1_3::IVibrator;
|
||||||
|
+using android::hardware::vibrator::V1_3::implementation::Vibrator;
|
||||||
|
+using namespace android;
|
||||||
|
+
|
||||||
|
+static const char *CONTROL_PATH_TIMEOUT = "/sys/class/timed_output/vibrator/enable";
|
||||||
|
+static const char *PATH_WAVE_NUMBER = "/sys/class/meizu/motor/waveform";
|
||||||
|
+static const char *CONTROL_PATH_EFFECT = "/sys/class/meizu/motor/on_off";
|
||||||
|
+
|
||||||
|
+status_t registerVibratorService() {
|
||||||
|
+ std::ofstream timeoutAndAmplitude{CONTROL_PATH_TIMEOUT};
|
||||||
|
+ if (!timeoutAndAmplitude) {
|
||||||
|
+ int error = errno;
|
||||||
|
+ ALOGE("Failed to open %s (%d): %s", CONTROL_PATH_TIMEOUT, error, strerror(error));
|
||||||
|
+ return -error;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ std::ofstream waveNumber{PATH_WAVE_NUMBER};
|
||||||
|
+ if (!waveNumber) {
|
||||||
|
+ int error = errno;
|
||||||
|
+ ALOGE("Failed to open %s (%d): %s", PATH_WAVE_NUMBER, error, strerror(error));
|
||||||
|
+ return -error;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ std::ofstream effectTrigger{CONTROL_PATH_EFFECT};
|
||||||
|
+ if (!effectTrigger) {
|
||||||
|
+ int error = errno;
|
||||||
|
+ ALOGE("Failed to open %s (%d): %s", CONTROL_PATH_EFFECT, error, strerror(error));
|
||||||
|
+ return -error;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ sp<IVibrator> vibrator = new Vibrator(std::move(timeoutAndAmplitude), std::move(waveNumber), std::move(effectTrigger));
|
||||||
|
+ (void) vibrator->registerAsService(); // suppress unused-result warning
|
||||||
|
+ return OK;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int main() {
|
||||||
|
+ configureRpcThreadpool(1, true);
|
||||||
|
+ status_t status = registerVibratorService();
|
||||||
|
+
|
||||||
|
+ if (status != OK) {
|
||||||
|
+ return status;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ joinRpcThreadpool();
|
||||||
|
+}
|
||||||
|
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
|
||||||
|
index beb639a..3bc437c 100644
|
||||||
|
--- a/sepolicy/file_contexts
|
||||||
|
+++ b/sepolicy/file_contexts
|
||||||
|
@@ -14,6 +14,7 @@
|
||||||
|
|
||||||
|
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oppo.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
|
||||||
|
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oplus.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
|
||||||
|
+/system/bin/hw/android.hardware.vibrator@1.3-service.meizu u:object_r:hal_vibrator_default_exec:s0
|
||||||
|
|
||||||
|
/efs u:object_r:efs_file:s0
|
||||||
|
|
||||||
|
diff --git a/sepolicy/hal.te b/sepolicy/hal.te
|
||||||
|
index cb44422..280ae2d 100644
|
||||||
|
--- a/sepolicy/hal.te
|
||||||
|
+++ b/sepolicy/hal.te
|
||||||
|
@@ -8,3 +8,14 @@ init_daemon_domain(hal_fingerprint_oppo_compat)
|
||||||
|
|
||||||
|
type hal_fingerprint_oppo, domain;
|
||||||
|
allow hal_fingerprint_oppo vendor_default_prop:property_service { set };
|
||||||
|
+
|
||||||
|
+type vib_strength_sysfs, fs_type, sysfs_type;
|
||||||
|
+
|
||||||
|
+type hal_vibrator_default, domain;
|
||||||
|
+hal_server_domain(hal_vibrator_default, hal_vibrator)
|
||||||
|
+
|
||||||
|
+type hal_vibrator_default_exec, exec_type, vendor_file_type, file_type;
|
||||||
|
+init_daemon_domain(hal_vibrator_default)
|
||||||
|
+
|
||||||
|
+allow hal_vibrator_default vib_strength_sysfs:dir rw_dir_perms;
|
||||||
|
+allow hal_vibrator_default vib_strength_sysfs:file rw_file_perms;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
From cfc2fd859fb445535d9de131697c56f21d1cee48 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Thu, 28 Oct 2021 01:51:27 +0000
|
||||||
|
Subject: [PATCH 2/3] Revert "Include sim toolkit app"
|
||||||
|
|
||||||
|
This reverts commit 52d4d731465f37e3e8ccf9d315cfc8195303e51f.
|
||||||
|
|
||||||
|
Change-Id: I1eb7f4bb070eea649b4cea6280299e629d1edb3d
|
||||||
|
---
|
||||||
|
base.mk | 3 ---
|
||||||
|
1 file changed, 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/base.mk b/base.mk
|
||||||
|
index 3a99248..877a408 100644
|
||||||
|
--- a/base.mk
|
||||||
|
+++ b/base.mk
|
||||||
|
@@ -172,9 +172,6 @@ PRODUCT_PACKAGES += \
|
||||||
|
xiaomi-motor \
|
||||||
|
oneplus-motor
|
||||||
|
|
||||||
|
-PRODUCT_PACKAGES += \
|
||||||
|
- Stk
|
||||||
|
-
|
||||||
|
PRODUCT_PACKAGES += \
|
||||||
|
resetprop_phh
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
From 719b8e8406f6dbb72aac8029c37cdef445339292 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sun, 8 Aug 2021 09:31:01 +0000
|
||||||
|
Subject: [PATCH 3/3] Revert "treble: Set BOARD_EXT4_SHARE_DUP_BLOCKS
|
||||||
|
explicitly"
|
||||||
|
|
||||||
|
This reverts commit d7b179f234d76c3acf7a723fc05f07efe9adc84c.
|
||||||
|
|
||||||
|
Change-Id: I2bf95d40d4a096181710765c7d152f63556d27d8
|
||||||
|
---
|
||||||
|
board-base.mk | 2 --
|
||||||
|
1 file changed, 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/board-base.mk b/board-base.mk
|
||||||
|
index 9d1d45e..8cde64f 100644
|
||||||
|
--- a/board-base.mk
|
||||||
|
+++ b/board-base.mk
|
||||||
|
@@ -11,6 +11,4 @@ BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
|
||||||
|
|
||||||
|
BOARD_ROOT_EXTRA_SYMLINKS := $(filter-out $(BOARD_ROOT_EXTRA_SYMLINKS),/mnt/vendor/persist:/persist)
|
||||||
|
|
||||||
|
-BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
||||||
|
-
|
||||||
|
TARGET_NO_KERNEL_OVERRIDE := true
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+326
@@ -0,0 +1,326 @@
|
|||||||
|
From feb3f559b2157de9ca06438038114aedb2cc604e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Thu, 23 Mar 2023 15:28:42 +0000
|
||||||
|
Subject: [PATCH 1/2] Squashed revert of LOS UDFPS changes
|
||||||
|
|
||||||
|
Way less than FOD, but reverting them nonetheless to keep in line with PHH AOSP
|
||||||
|
|
||||||
|
- Revert "fixup! udfps: Restore illumination dot for global hbm"
|
||||||
|
- Revert "udfps: Make pressed udfp view configurable"
|
||||||
|
- Revert "udfps: Restore illumination dot for global hbm"
|
||||||
|
- Revert "udfps: Change window type to TYPE_DISPLAY_OVERLAY"
|
||||||
|
---
|
||||||
|
.../res/drawable-nodpi/udfps_icon_pressed.png | Bin 108 -> 0 bytes
|
||||||
|
packages/SystemUI/res/layout/udfps_view.xml | 6 -
|
||||||
|
.../SystemUI/res/values/lineage_config.xml | 3 -
|
||||||
|
.../biometrics/AuthContainerView.java | 2 +-
|
||||||
|
.../biometrics/UdfpsControllerOverlay.kt | 2 +-
|
||||||
|
.../systemui/biometrics/UdfpsSurfaceView.java | 159 ------------------
|
||||||
|
.../android/systemui/biometrics/UdfpsView.kt | 31 +---
|
||||||
|
7 files changed, 3 insertions(+), 200 deletions(-)
|
||||||
|
delete mode 100644 packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png
|
||||||
|
delete mode 100644 packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
|
||||||
|
|
||||||
|
diff --git a/packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png b/packages/SystemUI/res/drawable-nodpi/udfps_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!{^cTT<plwt66^>bP0l+XkK
|
||||||
|
D@OB!I
|
||||||
|
|
||||||
|
diff --git a/packages/SystemUI/res/layout/udfps_view.xml b/packages/SystemUI/res/layout/udfps_view.xml
|
||||||
|
index 0fcbfa161ddf..257d238f5c54 100644
|
||||||
|
--- a/packages/SystemUI/res/layout/udfps_view.xml
|
||||||
|
+++ b/packages/SystemUI/res/layout/udfps_view.xml
|
||||||
|
@@ -28,10 +28,4 @@
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
- <com.android.systemui.biometrics.UdfpsSurfaceView
|
||||||
|
- android:id="@+id/hbm_view"
|
||||||
|
- android:layout_width="match_parent"
|
||||||
|
- android:layout_height="match_parent"
|
||||||
|
- android:visibility="invisible"/>
|
||||||
|
-
|
||||||
|
</com.android.systemui.biometrics.UdfpsView>
|
||||||
|
diff --git a/packages/SystemUI/res/values/lineage_config.xml b/packages/SystemUI/res/values/lineage_config.xml
|
||||||
|
index 3b61502f551c..c7a73b79a5ec 100644
|
||||||
|
--- a/packages/SystemUI/res/values/lineage_config.xml
|
||||||
|
+++ b/packages/SystemUI/res/values/lineage_config.xml
|
||||||
|
@@ -19,9 +19,6 @@
|
||||||
|
<integer name="config_maxVisibleNotificationIcons">4</integer>
|
||||||
|
<integer name="config_maxVisibleNotificationIconsOnLock">3</integer>
|
||||||
|
|
||||||
|
- <!-- Color of the UDFPS pressed view -->
|
||||||
|
- <color name="config_udfpsColor">#ffffffff</color>
|
||||||
|
-
|
||||||
|
<!-- Doze: does the double tap sensor need a proximity check? -->
|
||||||
|
<bool name="doze_double_tap_proximity_check">false</bool>
|
||||||
|
|
||||||
|
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
|
||||||
|
index 699be662dd54..68e1f72d042a 100644
|
||||||
|
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
|
||||||
|
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
|
||||||
|
@@ -847,7 +847,7 @@ public class AuthContainerView extends LinearLayout
|
||||||
|
final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
- WindowManager.LayoutParams.TYPE_DISPLAY_OVERLAY,
|
||||||
|
+ WindowManager.LayoutParams.TYPE_STATUS_BAR_ADDITIONAL,
|
||||||
|
windowFlags,
|
||||||
|
PixelFormat.TRANSLUCENT);
|
||||||
|
lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
|
||||||
|
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
|
||||||
|
index 6d1e958e21ad..8db4927ee059 100644
|
||||||
|
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
|
||||||
|
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
|
||||||
|
@@ -109,7 +109,7 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
|
||||||
|
private var overlayTouchListener: TouchExplorationStateChangeListener? = null
|
||||||
|
|
||||||
|
private val coreLayoutParams = WindowManager.LayoutParams(
|
||||||
|
- WindowManager.LayoutParams.TYPE_DISPLAY_OVERLAY,
|
||||||
|
+ WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG,
|
||||||
|
0 /* flags set in computeLayoutParams() */,
|
||||||
|
PixelFormat.TRANSLUCENT
|
||||||
|
).apply {
|
||||||
|
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
|
||||||
|
deleted file mode 100644
|
||||||
|
index 2488132b508b..000000000000
|
||||||
|
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,159 +0,0 @@
|
||||||
|
-/*
|
||||||
|
- * Copyright (C) 2021 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.annotation.NonNull;
|
||||||
|
-import android.annotation.Nullable;
|
||||||
|
-import android.content.Context;
|
||||||
|
-import android.graphics.drawable.Drawable;
|
||||||
|
-import android.graphics.Canvas;
|
||||||
|
-import android.graphics.Paint;
|
||||||
|
-import android.graphics.PixelFormat;
|
||||||
|
-import android.graphics.RectF;
|
||||||
|
-import android.util.AttributeSet;
|
||||||
|
-import android.util.Log;
|
||||||
|
-import android.view.Surface;
|
||||||
|
-import android.view.SurfaceHolder;
|
||||||
|
-import android.view.SurfaceView;
|
||||||
|
-
|
||||||
|
-import com.android.systemui.R;
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * Surface View for providing the Global High-Brightness Mode (GHBM) illumination for UDFPS.
|
||||||
|
- */
|
||||||
|
-public class UdfpsSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
|
||||||
|
- private static final String TAG = "UdfpsSurfaceView";
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
- * Notifies {@link UdfpsView} when to enable GHBM illumination.
|
||||||
|
- */
|
||||||
|
- interface GhbmIlluminationListener {
|
||||||
|
- /**
|
||||||
|
- * @param surface the surface for which GHBM should be enabled.
|
||||||
|
- * @param onDisplayConfigured a runnable that should be run after GHBM is enabled.
|
||||||
|
- */
|
||||||
|
- void enableGhbm(@NonNull Surface surface, @Nullable Runnable onDisplayConfigured);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @NonNull private final SurfaceHolder mHolder;
|
||||||
|
- @NonNull private final Paint mSensorPaint;
|
||||||
|
-
|
||||||
|
- @Nullable private GhbmIlluminationListener mGhbmIlluminationListener;
|
||||||
|
- @Nullable private Runnable mOnDisplayConfigured;
|
||||||
|
- boolean mAwaitingSurfaceToStartIllumination;
|
||||||
|
- boolean mHasValidSurface;
|
||||||
|
-
|
||||||
|
- private Drawable mUdfpsIconPressed;
|
||||||
|
-
|
||||||
|
- public UdfpsSurfaceView(Context context, AttributeSet attrs) {
|
||||||
|
- super(context, attrs);
|
||||||
|
-
|
||||||
|
- // Make this SurfaceView draw on top of everything else in this window. This allows us to
|
||||||
|
- // 1) Always show the HBM circle on top of everything else, and
|
||||||
|
- // 2) Properly composite this view with any other animations in the same window no matter
|
||||||
|
- // what contents are added in which order to this view hierarchy.
|
||||||
|
- setZOrderOnTop(true);
|
||||||
|
-
|
||||||
|
- mHolder = getHolder();
|
||||||
|
- mHolder.addCallback(this);
|
||||||
|
- mHolder.setFormat(PixelFormat.RGBA_8888);
|
||||||
|
-
|
||||||
|
- mSensorPaint = new Paint(0 /* flags */);
|
||||||
|
- mSensorPaint.setAntiAlias(true);
|
||||||
|
- mSensorPaint.setColor(context.getColor(R.color.config_udfpsColor));
|
||||||
|
- mSensorPaint.setStyle(Paint.Style.FILL);
|
||||||
|
-
|
||||||
|
- mUdfpsIconPressed = context.getDrawable(R.drawable.udfps_icon_pressed);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override public void surfaceCreated(SurfaceHolder holder) {
|
||||||
|
- mHasValidSurface = true;
|
||||||
|
- if (mAwaitingSurfaceToStartIllumination) {
|
||||||
|
- doIlluminate(mOnDisplayConfigured);
|
||||||
|
- mOnDisplayConfigured = null;
|
||||||
|
- mAwaitingSurfaceToStartIllumination = false;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override
|
||||||
|
- public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||||
|
- // Unused.
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- @Override public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
|
- mHasValidSurface = false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- void setGhbmIlluminationListener(@Nullable GhbmIlluminationListener listener) {
|
||||||
|
- mGhbmIlluminationListener = listener;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
- * Note: there is no corresponding method to stop GHBM illumination. It is expected that
|
||||||
|
- * {@link UdfpsView} will hide this view, which would destroy the surface and remove the
|
||||||
|
- * illumination dot.
|
||||||
|
- */
|
||||||
|
- void startGhbmIllumination(@Nullable Runnable onDisplayConfigured) {
|
||||||
|
- if (mGhbmIlluminationListener == null) {
|
||||||
|
- Log.e(TAG, "startIllumination | mGhbmIlluminationListener is null");
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (mHasValidSurface) {
|
||||||
|
- doIlluminate(onDisplayConfigured);
|
||||||
|
- } else {
|
||||||
|
- mAwaitingSurfaceToStartIllumination = true;
|
||||||
|
- mOnDisplayConfigured = onDisplayConfigured;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- private void doIlluminate(@Nullable Runnable onDisplayConfigured) {
|
||||||
|
- if (mGhbmIlluminationListener == null) {
|
||||||
|
- Log.e(TAG, "doIlluminate | mGhbmIlluminationListener is null");
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- mGhbmIlluminationListener.enableGhbm(mHolder.getSurface(), onDisplayConfigured);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /**
|
||||||
|
- * Immediately draws the illumination dot on this SurfaceView's surface.
|
||||||
|
- */
|
||||||
|
- void drawIlluminationDot(@NonNull RectF sensorRect) {
|
||||||
|
- if (!mHasValidSurface) {
|
||||||
|
- Log.e(TAG, "drawIlluminationDot | the surface is destroyed or was never created.");
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- Canvas canvas = null;
|
||||||
|
- try {
|
||||||
|
- canvas = mHolder.lockCanvas();
|
||||||
|
- mUdfpsIconPressed.setBounds(
|
||||||
|
- Math.round(sensorRect.left),
|
||||||
|
- Math.round(sensorRect.top),
|
||||||
|
- Math.round(sensorRect.right),
|
||||||
|
- Math.round(sensorRect.bottom)
|
||||||
|
- );
|
||||||
|
- mUdfpsIconPressed.draw(canvas);
|
||||||
|
- canvas.drawOval(sensorRect, mSensorPaint);
|
||||||
|
- } finally {
|
||||||
|
- // Make sure the surface is never left in a bad state.
|
||||||
|
- if (canvas != null) {
|
||||||
|
- mHolder.unlockCanvasAndPost(canvas);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
|
||||||
|
index 97590822a3fb..4a8877edfa53 100644
|
||||||
|
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
|
||||||
|
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
|
||||||
|
@@ -25,7 +25,6 @@ import android.graphics.RectF
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.util.Log
|
||||||
|
import android.view.MotionEvent
|
||||||
|
-import android.view.Surface
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
import com.android.systemui.R
|
||||||
|
import com.android.systemui.doze.DozeReceiver
|
||||||
|
@@ -61,8 +60,6 @@ class UdfpsView(
|
||||||
|
a.getFloat(R.styleable.UdfpsView_sensorTouchAreaCoefficient, 0f)
|
||||||
|
}
|
||||||
|
|
||||||
|
- private var ghbmView: UdfpsSurfaceView? = null
|
||||||
|
-
|
||||||
|
/** View controller (can be different for enrollment, BiometricPrompt, Keyguard, etc.). */
|
||||||
|
var animationViewController: UdfpsAnimationViewController<*>? = null
|
||||||
|
|
||||||
|
@@ -89,10 +86,6 @@ class UdfpsView(
|
||||||
|
return (animationViewController == null || !animationViewController!!.shouldPauseAuth())
|
||||||
|
}
|
||||||
|
|
||||||
|
- override fun onFinishInflate() {
|
||||||
|
- ghbmView = findViewById(R.id.hbm_view)
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
override fun dozeTimeTick() {
|
||||||
|
animationViewController?.dozeTimeTick()
|
||||||
|
}
|
||||||
|
@@ -160,34 +153,12 @@ class UdfpsView(
|
||||||
|
fun configureDisplay(onDisplayConfigured: Runnable) {
|
||||||
|
isDisplayConfigured = true
|
||||||
|
animationViewController?.onDisplayConfiguring()
|
||||||
|
- val gView = ghbmView
|
||||||
|
- if (gView != null) {
|
||||||
|
- gView.setGhbmIlluminationListener(this::doIlluminate)
|
||||||
|
- gView.visibility = VISIBLE
|
||||||
|
- gView.startGhbmIllumination(onDisplayConfigured)
|
||||||
|
- } else {
|
||||||
|
- doIlluminate(null /* surface */, onDisplayConfigured)
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- private fun doIlluminate(surface: Surface?, onDisplayConfigured: Runnable?) {
|
||||||
|
- if (ghbmView != null && surface == null) {
|
||||||
|
- Log.e(TAG, "doIlluminate | surface must be non-null for GHBM")
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- mUdfpsDisplayMode?.enable {
|
||||||
|
- onDisplayConfigured?.run()
|
||||||
|
- ghbmView?.drawIlluminationDot(RectF(sensorRect))
|
||||||
|
- }
|
||||||
|
+ mUdfpsDisplayMode?.enable(onDisplayConfigured)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun unconfigureDisplay() {
|
||||||
|
isDisplayConfigured = false
|
||||||
|
animationViewController?.onDisplayUnconfigured()
|
||||||
|
- ghbmView?.let { view ->
|
||||||
|
- view.setGhbmIlluminationListener(null)
|
||||||
|
- view.visibility = INVISIBLE
|
||||||
|
- }
|
||||||
|
mUdfpsDisplayMode?.disable(null /* onDisabled */)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
From f0b54d18cd3c7382f230bedb198177c68e2bb3b2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Fri, 10 Jun 2022 21:33:47 +0800
|
||||||
|
Subject: [PATCH 2/2] Revert "Biometrics: Allow disabling of fingerprint
|
||||||
|
cleanups"
|
||||||
|
|
||||||
|
This reverts commit 87f04da03724b26f64b78e628f171e4bc4b20673.
|
||||||
|
|
||||||
|
Change-Id: Iacbb74e392122c5c072251b8153367f7ee3e8aaf
|
||||||
|
---
|
||||||
|
.../sensors/fingerprint/hidl/Fingerprint21.java | 8 --------
|
||||||
|
1 file changed, 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
|
||||||
|
index 02353bc01c79..c1a86386dfd4 100644
|
||||||
|
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
|
||||||
|
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
|
||||||
|
@@ -128,8 +128,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
|
||||||
|
private final int mSensorId;
|
||||||
|
private final boolean mIsPowerbuttonFps;
|
||||||
|
|
||||||
|
- private boolean mCleanup;
|
||||||
|
-
|
||||||
|
private final class BiometricTaskStackListener extends TaskStackListener {
|
||||||
|
@Override
|
||||||
|
public void onTaskStackChanged() {
|
||||||
|
@@ -351,9 +349,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
|
||||||
|
mCurrentUserId = UserHandle.USER_NULL;
|
||||||
|
});
|
||||||
|
|
||||||
|
- mCleanup = context.getResources().getBoolean(
|
||||||
|
- org.lineageos.platform.internal.R.bool.config_cleanupUnusedFingerprints);
|
||||||
|
-
|
||||||
|
try {
|
||||||
|
ActivityManager.getService().registerUserSwitchObserver(mUserSwitchObserver, TAG);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
@@ -739,9 +734,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
|
||||||
|
|
||||||
|
private void scheduleInternalCleanup(int userId,
|
||||||
|
@Nullable ClientMonitorCallback callback) {
|
||||||
|
- if (!mCleanup) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
mHandler.post(() -> {
|
||||||
|
scheduleUpdateActiveUserWithoutHandler(userId);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
From 7c185420e60e45008f9308b676923e45a56f8505 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Wed, 11 Jan 2023 11:59:05 +0000
|
||||||
|
Subject: [PATCH 1/2] Revert "CompositionEngine: Request device composition for
|
||||||
|
the Udfps touched layer"
|
||||||
|
|
||||||
|
This reverts commit c2a0b2db8e69b403478379351d4aabf751829c9c.
|
||||||
|
---
|
||||||
|
.../CompositionEngine/src/Output.cpp | 16 +---------------
|
||||||
|
1 file changed, 1 insertion(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
|
||||||
|
index d17ddd9df6..b724daa8ce 100644
|
||||||
|
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
|
||||||
|
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
|
||||||
|
@@ -22,7 +22,6 @@
|
||||||
|
#include <compositionengine/LayerFE.h>
|
||||||
|
#include <compositionengine/LayerFECompositionState.h>
|
||||||
|
#include <compositionengine/RenderSurface.h>
|
||||||
|
-#include <compositionengine/UdfpsExtension.h>
|
||||||
|
#include <compositionengine/impl/HwcAsyncWorker.h>
|
||||||
|
#include <compositionengine/impl/Output.h>
|
||||||
|
#include <compositionengine/impl/OutputCompositionState.h>
|
||||||
|
@@ -836,10 +835,7 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr
|
||||||
|
|
||||||
|
compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition() const {
|
||||||
|
compositionengine::OutputLayer* layerRequestingBgComposition = nullptr;
|
||||||
|
- for (size_t i = 0; i < getOutputLayerCount(); i++) {
|
||||||
|
- compositionengine::OutputLayer* layer = getOutputLayerOrderedByZByIndex(i);
|
||||||
|
- compositionengine::OutputLayer* nextLayer = getOutputLayerOrderedByZByIndex(i + 1);
|
||||||
|
-
|
||||||
|
+ for (auto* layer : getOutputLayersOrderedByZ()) {
|
||||||
|
auto* compState = layer->getLayerFE().getCompositionState();
|
||||||
|
|
||||||
|
// If any layer has a sideband stream, we will disable blurs. In that case, we don't
|
||||||
|
@@ -853,16 +849,6 @@ compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition
|
||||||
|
if (compState->backgroundBlurRadius > 0 || compState->blurRegions.size() > 0) {
|
||||||
|
layerRequestingBgComposition = layer;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- // If the next layer is the Udfps touched layer, enable client composition for it
|
||||||
|
- // because that somehow leads to the Udfps touched layer getting device composition
|
||||||
|
- // consistently.
|
||||||
|
- if ((nextLayer != nullptr && layerRequestingBgComposition == nullptr) &&
|
||||||
|
- (strncmp(nextLayer->getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
|
||||||
|
- strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0)) {
|
||||||
|
- layerRequestingBgComposition = layer;
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
return layerRequestingBgComposition;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
+157
@@ -0,0 +1,157 @@
|
|||||||
|
From 274dbe335d658a429bdd3b266b94d739dc77bedd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Wed, 11 Jan 2023 11:59:35 +0000
|
||||||
|
Subject: [PATCH 2/2] Revert "surfaceflinger: Add support for Udfps extension
|
||||||
|
lib"
|
||||||
|
|
||||||
|
This reverts commit 76874f54f1fa7517361fd1817044a5d0bbfa9ade.
|
||||||
|
---
|
||||||
|
.../CompositionEngine/Android.bp | 14 +--------
|
||||||
|
.../compositionengine/UdfpsExtension.h | 29 -------------------
|
||||||
|
.../CompositionEngine/src/OutputLayer.cpp | 13 +--------
|
||||||
|
.../CompositionEngine/src/UdfpsExtension.cpp | 27 -----------------
|
||||||
|
4 files changed, 2 insertions(+), 81 deletions(-)
|
||||||
|
delete mode 100644 services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
|
||||||
|
delete mode 100644 services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
|
||||||
|
|
||||||
|
diff --git a/services/surfaceflinger/CompositionEngine/Android.bp b/services/surfaceflinger/CompositionEngine/Android.bp
|
||||||
|
index abc3478313..11a9e19db8 100644
|
||||||
|
--- a/services/surfaceflinger/CompositionEngine/Android.bp
|
||||||
|
+++ b/services/surfaceflinger/CompositionEngine/Android.bp
|
||||||
|
@@ -59,10 +59,7 @@ cc_defaults {
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libcompositionengine",
|
||||||
|
- defaults: [
|
||||||
|
- "libcompositionengine_defaults",
|
||||||
|
- "surfaceflinger_udfps_lib_defaults",
|
||||||
|
- ],
|
||||||
|
+ defaults: ["libcompositionengine_defaults"],
|
||||||
|
srcs: [
|
||||||
|
"src/planner/CachedSet.cpp",
|
||||||
|
"src/planner/Flattener.cpp",
|
||||||
|
@@ -84,7 +81,6 @@ cc_library {
|
||||||
|
"src/OutputLayer.cpp",
|
||||||
|
"src/OutputLayerCompositionState.cpp",
|
||||||
|
"src/RenderSurface.cpp",
|
||||||
|
- "src/UdfpsExtension.cpp",
|
||||||
|
],
|
||||||
|
local_include_dirs: ["include"],
|
||||||
|
export_include_dirs: ["include"],
|
||||||
|
@@ -113,14 +109,6 @@ cc_library {
|
||||||
|
export_include_dirs: ["include"],
|
||||||
|
}
|
||||||
|
|
||||||
|
-cc_library_static {
|
||||||
|
- name: "surfaceflinger_udfps_lib",
|
||||||
|
- srcs: [
|
||||||
|
- "src/UdfpsExtension.cpp",
|
||||||
|
- ],
|
||||||
|
- export_include_dirs: ["include"],
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
cc_test {
|
||||||
|
name: "libcompositionengine_test",
|
||||||
|
test_suites: ["device-tests"],
|
||||||
|
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
|
||||||
|
deleted file mode 100644
|
||||||
|
index 4306cb4a02..0000000000
|
||||||
|
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,29 +0,0 @@
|
||||||
|
-/*
|
||||||
|
- * Copyright 2021-2022 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.
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
-#include <stdint.h>
|
||||||
|
-
|
||||||
|
-#ifndef __UDFPS_EXTENSION__H__
|
||||||
|
-#define __UDFPS_EXTENSION__H__
|
||||||
|
-
|
||||||
|
-#define UDFPS_BIOMETRIC_PROMPT_LAYER_NAME "BiometricPrompt"
|
||||||
|
-#define UDFPS_LAYER_NAME "UdfpsControllerOverlay"
|
||||||
|
-#define UDFPS_TOUCHED_LAYER_NAME "SurfaceView[UdfpsControllerOverlay](BLAST)"
|
||||||
|
-
|
||||||
|
-extern uint32_t getUdfpsZOrder(uint32_t z, bool touched);
|
||||||
|
-extern uint64_t getUdfpsUsageBits(uint64_t usageBits, bool touched);
|
||||||
|
-
|
||||||
|
-#endif /* __UDFPS_EXTENSION__H__ */
|
||||||
|
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
|
||||||
|
index 2129dfed29..1bb9d0eb63 100644
|
||||||
|
--- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
|
||||||
|
+++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
|
||||||
|
@@ -19,7 +19,6 @@
|
||||||
|
#include <compositionengine/DisplayColorProfile.h>
|
||||||
|
#include <compositionengine/LayerFECompositionState.h>
|
||||||
|
#include <compositionengine/Output.h>
|
||||||
|
-#include <compositionengine/UdfpsExtension.h>
|
||||||
|
#include <compositionengine/impl/HwcBufferCache.h>
|
||||||
|
#include <compositionengine/impl/OutputCompositionState.h>
|
||||||
|
#include <compositionengine/impl/OutputLayer.h>
|
||||||
|
@@ -442,17 +441,7 @@ void OutputLayer::writeOutputDependentGeometryStateToHWC(HWC2::Layer* hwcLayer,
|
||||||
|
sourceCrop.bottom, to_string(error).c_str(), static_cast<int32_t>(error));
|
||||||
|
}
|
||||||
|
|
||||||
|
- uint32_t z_udfps = z;
|
||||||
|
- if ((strncmp(getLayerFE().getDebugName(), UDFPS_LAYER_NAME, strlen(UDFPS_LAYER_NAME)) == 0) ||
|
||||||
|
- (strncmp(getLayerFE().getDebugName(), UDFPS_BIOMETRIC_PROMPT_LAYER_NAME,
|
||||||
|
- strlen(UDFPS_BIOMETRIC_PROMPT_LAYER_NAME)) == 0)) {
|
||||||
|
- z_udfps = getUdfpsZOrder(z, false);
|
||||||
|
- } else if (strncmp(getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
|
||||||
|
- strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0) {
|
||||||
|
- z_udfps = getUdfpsZOrder(z, true);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (auto error = hwcLayer->setZOrder(z_udfps); error != hal::Error::NONE) {
|
||||||
|
+ if (auto error = hwcLayer->setZOrder(z); error != hal::Error::NONE) {
|
||||||
|
ALOGE("[%s] Failed to set Z %u: %s (%d)", getLayerFE().getDebugName(), z,
|
||||||
|
to_string(error).c_str(), static_cast<int32_t>(error));
|
||||||
|
}
|
||||||
|
diff --git a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp b/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
|
||||||
|
deleted file mode 100644
|
||||||
|
index 2d9d086dd2..0000000000
|
||||||
|
--- a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,27 +0,0 @@
|
||||||
|
-/*
|
||||||
|
- * Copyright 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.
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
-#ifndef TARGET_PROVIDES_UDFPS_LIB
|
||||||
|
-#include <compositionengine/UdfpsExtension.h>
|
||||||
|
-
|
||||||
|
-uint32_t getUdfpsZOrder(uint32_t z, __unused bool touched) {
|
||||||
|
- return z;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-uint64_t getUdfpsUsageBits(uint64_t usageBits, __unused bool touched) {
|
||||||
|
- return usageBits;
|
||||||
|
-}
|
||||||
|
-#endif
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
From 23a01464fda098e3ec51ea34aaf040582dd98aaa Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
||||||
|
Date: Sun, 13 Aug 2023 16:00:17 +0800
|
||||||
|
Subject: [PATCH] Revert "gd: hci: Allow disabling selected local commands"
|
||||||
|
|
||||||
|
This reverts commit 2b932ba1ef8d2cafde548d7efa2c977a21eb0547.
|
||||||
|
---
|
||||||
|
system/gd/hci/controller.cc | 14 --------------
|
||||||
|
1 file changed, 14 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
|
||||||
|
index 10023e3dd9..18f881369e 100644
|
||||||
|
--- a/system/gd/hci/controller.cc
|
||||||
|
+++ b/system/gd/hci/controller.cc
|
||||||
|
@@ -16,7 +16,6 @@
|
||||||
|
|
||||||
|
#include "hci/controller.h"
|
||||||
|
|
||||||
|
-#include <android-base/strings.h>
|
||||||
|
#include <future>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
@@ -26,14 +25,10 @@
|
||||||
|
#include "hci/hci_layer.h"
|
||||||
|
#include "hci_controller_generated.h"
|
||||||
|
#include "os/metrics.h"
|
||||||
|
-#include "os/system_properties.h"
|
||||||
|
|
||||||
|
namespace bluetooth {
|
||||||
|
namespace hci {
|
||||||
|
|
||||||
|
-static const char kPropertyDisabledCommands[] =
|
||||||
|
- "bluetooth.hci.disabled_commands";
|
||||||
|
-
|
||||||
|
using os::Handler;
|
||||||
|
|
||||||
|
struct Controller::impl {
|
||||||
|
@@ -265,15 +260,6 @@ struct Controller::impl {
|
||||||
|
ErrorCode status = complete_view.GetStatus();
|
||||||
|
ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
|
||||||
|
local_supported_commands_ = complete_view.GetSupportedCommands();
|
||||||
|
-
|
||||||
|
- if (auto disabledCommands = os::GetSystemProperty(kPropertyDisabledCommands)) {
|
||||||
|
- for (const auto& command : android::base::Split(*disabledCommands, ",")) {
|
||||||
|
- uint16_t index = std::stoi(command);
|
||||||
|
- uint16_t byte_index = index / 10;
|
||||||
|
- uint16_t bit_index = index % 10;
|
||||||
|
- local_supported_commands_[byte_index] &= ~(1 << bit_index);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
|
||||||
|
void read_local_extended_features_complete_handler(std::promise<void> promise, CommandCompleteView view) {
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
From 26b9c0d76d940676fc12d7f27c13180a4d4bd8e1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Wed, 27 Oct 2021 14:39:29 -0400
|
||||||
|
Subject: [PATCH 1/4] Disable vndklite handling
|
||||||
|
|
||||||
|
Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2
|
||||||
|
---
|
||||||
|
linker/linker.cpp | 5 -----
|
||||||
|
1 file changed, 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/linker/linker.cpp b/linker/linker.cpp
|
||||||
|
index 5df379936..ceaba7d95 100644
|
||||||
|
--- a/linker/linker.cpp
|
||||||
|
+++ b/linker/linker.cpp
|
||||||
|
@@ -93,7 +93,6 @@ static uint64_t g_module_unload_counter = 0;
|
||||||
|
static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_STRING ".txt";
|
||||||
|
|
||||||
|
static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt";
|
||||||
|
-static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt";
|
||||||
|
|
||||||
|
static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt";
|
||||||
|
|
||||||
|
@@ -3436,10 +3435,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string get_ld_config_file_vndk_path() {
|
||||||
|
- if (android::base::GetBoolProperty("ro.vndk.lite", false)) {
|
||||||
|
- return kLdConfigVndkLiteFilePath;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
std::string ld_config_file_vndk = kLdConfigFilePath;
|
||||||
|
size_t insert_pos = ld_config_file_vndk.find_last_of('.');
|
||||||
|
if (insert_pos == std::string::npos) {
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
From 1a8eee6d2a1d79412902331b74283eec77414c6b Mon Sep 17 00:00:00 2001
|
From 3cc1f7f548906eaac5f7347c897494fc10ad6aa9 Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Sat, 19 Feb 2022 08:20:25 -0500
|
Date: Sat, 19 Feb 2022 08:20:25 -0500
|
||||||
Subject: [PATCH 1/2] Add new mechanism to fake vendor props on a per-process
|
Subject: [PATCH 2/4] Add new mechanism to fake vendor props on a per-process
|
||||||
basis
|
basis
|
||||||
|
|
||||||
This reads debug.phh.props.<process name>. If its value is "vendor",
|
This reads debug.phh.props.<process name>. If its value is "vendor",
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
From ad25fd64270b2c3dc9fbce5e97c2eb75d63f015b Mon Sep 17 00:00:00 2001
|
From 8b21b5d2efbe2d2c7966885342ed093a43f74af9 Mon Sep 17 00:00:00 2001
|
||||||
From: Pierre-Hugues Husson <phh@phh.me>
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
Date: Thu, 19 Jan 2023 16:44:01 -0500
|
Date: Thu, 19 Jan 2023 16:44:01 -0500
|
||||||
Subject: [PATCH 2/2] Rework property overriding
|
Subject: [PATCH 3/4] Rework property overriding
|
||||||
|
|
||||||
- Support property read with callback in addition to previous
|
- Support property read with callback in addition to previous
|
||||||
constant-size property_get
|
constant-size property_get
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
From b9ad9ef613bcc1c7fb7713b5091e98343669d393 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sun, 28 May 2023 16:46:46 -0400
|
||||||
|
Subject: [PATCH 4/4] Add some properties to fake in "keymaster" prop
|
||||||
|
replacement mode, to expose unlocked vbmeta state and orange
|
||||||
|
verifiedbootstate
|
||||||
|
|
||||||
|
---
|
||||||
|
libc/system_properties/system_properties.cpp | 6 ++++++
|
||||||
|
1 file changed, 6 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
|
||||||
|
index 40ff48bad..057199318 100644
|
||||||
|
--- a/libc/system_properties/system_properties.cpp
|
||||||
|
+++ b/libc/system_properties/system_properties.cpp
|
||||||
|
@@ -121,6 +121,12 @@ static const char* redirectToProp(const char *name) {
|
||||||
|
if(strcmp(name, "ro.build.version.security_patch") == 0) {
|
||||||
|
return "ro.keymaster.xxx.security_patch";
|
||||||
|
}
|
||||||
|
+ if(strcmp(name, "ro.boot.vbmeta.device_state") == 0) {
|
||||||
|
+ return "ro.keymaster.xxx.vbmeta_state";
|
||||||
|
+ }
|
||||||
|
+ if(strcmp(name, "ro.boot.verifiedbootstate") == 0) {
|
||||||
|
+ return "ro.keymaster.xxx.verifiedbootstate";
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
From edee230e9ff11d779322b76646aa5b7e48e10ab9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Thu, 12 Sep 2019 20:31:07 +0200
|
||||||
|
Subject: [PATCH] Don't reboot if we couldn't get bootctrl
|
||||||
|
|
||||||
|
Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af
|
||||||
|
---
|
||||||
|
update_verifier/update_verifier.cpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
|
||||||
|
index a042f900..ea3645af 100644
|
||||||
|
--- a/update_verifier/update_verifier.cpp
|
||||||
|
+++ b/update_verifier/update_verifier.cpp
|
||||||
|
@@ -310,7 +310,7 @@ int update_verifier(int argc, char** argv) {
|
||||||
|
sp<IBootControl> module = IBootControl::getService();
|
||||||
|
if (module == nullptr) {
|
||||||
|
LOG(ERROR) << "Error getting bootctrl module.";
|
||||||
|
- return reboot_device();
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t current_slot = module->getCurrentSlot();
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
From 3127d705a0024e37f94174b17b94cf2fb331e7e4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: sooti <sooti85@gmail.com>
|
||||||
|
Date: Tue, 12 Oct 2021 14:32:52 +0300
|
||||||
|
Subject: [PATCH 1/5] build: remove emulator crap from GSI
|
||||||
|
|
||||||
|
Change-Id: Id45f3ff1d31e3d4492f956e68a1eb4b2fb82ce63
|
||||||
|
---
|
||||||
|
target/product/emulator.mk | 6 +++---
|
||||||
|
target/product/emulator_vendor.mk | 6 +++---
|
||||||
|
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/target/product/emulator.mk b/target/product/emulator.mk
|
||||||
|
index 36da1f7034..1497c061fc 100644
|
||||||
|
--- a/target/product/emulator.mk
|
||||||
|
+++ b/target/product/emulator.mk
|
||||||
|
@@ -36,7 +36,7 @@ PRODUCT_PACKAGES += \
|
||||||
|
|
||||||
|
PRODUCT_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
|
||||||
|
|
||||||
|
-PRODUCT_CHARACTERISTICS := emulator
|
||||||
|
+# PRODUCT_CHARACTERISTICS := emulator
|
||||||
|
|
||||||
|
PRODUCT_FULL_TREBLE_OVERRIDE := true
|
||||||
|
|
||||||
|
@@ -56,5 +56,5 @@ PRODUCT_SYSTEM_EXT_PROPERTIES += \
|
||||||
|
ro.com.google.locationfeatures=1
|
||||||
|
|
||||||
|
# disable setupwizard
|
||||||
|
-PRODUCT_SYSTEM_EXT_PROPERTIES += \
|
||||||
|
- ro.setupwizard.mode=DISABLED
|
||||||
|
+# PRODUCT_SYSTEM_EXT_PROPERTIES += \
|
||||||
|
+# ro.setupwizard.mode=DISABLED
|
||||||
|
diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk
|
||||||
|
index f71b275b0e..62984253f3 100644
|
||||||
|
--- a/target/product/emulator_vendor.mk
|
||||||
|
+++ b/target/product/emulator_vendor.mk
|
||||||
|
@@ -28,7 +28,7 @@ PRODUCT_PACKAGES += \
|
||||||
|
|
||||||
|
DEVICE_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
|
||||||
|
|
||||||
|
-PRODUCT_CHARACTERISTICS := emulator
|
||||||
|
+# PRODUCT_CHARACTERISTICS := emulator
|
||||||
|
|
||||||
|
PRODUCT_FULL_TREBLE_OVERRIDE := true
|
||||||
|
|
||||||
|
@@ -48,5 +48,5 @@ PRODUCT_SYSTEM_EXT_PROPERTIES += \
|
||||||
|
ro.com.google.locationfeatures=1
|
||||||
|
|
||||||
|
# disable setupwizard
|
||||||
|
-PRODUCT_SYSTEM_EXT_PROPERTIES += \
|
||||||
|
- ro.setupwizard.mode?=DISABLED
|
||||||
|
+# PRODUCT_SYSTEM_EXT_PROPERTIES += \
|
||||||
|
+# ro.setupwizard.mode?=DISABLED
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
From 5f354b54b48358256e5f6251939edfaa1d4127ff Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alberto Ponces <ponces26@gmail.com>
|
||||||
|
Date: Mon, 18 Oct 2021 17:20:18 +0100
|
||||||
|
Subject: [PATCH 2/5] build: Bypass vendor calls
|
||||||
|
|
||||||
|
Change-Id: I69830d6264356dadd7b037553a899a4eb3d211f1
|
||||||
|
---
|
||||||
|
target/product/aosp_arm64.mk | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
|
||||||
|
index 01897b77d2..a0a7c0d2fc 100644
|
||||||
|
--- a/target/product/aosp_arm64.mk
|
||||||
|
+++ b/target/product/aosp_arm64.mk
|
||||||
|
@@ -51,9 +51,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
|
||||||
|
#
|
||||||
|
# All components inherited here go to vendor or vendor_boot image
|
||||||
|
#
|
||||||
|
-$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk)
|
||||||
|
-$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk)
|
||||||
|
-$(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk)
|
||||||
|
+#$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk)
|
||||||
|
+#$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk)
|
||||||
|
+#$(call inherit-product, $(SRC_TARGET_DIR)/product/non_ab_device.mk)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Special settings for GSI releasing
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
From afc71434499293e37cfd831f1d7a434c6ab3251f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Mon, 9 Apr 2018 00:19:49 +0200
|
||||||
|
Subject: [PATCH 01/10] Increase default log_level to get actual selinux error
|
||||||
|
in kmsg
|
||||||
|
|
||||||
|
---
|
||||||
|
secilc/secilc.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/secilc/secilc.c b/secilc/secilc.c
|
||||||
|
index 80d3583d..a51630b2 100644
|
||||||
|
--- a/secilc/secilc.c
|
||||||
|
+++ b/secilc/secilc.c
|
||||||
|
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
|
||||||
|
int opt_index = 0;
|
||||||
|
char *fc_buf = NULL;
|
||||||
|
size_t fc_size;
|
||||||
|
- enum cil_log_level log_level = CIL_ERR;
|
||||||
|
+ enum cil_log_level log_level = CIL_WARN;
|
||||||
|
static struct option long_opts[] = {
|
||||||
|
{"help", no_argument, 0, 'h'},
|
||||||
|
{"verbose", no_argument, 0, 'v'},
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
From 440307f9bb3e44d9c4eb8f6fcae4e495e1336d0b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Wed, 9 Sep 2020 22:36:42 +0200
|
||||||
|
Subject: [PATCH 02/10] Revert "libsepol: Make an unknown permission an error
|
||||||
|
in CIL"
|
||||||
|
|
||||||
|
This reverts commit dc4e54126bf25dea4d51820922ccd1959be68fbc.
|
||||||
|
|
||||||
|
This is required because some targets calls undefined permissions:
|
||||||
|
- Realme X2 Pro calls sigcont
|
||||||
|
- Honor 7X calls perf_event
|
||||||
|
---
|
||||||
|
libsepol/cil/src/cil_resolve_ast.c | 12 ++++++++----
|
||||||
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
|
||||||
|
index 69a8a2ed..b63c1359 100644
|
||||||
|
--- a/libsepol/cil/src/cil_resolve_ast.c
|
||||||
|
+++ b/libsepol/cil/src/cil_resolve_ast.c
|
||||||
|
@@ -136,14 +136,18 @@ static int __cil_resolve_perms(symtab_t *class_symtab, symtab_t *common_symtab,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rc != SEPOL_OK) {
|
||||||
|
+ struct cil_list *empty_list;
|
||||||
|
if (class_flavor == CIL_MAP_CLASS) {
|
||||||
|
cil_log(CIL_ERR, "Failed to resolve permission %s for map class\n", (char*)curr->data);
|
||||||
|
- } else {
|
||||||
|
- cil_log(CIL_ERR, "Failed to resolve permission %s\n", (char*)curr->data);
|
||||||
|
+ goto exit;
|
||||||
|
}
|
||||||
|
- goto exit;
|
||||||
|
+ cil_log(CIL_WARN, "Failed to resolve permission %s\n", (char*)curr->data);
|
||||||
|
+ /* Use an empty list to represent unknown perm */
|
||||||
|
+ cil_list_init(&empty_list, perm_strs->flavor);
|
||||||
|
+ cil_list_append(*perm_datums, CIL_LIST, empty_list);
|
||||||
|
+ } else {
|
||||||
|
+ cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
|
||||||
|
}
|
||||||
|
- cil_list_append(*perm_datums, CIL_DATUM, perm_datum);
|
||||||
|
} else {
|
||||||
|
cil_list_append(*perm_datums, curr->flavor, curr->data);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+116
@@ -0,0 +1,116 @@
|
|||||||
|
From c9a0c6be08c1c5ada6a4b83beefd66946fe4a06c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Wed, 31 Mar 2021 23:32:37 +0200
|
||||||
|
Subject: [PATCH 03/10] Workaround device/phh/treble conflict with SELinux
|
||||||
|
policy
|
||||||
|
|
||||||
|
device/phh/treble defines the following three types (hostapd,
|
||||||
|
sysfs_usb_supply, rpmb_device)
|
||||||
|
However, Qualcomm Samsung Android 11 devices export those symbols as
|
||||||
|
typealias.
|
||||||
|
Type and typealias are fundamentally not mergeable.
|
||||||
|
Luckily, Samsung doesn't do anything with those typealias, so we can
|
||||||
|
simply ignore them.
|
||||||
|
---
|
||||||
|
libsepol/cil/src/cil_binary.c | 8 ++++++--
|
||||||
|
libsepol/cil/src/cil_build_ast.c | 11 +++++++++--
|
||||||
|
libsepol/cil/src/cil_resolve_ast.c | 15 +++++++++++++--
|
||||||
|
3 files changed, 28 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c
|
||||||
|
index 53017e2d..7f2c2e68 100644
|
||||||
|
--- a/libsepol/cil/src/cil_binary.c
|
||||||
|
+++ b/libsepol/cil/src/cil_binary.c
|
||||||
|
@@ -511,13 +511,17 @@ int cil_typealias_to_policydb(policydb_t *pdb, struct cil_alias *cil_alias)
|
||||||
|
type_datum_init(sepol_alias);
|
||||||
|
|
||||||
|
rc = __cil_get_sepol_type_datum(pdb, DATUM(cil_alias->actual), &sepol_type);
|
||||||
|
- if (rc != SEPOL_OK) goto exit;
|
||||||
|
+ if (rc != SEPOL_OK) {
|
||||||
|
+ cil_log(CIL_ERR, "Failed at %s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__);
|
||||||
|
+ goto exit;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
sepol_alias->flavor = TYPE_TYPE;
|
||||||
|
|
||||||
|
key = cil_strdup(cil_alias->datum.fqn);
|
||||||
|
rc = symtab_insert(pdb, SYM_TYPES, key, sepol_alias, SCOPE_DECL, 0, NULL);
|
||||||
|
if (rc != SEPOL_OK) {
|
||||||
|
+ cil_log(CIL_ERR, "Failed at %s:%s:%d:%d\n", __FILE__, __FUNCTION__, __LINE__, rc);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
sepol_alias->s.value = sepol_type->s.value;
|
||||||
|
@@ -3904,7 +3908,7 @@ int __cil_node_to_policydb(struct cil_tree_node *node, void *extra_args)
|
||||||
|
|
||||||
|
exit:
|
||||||
|
if (rc != SEPOL_OK) {
|
||||||
|
- cil_tree_log(node, CIL_ERR, "Binary policy creation failed");
|
||||||
|
+ cil_tree_log(node, CIL_ERR, "Binary policy creation failed, for pass = %d, flavor = %d", pass, node->flavor);
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
|
||||||
|
index 5f9392d1..90f0fee6 100644
|
||||||
|
--- a/libsepol/cil/src/cil_build_ast.c
|
||||||
|
+++ b/libsepol/cil/src/cil_build_ast.c
|
||||||
|
@@ -116,7 +116,7 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke
|
||||||
|
|
||||||
|
rc = cil_symtab_insert(symtab, key, datum, node);
|
||||||
|
if (rc == SEPOL_EEXIST) {
|
||||||
|
- struct cil_symtab_datum *prev;
|
||||||
|
+ struct cil_symtab_datum *prev = NULL;
|
||||||
|
rc = cil_symtab_get_datum(symtab, key, &prev);
|
||||||
|
if (rc != SEPOL_OK) {
|
||||||
|
cil_log(CIL_ERR, "Re-declaration of %s %s, but previous declaration could not be found\n",cil_node_to_string(node), key);
|
||||||
|
@@ -129,7 +129,14 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke
|
||||||
|
cil_node_to_string(node), key);
|
||||||
|
cil_tree_log(node, CIL_ERR, "Previous declaration of %s",
|
||||||
|
cil_node_to_string(n));
|
||||||
|
- return SEPOL_ERR;
|
||||||
|
+ if(
|
||||||
|
+ strcmp(key, "sysfs_usb_supply") == 0 ||
|
||||||
|
+ strcmp(key, "hostapd") == 0 ||
|
||||||
|
+ strcmp(key, "rpmb_device") == 0) {
|
||||||
|
+ cil_log(CIL_ERR, "Ignoring...");
|
||||||
|
+ } else {
|
||||||
|
+ return SEPOL_ERR;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
/* multiple_decls is enabled and works for this datum type, add node */
|
||||||
|
cil_list_append(prev->nodes, CIL_NODE, node);
|
||||||
|
diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c
|
||||||
|
index b63c1359..87db4f81 100644
|
||||||
|
--- a/libsepol/cil/src/cil_resolve_ast.c
|
||||||
|
+++ b/libsepol/cil/src/cil_resolve_ast.c
|
||||||
|
@@ -517,7 +517,13 @@ int cil_resolve_aliasactual(struct cil_tree_node *current, void *extra_args, enu
|
||||||
|
}
|
||||||
|
if (FLAVOR(alias_datum) != alias_flavor) {
|
||||||
|
cil_log(CIL_ERR, "%s is not an alias\n",alias_datum->name);
|
||||||
|
- rc = SEPOL_ERR;
|
||||||
|
+ if(
|
||||||
|
+ strcmp(alias_datum->name, "hostapd") == 0 ||
|
||||||
|
+ strcmp(alias_datum->name, "sysfs_usb_supply") == 0 ||
|
||||||
|
+ strcmp(alias_datum->name, "rpmb_device") == 0)
|
||||||
|
+ rc = 0;
|
||||||
|
+ else
|
||||||
|
+ rc = SEPOL_ERR;
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -558,7 +564,12 @@ int cil_resolve_alias_to_actual(struct cil_tree_node *current, enum cil_flavor f
|
||||||
|
int limit = 2;
|
||||||
|
|
||||||
|
if (alias->actual == NULL) {
|
||||||
|
- cil_tree_log(current, CIL_ERR, "Alias declared but not used");
|
||||||
|
+ cil_tree_log(current, CIL_ERR, "Alias %s declared but not used", a1->datum.name);
|
||||||
|
+ if(
|
||||||
|
+ strcmp(a1->datum.name, "hostapd") == 0 ||
|
||||||
|
+ strcmp(a1->datum.name, "sysfs_usb_supply") == 0 ||
|
||||||
|
+ strcmp(a1->datum.name, "rpmb_device") == 0)
|
||||||
|
+ return SEPOL_OK;
|
||||||
|
return SEPOL_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
From e1a6a3213cbb41b7ad04f7b7a685e06a36bf0441 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Fri, 6 Sep 2019 15:07:25 +0200
|
||||||
|
Subject: [PATCH 04/10] Allow /devices/virtual/block/ genfscon conflict (seen
|
||||||
|
on Xiaomi Mi 9)
|
||||||
|
|
||||||
|
Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895
|
||||||
|
---
|
||||||
|
libsepol/cil/src/cil_post.c | 18 +++++++++++++++++-
|
||||||
|
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
||||||
|
index 09c02af9..5c0e99c3 100644
|
||||||
|
--- a/libsepol/cil/src/cil_post.c
|
||||||
|
+++ b/libsepol/cil/src/cil_post.c
|
||||||
|
@@ -491,7 +491,23 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a;
|
||||||
|
struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b;
|
||||||
|
- return context_compare(a_genfscon->context, b_genfscon->context);
|
||||||
|
+ int rc = context_compare(a_genfscon->context, b_genfscon->context);
|
||||||
|
+ if(rc) {
|
||||||
|
+ fprintf(stderr, "hello %s\n", a_genfscon->fs_str);
|
||||||
|
+ int bypass = 0;
|
||||||
|
+ /*
|
||||||
|
+ * This conflict has been seen on Xiaomi Mi 9:
|
||||||
|
+ * - AOSP Q says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0))))
|
||||||
|
+ * - stock rom says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_ufs_target ((s0) (s0))))
|
||||||
|
+ */
|
||||||
|
+ if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
||||||
|
+ bypass = 1;
|
||||||
|
+ if(bypass == 1) {
|
||||||
|
+ fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cil_post_netifcon_context_compare(const void *a, const void *b)
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
From 0a6fdcf14c157b55a8bd0e7dd82f2236e07dc37e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Thu, 12 Sep 2019 20:37:04 +0200
|
||||||
|
Subject: [PATCH 05/10] if service is "rcs", accept conflict. Seen on Moto E5
|
||||||
|
|
||||||
|
Change-Id: I0cc2d0fad83f403f2b5d7458039b1564ce5ed9dd
|
||||||
|
---
|
||||||
|
libselinux/src/label_backends_android.c | 14 ++++++++++++--
|
||||||
|
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
|
||||||
|
index e52b44d4..3b8a2bd8 100644
|
||||||
|
--- a/libselinux/src/label_backends_android.c
|
||||||
|
+++ b/libselinux/src/label_backends_android.c
|
||||||
|
@@ -62,14 +62,24 @@ static int nodups_specs(struct saved_data *data)
|
||||||
|
curr_spec->property_key)) {
|
||||||
|
if (strcmp(spec_arr[jj].lr.ctx_raw,
|
||||||
|
curr_spec->lr.ctx_raw)) {
|
||||||
|
- rc = -1;
|
||||||
|
- errno = EINVAL;
|
||||||
|
selinux_log
|
||||||
|
(SELINUX_ERROR,
|
||||||
|
"Multiple different specifications for %s (%s and %s).\n",
|
||||||
|
curr_spec->property_key,
|
||||||
|
spec_arr[jj].lr.ctx_raw,
|
||||||
|
curr_spec->lr.ctx_raw);
|
||||||
|
+ int ignore = 0;
|
||||||
|
+ /*
|
||||||
|
+ * This issue has been found on Moto E5
|
||||||
|
+ * E SELinux : Multiple different specifications for rcs (u:object_r:radio_service:s0 and u:object_r:mot_rcs_service:s0).
|
||||||
|
+ */
|
||||||
|
+ if(!strcmp(curr_spec->property_key, "rcs"))
|
||||||
|
+ ignore = 1;
|
||||||
|
+
|
||||||
|
+ if(!ignore) {
|
||||||
|
+ rc = -1;
|
||||||
|
+ errno = EINVAL;
|
||||||
|
+ }
|
||||||
|
} else {
|
||||||
|
selinux_log
|
||||||
|
(SELINUX_WARNING,
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
From c46994a1a9fad0a76e41f0a5efe5238ca3f6b582 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sun, 24 May 2020 17:22:22 +0200
|
||||||
|
Subject: [PATCH 06/10] Allow mismatches of exfat genfscon
|
||||||
|
|
||||||
|
---
|
||||||
|
libsepol/cil/src/cil_post.c | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
||||||
|
index 5c0e99c3..97bf54f8 100644
|
||||||
|
--- a/libsepol/cil/src/cil_post.c
|
||||||
|
+++ b/libsepol/cil/src/cil_post.c
|
||||||
|
@@ -502,6 +502,10 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
|
||||||
|
*/
|
||||||
|
if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
||||||
|
bypass = 1;
|
||||||
|
+ if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) {
|
||||||
|
+ if(strcmp(a_genfscon->path_str, "/") == 0)
|
||||||
|
+ bypass = 1;
|
||||||
|
+ }
|
||||||
|
if(bypass == 1) {
|
||||||
|
fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
|
||||||
|
return 0;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
From 3ec6f5715a4c38ff7506fdb397eaf7077e004014 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Fri, 2 Mar 2018 22:49:55 +0100
|
||||||
|
Subject: [PATCH 07/10] Enable multipl_decls by default. This is needed because
|
||||||
|
8.0 init doesn't add -m
|
||||||
|
|
||||||
|
Change-Id: I43dc661d519f7b8576d72a828d8cbd444592bf5e
|
||||||
|
---
|
||||||
|
secilc/secilc.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/secilc/secilc.c b/secilc/secilc.c
|
||||||
|
index a51630b2..d9841ab0 100644
|
||||||
|
--- a/secilc/secilc.c
|
||||||
|
+++ b/secilc/secilc.c
|
||||||
|
@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
|
||||||
|
int target = SEPOL_TARGET_SELINUX;
|
||||||
|
int mls = -1;
|
||||||
|
int disable_dontaudit = 0;
|
||||||
|
- int multiple_decls = 0;
|
||||||
|
+ int multiple_decls = 1;
|
||||||
|
int disable_neverallow = 0;
|
||||||
|
int preserve_tunables = 0;
|
||||||
|
int qualified_names = 0;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+84
@@ -0,0 +1,84 @@
|
|||||||
|
From 96d937647898b239a0f2cfa10ad7dff3adee7093 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Fri, 25 Oct 2019 13:29:20 +0200
|
||||||
|
Subject: [PATCH 08/10] Fix boot on Moto devices using unknown class
|
||||||
|
|
||||||
|
vendor sepolicy never contains new class or classorder, and are not
|
||||||
|
allowed to.
|
||||||
|
Though this is not tested, and it turns out Moto did it anyway.
|
||||||
|
This raises an issue, because class need to be ordered, and thus the cil
|
||||||
|
contains the ordering. This ordering needs to be merged.
|
||||||
|
Android 10 added new classes, so the ordering can no longer be merged,
|
||||||
|
and secilc fails on those devices, preventing boot.
|
||||||
|
|
||||||
|
Considering vendor are not supposed to declare new class (and thus
|
||||||
|
declare classorder), this fix ignores class-es/classorder in vendor
|
||||||
|
SELinux policy.
|
||||||
|
|
||||||
|
Since the vendor selinux policy has allows rules based on this context,
|
||||||
|
those allows will fail since the class doesn't exist.
|
||||||
|
Workaround this by ignoring rules with the problematic class
|
||||||
|
( keystore_moto_key )
|
||||||
|
|
||||||
|
Lucky us, this new class `keystore_moto_key` is used by Moto for
|
||||||
|
framework to framework (more accurately priv app to keymaster), since
|
||||||
|
our own framework doesn't use this class, simply ignoring it fixes the
|
||||||
|
issue.
|
||||||
|
|
||||||
|
Change-Id: I66339857634ebfdba359f12a99dfd0bff709d80b
|
||||||
|
---
|
||||||
|
libsepol/cil/src/cil_build_ast.c | 24 ++++++++++++++++++++++++
|
||||||
|
1 file changed, 24 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
|
||||||
|
index 90f0fee6..023fd6c7 100644
|
||||||
|
--- a/libsepol/cil/src/cil_build_ast.c
|
||||||
|
+++ b/libsepol/cil/src/cil_build_ast.c
|
||||||
|
@@ -462,6 +462,14 @@ int cil_gen_class(struct cil_db *db, struct cil_tree_node *parse_current, struct
|
||||||
|
struct cil_tree_node *perms = NULL;
|
||||||
|
int rc = SEPOL_ERR;
|
||||||
|
|
||||||
|
+ {
|
||||||
|
+ const char* path = cil_tree_get_cil_path(parse_current);
|
||||||
|
+ if(strstr(path, "vendor/")) {
|
||||||
|
+ cil_clear_node(ast_node);
|
||||||
|
+ return SEPOL_OK;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
rc = __cil_verify_syntax(parse_current, syntax, syntax_len);
|
||||||
|
if (rc != SEPOL_OK) {
|
||||||
|
goto exit;
|
||||||
|
@@ -530,6 +538,14 @@ int cil_gen_classorder(struct cil_db *db, struct cil_tree_node *parse_current, s
|
||||||
|
struct cil_list_item *head = NULL;
|
||||||
|
int rc = SEPOL_ERR;
|
||||||
|
|
||||||
|
+ {
|
||||||
|
+ const char* path = cil_tree_get_cil_path(parse_current);
|
||||||
|
+ if(strstr(path, "vendor/")) {
|
||||||
|
+ cil_clear_node(ast_node);
|
||||||
|
+ return SEPOL_OK;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (db == NULL || parse_current == NULL || ast_node == NULL) {
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
@@ -2115,6 +2131,14 @@ int cil_gen_avrule(struct cil_tree_node *parse_current, struct cil_tree_node *as
|
||||||
|
rule->src_str = parse_current->next->data;
|
||||||
|
rule->tgt_str = parse_current->next->next->data;
|
||||||
|
|
||||||
|
+ {
|
||||||
|
+ const char *classname = parse_current->next->next->next->cl_head->data;
|
||||||
|
+ if(strcmp(classname, "keystore_moto_key") == 0) {
|
||||||
|
+ cil_clear_node(ast_node);
|
||||||
|
+ return SEPOL_OK;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
rc = cil_fill_classperms_list(parse_current->next->next->next, &rule->perms.classperms);
|
||||||
|
if (rc != SEPOL_OK) {
|
||||||
|
goto exit;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
From 1400000270e7bc96b460ce232425970580c94783 Mon Sep 17 00:00:00 2001
|
||||||
|
From: ponces <ponces26@gmail.com>
|
||||||
|
Date: Mon, 7 Nov 2022 16:14:20 +0000
|
||||||
|
Subject: [PATCH 09/10] Improve SELinux policy workaround on device/phh/treble
|
||||||
|
conflict to exit with SEPOL_OK instead of SEPOL_EEXIST
|
||||||
|
|
||||||
|
This fixes boot on many Samsung devices as exiting with SEPOL_EEXIST will prevent them to boot
|
||||||
|
---
|
||||||
|
libsepol/cil/src/cil_build_ast.c | 1 -
|
||||||
|
1 file changed, 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
|
||||||
|
index 023fd6c7..61c8864b 100644
|
||||||
|
--- a/libsepol/cil/src/cil_build_ast.c
|
||||||
|
+++ b/libsepol/cil/src/cil_build_ast.c
|
||||||
|
@@ -141,7 +141,6 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke
|
||||||
|
/* multiple_decls is enabled and works for this datum type, add node */
|
||||||
|
cil_list_append(prev->nodes, CIL_NODE, node);
|
||||||
|
node->data = prev;
|
||||||
|
- return SEPOL_EEXIST;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SEPOL_OK;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
From 6e89fce2e98c9d076e28f18031d4ac543b49994f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Thu, 20 Jul 2023 14:21:21 -0400
|
||||||
|
Subject: [PATCH 10/10] Allow /sys/vm/watermark_scale_factor conflict -- seen
|
||||||
|
on Freebox Player Pop
|
||||||
|
|
||||||
|
---
|
||||||
|
libsepol/cil/src/cil_post.c | 9 +++++++++
|
||||||
|
1 file changed, 9 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
||||||
|
index 97bf54f8..4cf1f2d3 100644
|
||||||
|
--- a/libsepol/cil/src/cil_post.c
|
||||||
|
+++ b/libsepol/cil/src/cil_post.c
|
||||||
|
@@ -502,6 +502,15 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
|
||||||
|
*/
|
||||||
|
if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
||||||
|
bypass = 1;
|
||||||
|
+ /*
|
||||||
|
+ * This conflict has been seen on Freebox Player Pop
|
||||||
|
+ * - AOSP T says (genfscon proc "/sys/vm/watermark_scale_factor" (u object_r proc_watermark_scale_factor ((s0) (s0))))
|
||||||
|
+ * - stock rom says proc_vm_writable
|
||||||
|
+ *
|
||||||
|
+ * Stock ROM uses it only in recovery so it's safe to ignore
|
||||||
|
+ */
|
||||||
|
+ if(strcmp(a_genfscon->path_str, "/sys/vm/watermark_scale_factor") == 0)
|
||||||
|
+ bypass = 1;
|
||||||
|
if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) {
|
||||||
|
if(strcmp(a_genfscon->path_str, "/") == 0)
|
||||||
|
bypass = 1;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
From 1ae4e6c6b0af6ed394f5009e950c79bd50a83b7c Mon Sep 17 00:00:00 2001
|
From 620a8b0407bb0cdd1889e8491bb17777ecc05121 Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Thu, 18 Aug 2022 15:44:46 -0400
|
Date: Thu, 18 Aug 2022 15:44:46 -0400
|
||||||
Subject: [PATCH 1/3] APM: Restore S, R and Q behavior respectively for
|
Subject: [PATCH 01/27] APM: Restore S, R and Q behavior respectively for
|
||||||
telephony audio
|
telephony audio
|
||||||
|
|
||||||
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
|
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
|
||||||
@@ -36,7 +36,7 @@ Change-Id: I56d36d2aef4319935cb88a3e4771b23c6d5b2145
|
|||||||
2 files changed, 143 insertions(+), 57 deletions(-)
|
2 files changed, 143 insertions(+), 57 deletions(-)
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||||
index 4573382a06..b7d0dbcca4 100644
|
index f625fdb3be..6c45696005 100644
|
||||||
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||||
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
|
||||||
@@ -675,6 +675,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
@@ -675,6 +675,17 @@ status_t AudioPolicyManager::updateCallRoutingInternal(
|
||||||
@@ -148,7 +148,7 @@ index 4573382a06..b7d0dbcca4 100644
|
|||||||
bool AudioPolicyManager::isDeviceOfModule(
|
bool AudioPolicyManager::isDeviceOfModule(
|
||||||
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
|
const sp<DeviceDescriptor>& devDesc, const char *moduleId) const {
|
||||||
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
|
sp<HwModule> module = mHwModules.getModuleFromName(moduleId);
|
||||||
@@ -4541,78 +4605,97 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
|
@@ -4550,78 +4614,97 @@ status_t AudioPolicyManager::createAudioPatchInternal(const struct audio_patch *
|
||||||
// in config XML to reach the sink so that is can be declared as available.
|
// in config XML to reach the sink so that is can be declared as available.
|
||||||
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
|
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
|
||||||
sp<SwAudioOutputDescriptor> outputDesc;
|
sp<SwAudioOutputDescriptor> outputDesc;
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
From 92225b786a57d5247d5fc536fcc1e98625b7cb23 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Mon, 5 Aug 2019 18:09:50 +0200
|
||||||
|
Subject: [PATCH 02/27] Fix BT in-call on CAF devices
|
||||||
|
|
||||||
|
See https://github.com/phhusson/treble_experimentations/issues/374
|
||||||
|
|
||||||
|
In Qualcomm's BSP audio_policy_configuration.xml, one route is missing,
|
||||||
|
from primary output and telephony to BT SCO.
|
||||||
|
|
||||||
|
Add it if we detect telephony and bt sco, but no such route.
|
||||||
|
|
||||||
|
Change-Id: Ifea0f88276ec9a0811f3cb1973c4b06f2c82077b
|
||||||
|
---
|
||||||
|
.../managerdefinitions/src/Serializer.cpp | 93 +++++++++++++++++++
|
||||||
|
1 file changed, 93 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
index d446e9667b..2f0ce75e47 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
@@ -663,6 +663,98 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
||||||
|
return route;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void fixupQualcommBtScoRoute(RouteTraits::Collection& routes, DevicePortTraits::Collection& devicePorts, HwModule* ctx) {
|
||||||
|
+ // On many Qualcomm devices, there is a BT SCO Headset Mic => primary input mix
|
||||||
|
+ // But Telephony Rx => BT SCO Headset route is missing
|
||||||
|
+ // When we detect such case, add the missing route
|
||||||
|
+
|
||||||
|
+ // If we have:
|
||||||
|
+ // <route type="mix" sink="Telephony Tx" sources="voice_tx"/>
|
||||||
|
+ // <route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic"/>
|
||||||
|
+ // <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink" />
|
||||||
|
+ // And no <route type="mix" sink="BT SCO Headset" />
|
||||||
|
+
|
||||||
|
+ // Add:
|
||||||
|
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
|
||||||
|
+ bool foundBtScoHeadsetDevice = false;
|
||||||
|
+ for(const auto& device: devicePorts) {
|
||||||
|
+ if(device->getTagName() == "BT SCO Headset") {
|
||||||
|
+ foundBtScoHeadsetDevice = true;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if(!foundBtScoHeadsetDevice) {
|
||||||
|
+ ALOGE("No BT SCO Headset device found, don't patch policy");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ bool foundTelephony = false;
|
||||||
|
+ bool foundBtScoInput = false;
|
||||||
|
+ bool foundScoHeadsetRoute = false;
|
||||||
|
+ for(const auto& route: routes) {
|
||||||
|
+ ALOGE("Looking at route %d\n", route->getType());
|
||||||
|
+ if(route->getType() != AUDIO_ROUTE_MIX)
|
||||||
|
+ continue;
|
||||||
|
+ auto sink = route->getSink();
|
||||||
|
+ ALOGE("... With sink %s\n", sink->getTagName().c_str());
|
||||||
|
+ if(sink->getTagName() == "Telephony Tx") {
|
||||||
|
+ foundTelephony = true;
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ if(sink->getTagName() == "BT SCO Headset") {
|
||||||
|
+ foundScoHeadsetRoute = true;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ for(const auto& source: route->getSources()) {
|
||||||
|
+ ALOGE("... With source %s\n", source->getTagName().c_str());
|
||||||
|
+ if(source->getTagName() == "BT SCO Headset Mic") {
|
||||||
|
+ foundBtScoInput = true;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ //The route we want to add is already there
|
||||||
|
+ ALOGE("Done looking for existing routes");
|
||||||
|
+ if(foundScoHeadsetRoute)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ ALOGE("No existing route found... %d %d", foundTelephony ? 1 : 0, foundBtScoInput ? 1 : 0);
|
||||||
|
+ //We couldn't find the routes we assume are required for the function we want to add
|
||||||
|
+ if(!foundTelephony || !foundBtScoInput)
|
||||||
|
+ return;
|
||||||
|
+ ALOGE("Adding our own.");
|
||||||
|
+
|
||||||
|
+ // Add:
|
||||||
|
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
|
||||||
|
+ AudioRoute *newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
|
||||||
|
+
|
||||||
|
+ auto sink = ctx->findPortByTagName("BT SCO Headset");
|
||||||
|
+ ALOGE("Got sink %p\n", sink.get());
|
||||||
|
+ newRoute->setSink(sink);
|
||||||
|
+
|
||||||
|
+ Vector<sp<PolicyAudioPort>> sources;
|
||||||
|
+ for(const auto& sourceName: {
|
||||||
|
+ "primary output",
|
||||||
|
+ "deep_buffer",
|
||||||
|
+ "compressed_offload",
|
||||||
|
+ "Telephony Rx"
|
||||||
|
+ }) {
|
||||||
|
+ auto source = ctx->findPortByTagName(sourceName);
|
||||||
|
+ ALOGE("Got source %p\n", source.get());
|
||||||
|
+ if (source.get() != nullptr) {
|
||||||
|
+ sources.add(source);
|
||||||
|
+ source->addRoute(newRoute);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ newRoute->setSources(sources);
|
||||||
|
+
|
||||||
|
+ sink->addRoute(newRoute);
|
||||||
|
+
|
||||||
|
+ auto ret = routes.add(newRoute);
|
||||||
|
+ ALOGE("route add returned %zd", ret);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
template<>
|
||||||
|
std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<ModuleTraits>(
|
||||||
|
const xmlNode *cur, ModuleTraits::PtrSerializingCtx ctx)
|
||||||
|
@@ -710,6 +802,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||||
|
if (status != NO_ERROR) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
+ fixupQualcommBtScoRoute(routes, devicePorts, module.get());
|
||||||
|
module->setRoutes(routes);
|
||||||
|
|
||||||
|
for (const xmlNode *children = cur->xmlChildrenNode; children != NULL;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+94
@@ -0,0 +1,94 @@
|
|||||||
|
From d5d39a14ce40d2a31bf7e12facfdd5751c180d8c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Tue, 1 Oct 2019 13:35:49 +0200
|
||||||
|
Subject: [PATCH 03/27] Add (partial, cam id is hardcoded) support for Asus ZF6
|
||||||
|
motor camera
|
||||||
|
|
||||||
|
Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
|
||||||
|
---
|
||||||
|
.../camera/libcameraservice/CameraService.cpp | 26 +++++++++++++++++++
|
||||||
|
.../camera/libcameraservice/CameraService.h | 3 +++
|
||||||
|
2 files changed, 29 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
|
||||||
|
index bfd3120f73..653666b15c 100644
|
||||||
|
--- a/services/camera/libcameraservice/CameraService.cpp
|
||||||
|
+++ b/services/camera/libcameraservice/CameraService.cpp
|
||||||
|
@@ -26,6 +26,7 @@
|
||||||
|
#include <ctime>
|
||||||
|
#include <string>
|
||||||
|
#include <sys/types.h>
|
||||||
|
+#include <sys/wait.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <poll.h>
|
||||||
|
@@ -143,6 +144,7 @@ const String16 CameraService::kWatchAllClientsFlag("all");
|
||||||
|
static std::set<String8> sServiceErrorEventSet;
|
||||||
|
|
||||||
|
CameraService::CameraService() :
|
||||||
|
+ mPhysicalFrontCamStatus(false),
|
||||||
|
mEventLog(DEFAULT_EVENT_LOG_LENGTH),
|
||||||
|
mNumberOfCameras(0),
|
||||||
|
mNumberOfCamerasWithoutSystemCamera(0),
|
||||||
|
@@ -2044,6 +2046,7 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
|
||||||
|
mServiceLock.lock();
|
||||||
|
} else {
|
||||||
|
// Otherwise, add client to active clients list
|
||||||
|
+ physicalFrontCam(cameraId == "1");
|
||||||
|
finishConnectLocked(client, partial, oomScoreOffset, systemNativeClient);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2163,6 +2166,27 @@ status_t CameraService::addOfflineClient(String8 cameraId, sp<BasicClient> offli
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
+void CameraService::physicalFrontCam(bool on) {
|
||||||
|
+ if(on == mPhysicalFrontCamStatus) return;
|
||||||
|
+ mPhysicalFrontCamStatus = on;
|
||||||
|
+
|
||||||
|
+ if(access("/dev/asusMotoDrv", F_OK) == 0) {
|
||||||
|
+ int pid = fork();
|
||||||
|
+ if(pid == 0) {
|
||||||
|
+ const char* cmd[] = {
|
||||||
|
+ "/system/bin/asus-motor",
|
||||||
|
+ "0",
|
||||||
|
+ NULL
|
||||||
|
+ };
|
||||||
|
+ cmd[1] = on ? "0" : "1";
|
||||||
|
+ execve("/system/bin/asus-motor", (char**)cmd, environ);
|
||||||
|
+ _exit(1);
|
||||||
|
+ } else {
|
||||||
|
+ waitpid(pid, NULL, 0);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
Status CameraService::turnOnTorchWithStrengthLevel(const String16& cameraId, int32_t torchStrength,
|
||||||
|
const sp<IBinder>& clientBinder) {
|
||||||
|
Mutex::Autolock lock(mServiceLock);
|
||||||
|
@@ -3394,6 +3418,8 @@ binder::Status CameraService::BasicClient::disconnect() {
|
||||||
|
}
|
||||||
|
mDisconnected = true;
|
||||||
|
|
||||||
|
+ sCameraService->physicalFrontCam(false);
|
||||||
|
+
|
||||||
|
sCameraService->removeByClient(this);
|
||||||
|
sCameraService->logDisconnected(mCameraIdStr, mClientPid, String8(mClientPackageName));
|
||||||
|
sCameraService->mCameraProviderManager->removeRef(CameraProviderManager::DeviceMode::CAMERA,
|
||||||
|
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
|
||||||
|
index 70293f4c5b..4ab725230c 100644
|
||||||
|
--- a/services/camera/libcameraservice/CameraService.h
|
||||||
|
+++ b/services/camera/libcameraservice/CameraService.h
|
||||||
|
@@ -227,6 +227,9 @@ public:
|
||||||
|
// Register an offline client for a given active camera id
|
||||||
|
status_t addOfflineClient(String8 cameraId, sp<BasicClient> offlineClient);
|
||||||
|
|
||||||
|
+ bool mPhysicalFrontCamStatus;
|
||||||
|
+ void physicalFrontCam(bool on);
|
||||||
|
+
|
||||||
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
// Client functionality
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
From 80d395514dc245fb27204d31075af7145e763723 Mon Sep 17 00:00:00 2001
|
From 626ddf76c4c7b78cc7199aa0d1954734c2ea6dcf Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Wed, 24 Aug 2022 15:42:39 -0400
|
Date: Wed, 24 Aug 2022 15:42:39 -0400
|
||||||
Subject: [PATCH 2/3] APM: Optionally force-load audio policy for system-side
|
Subject: [PATCH 04/27] APM: Optionally force-load audio policy for system-side
|
||||||
bt audio HAL
|
bt audio HAL
|
||||||
|
|
||||||
Required to support our system-side bt audio implementation, i.e.
|
Required to support our system-side bt audio implementation, i.e.
|
||||||
@@ -14,7 +14,7 @@ Change-Id: I279fff541a531f922f3fa55b8f14d00237db59ff
|
|||||||
1 file changed, 25 insertions(+)
|
1 file changed, 25 insertions(+)
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
index d446e9667b..f5233f2a42 100644
|
index 2f0ce75e47..b35d34a599 100644
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
@@ -25,6 +25,7 @@
|
@@ -25,6 +25,7 @@
|
||||||
@@ -25,7 +25,7 @@ index d446e9667b..f5233f2a42 100644
|
|||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
#include <utils/StrongPointer.h>
|
#include <utils/StrongPointer.h>
|
||||||
#include <utils/Errors.h>
|
#include <utils/Errors.h>
|
||||||
@@ -890,6 +891,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
@@ -983,6 +984,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
||||||
if (status != NO_ERROR) {
|
if (status != NO_ERROR) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
From 02eb4803499890a0cba2f6dfc7bfa5a03d043dd2 Mon Sep 17 00:00:00 2001
|
From 1ad922fb5329d5610d75a92688c8485fd7b4ce2a Mon Sep 17 00:00:00 2001
|
||||||
From: Peter Cai <peter@typeblog.net>
|
From: Peter Cai <peter@typeblog.net>
|
||||||
Date: Thu, 25 Aug 2022 13:30:29 -0400
|
Date: Thu, 25 Aug 2022 13:30:29 -0400
|
||||||
Subject: [PATCH 3/3] APM: Remove A2DP audio ports from the primary HAL
|
Subject: [PATCH 05/27] APM: Remove A2DP audio ports from the primary HAL
|
||||||
|
|
||||||
These ports defined in the primary HAL are intended for A2DP offloading,
|
These ports defined in the primary HAL are intended for A2DP offloading,
|
||||||
however they do not work in general on GSIs, and will interfere with
|
however they do not work in general on GSIs, and will interfere with
|
||||||
@@ -16,7 +16,7 @@ Change-Id: I3305594a17285da113167b419543543f0ef71122
|
|||||||
1 file changed, 22 insertions(+), 4 deletions(-)
|
1 file changed, 22 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
index f5233f2a42..6630d06f6d 100644
|
index b35d34a599..456c5a935c 100644
|
||||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
@@ -26,6 +26,7 @@
|
@@ -26,6 +26,7 @@
|
||||||
@@ -40,7 +40,7 @@ index f5233f2a42..6630d06f6d 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!xmlStrcmp(cur->name, reinterpret_cast<const xmlChar*>(Trait::tag))) {
|
if (!xmlStrcmp(cur->name, reinterpret_cast<const xmlChar*>(Trait::tag))) {
|
||||||
@@ -679,6 +677,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
@@ -771,6 +769,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||||
ALOGE("%s: No %s found", __func__, Attributes::name);
|
ALOGE("%s: No %s found", __func__, Attributes::name);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ index f5233f2a42..6630d06f6d 100644
|
|||||||
uint32_t versionMajor = 0, versionMinor = 0;
|
uint32_t versionMajor = 0, versionMinor = 0;
|
||||||
std::string versionLiteral = getXmlAttribute(cur, Attributes::version);
|
std::string versionLiteral = getXmlAttribute(cur, Attributes::version);
|
||||||
if (!versionLiteral.empty()) {
|
if (!versionLiteral.empty()) {
|
||||||
@@ -704,6 +703,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
@@ -796,6 +795,25 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||||
if (status != NO_ERROR) {
|
if (status != NO_ERROR) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
From e214f14c3fd150c90d1081f03db20bbc5ee2757a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Peter Cai <peter@typeblog.net>
|
||||||
|
Date: Thu, 23 Jan 2020 11:13:43 +0800
|
||||||
|
Subject: [PATCH 06/27] audiopolicy: try again with trimmed audio port name if
|
||||||
|
not found
|
||||||
|
|
||||||
|
* In Spreadtrum BSP, some audio routes may contain ports with extra
|
||||||
|
spaces at the beginning and the end, causing audiopolicy to refuse to
|
||||||
|
load and leading to broken audio.
|
||||||
|
|
||||||
|
* Fix this by retrying with trimmed port name when not found. Do not
|
||||||
|
use trimmed name all the time because a white space is a valid
|
||||||
|
character in port name, and we cannot be sure nobody is using it for
|
||||||
|
legitimite purposes.
|
||||||
|
|
||||||
|
Change-Id: I993708b28e8404bc8c483d71a850ac69382231bd
|
||||||
|
---
|
||||||
|
.../common/managerdefinitions/src/Serializer.cpp | 14 ++++++++++++++
|
||||||
|
1 file changed, 14 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
index 456c5a935c..45ee70ab6e 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
@@ -593,6 +593,17 @@ std::variant<status_t, DevicePortTraits::Element> PolicySerializer::deserialize<
|
||||||
|
return deviceDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
+char* trim(char * s) {
|
||||||
|
+ int l = strlen(s);
|
||||||
|
+
|
||||||
|
+ if (l > 0) {
|
||||||
|
+ while (isspace(s[l - 1])) --l;
|
||||||
|
+ while (*s && isspace(*s)) ++s, --l;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return strndup(s, l);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
template<>
|
||||||
|
std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<RouteTraits>(
|
||||||
|
const xmlNode *cur, RouteTraits::PtrSerializingCtx ctx)
|
||||||
|
@@ -640,6 +651,9 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
||||||
|
while (devTag != NULL) {
|
||||||
|
if (strlen(devTag) != 0) {
|
||||||
|
sp<PolicyAudioPort> source = ctx->findPortByTagName(devTag);
|
||||||
|
+ if (source == NULL) {
|
||||||
|
+ source = ctx->findPortByTagName(trim(devTag));
|
||||||
|
+ }
|
||||||
|
if (source == NULL && !mIgnoreVendorExtensions) {
|
||||||
|
ALOGE("%s: no source found with name=%s", __func__, devTag);
|
||||||
|
return BAD_VALUE;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
From 9d8a7a5a7fe9eb541f6228b7f129285c712a5190 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Peter Cai <peter@typeblog.net>
|
||||||
|
Date: Wed, 1 Jun 2022 16:56:46 -0400
|
||||||
|
Subject: [PATCH 07/27] camera: Implement property to override default camera
|
||||||
|
|
||||||
|
Complement to the frameworks/base patch.
|
||||||
|
|
||||||
|
Change-Id: I002bfa974bafc2cc01365eeea31c7a5dcb5a2028
|
||||||
|
---
|
||||||
|
.../common/CameraProviderManager.cpp | 22 +++++++++++++++++++
|
||||||
|
1 file changed, 22 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
index 43f92a9927..d9fc2ef135 100644
|
||||||
|
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
@@ -36,6 +36,7 @@
|
||||||
|
#include <functional>
|
||||||
|
#include <camera_metadata_hidden.h>
|
||||||
|
#include <android-base/parseint.h>
|
||||||
|
+#include <android-base/properties.h>
|
||||||
|
#include <android-base/logging.h>
|
||||||
|
#include <cutils/properties.h>
|
||||||
|
#include <hwbinder/IPCThreadState.h>
|
||||||
|
@@ -210,6 +211,15 @@ std::vector<std::string> CameraProviderManager::getCameraDeviceIds(std::unordere
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ int32_t altPrimaryCamera = property_get_int32("persist.sys.alt_primary_camera", 0);
|
||||||
|
+
|
||||||
|
+ if (altPrimaryCamera != 0 && deviceIds.size() > (size_t) altPrimaryCamera) {
|
||||||
|
+ const std::string origPrimary = deviceIds[0];
|
||||||
|
+ deviceIds[0] = deviceIds[altPrimaryCamera];
|
||||||
|
+ deviceIds[altPrimaryCamera] = origPrimary;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return deviceIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -276,6 +286,18 @@ std::vector<std::string> CameraProviderManager::getAPI1CompatibleCameraDeviceIds
|
||||||
|
std::sort(systemDeviceIds.begin(), systemDeviceIds.end(), sortFunc);
|
||||||
|
deviceIds.insert(deviceIds.end(), publicDeviceIds.begin(), publicDeviceIds.end());
|
||||||
|
deviceIds.insert(deviceIds.end(), systemDeviceIds.begin(), systemDeviceIds.end());
|
||||||
|
+
|
||||||
|
+ // Default camera ID hack should match with android.hardware.camera2.CameraManager.sortCameraIds
|
||||||
|
+ // Note that the alt primary camera may not be available here due to filterLogicalCameraIdsLocked()
|
||||||
|
+ // in which case we will just ignore it.
|
||||||
|
+ int altPrimaryCameraId = base::GetIntProperty("persist.sys.alt_primary_camera", -1);
|
||||||
|
+
|
||||||
|
+ if (altPrimaryCameraId > 0 && altPrimaryCameraId < (int) deviceIds.size()) {
|
||||||
|
+ std::string origPrimary = deviceIds[0];
|
||||||
|
+ deviceIds[0] = deviceIds[altPrimaryCameraId];
|
||||||
|
+ deviceIds[altPrimaryCameraId] = origPrimary;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return deviceIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
From bf9f035fc4466e6b9c290890ef59c2a0f598910c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Mon, 13 Apr 2020 21:01:16 +0200
|
||||||
|
Subject: [PATCH 08/27] There are three SCO devices. Fallback from one to the
|
||||||
|
others if needed
|
||||||
|
|
||||||
|
Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2
|
||||||
|
---
|
||||||
|
.../managerdefinitions/src/HwModule.cpp | 21 +++++++++++++++++++
|
||||||
|
1 file changed, 21 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
||||||
|
index 418b7ebe88..a97f76be59 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
|
||||||
|
@@ -311,6 +311,27 @@ sp<HwModule> HwModuleCollection::getModuleForDeviceType(audio_devices_t type,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ //We didn't find one? Ok but all SCOs are equivalent surely?
|
||||||
|
+ if(type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO ||
|
||||||
|
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET ||
|
||||||
|
+ type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
|
||||||
|
+ ALOGE("Fallback SCO");
|
||||||
|
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO) {
|
||||||
|
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO, encodedFormat);
|
||||||
|
+ ALOGE("Fallback SCO simple? %s", (ret != nullptr) ? "yes" : "no");
|
||||||
|
+ if(ret != nullptr) return ret;
|
||||||
|
+ }
|
||||||
|
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) {
|
||||||
|
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, encodedFormat);
|
||||||
|
+ ALOGE("Fallback SCO headset? %s", (ret != nullptr) ? "yes" : "no");
|
||||||
|
+ if(ret != nullptr) return ret;
|
||||||
|
+ }
|
||||||
|
+ if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) {
|
||||||
|
+ auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat);
|
||||||
|
+ ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no");
|
||||||
|
+ if(ret != nullptr) return ret;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+80
@@ -0,0 +1,80 @@
|
|||||||
|
From 51ee2c02c249cec676666e96c38ef490691472b8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Thu, 14 May 2020 19:54:55 +0200
|
||||||
|
Subject: [PATCH 09/27] Add persist.sys.phh.samsung.camera_ids property to
|
||||||
|
access hidden Samsung cameras
|
||||||
|
|
||||||
|
Change-Id: I2c7bf535272acc28ed2277e96c78ddd28a0b4593
|
||||||
|
---
|
||||||
|
services/camera/libcameraservice/Android.bp | 1 +
|
||||||
|
.../common/hidl/HidlProviderInfo.cpp | 14 ++++++++++++--
|
||||||
|
2 files changed, 13 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
|
||||||
|
index 981c56942c..7c4e4d9bcd 100644
|
||||||
|
--- a/services/camera/libcameraservice/Android.bp
|
||||||
|
+++ b/services/camera/libcameraservice/Android.bp
|
||||||
|
@@ -164,6 +164,7 @@ cc_library_shared {
|
||||||
|
"android.hardware.camera.device@3.6",
|
||||||
|
"android.hardware.camera.device@3.7",
|
||||||
|
"android.hardware.camera.device-V1-ndk",
|
||||||
|
+ "vendor.samsung.hardware.camera.provider@3.0",
|
||||||
|
"media_permission-aidl-cpp",
|
||||||
|
],
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
||||||
|
index 630090b4ac..1acf9c2990 100644
|
||||||
|
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
||||||
|
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
||||||
|
@@ -27,6 +27,7 @@
|
||||||
|
#include <utils/Trace.h>
|
||||||
|
|
||||||
|
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
|
||||||
|
+#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
|
||||||
|
@@ -134,6 +135,7 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
||||||
|
mMinorVersion = 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
// We need to check again since cast2_6.isOk() succeeds even if the provider
|
||||||
|
// version isn't actually 2.6.
|
||||||
|
if (interface2_6 == nullptr){
|
||||||
|
@@ -170,6 +172,9 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
||||||
|
return mapToStatusT(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ auto samsungCast = vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider::castFrom(interface);
|
||||||
|
+ auto samsungProvider = samsungCast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider>>(samsungCast) : nullptr;
|
||||||
|
+
|
||||||
|
hardware::Return<bool> linked = interface->linkToDeath(this, /*cookie*/ mId);
|
||||||
|
if (!linked.isOk()) {
|
||||||
|
ALOGE("%s: Transaction error in linking to camera provider '%s' death: %s",
|
||||||
|
@@ -200,7 +205,7 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
||||||
|
|
||||||
|
// Get initial list of camera devices, if any
|
||||||
|
std::vector<std::string> devices;
|
||||||
|
- hardware::Return<void> ret = interface->getCameraIdList([&status, this, &devices](
|
||||||
|
+ auto cb = [&status, this, &devices](
|
||||||
|
Status idStatus,
|
||||||
|
const hardware::hidl_vec<hardware::hidl_string>& cameraDeviceNames) {
|
||||||
|
status = idStatus;
|
||||||
|
@@ -217,7 +222,12 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
||||||
|
mProviderPublicCameraIds.push_back(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- } });
|
||||||
|
+ } };
|
||||||
|
+ hardware::Return<void> ret;
|
||||||
|
+ if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
||||||
|
+ ret = samsungProvider->sehGetCameraIdList(cb);
|
||||||
|
+ else
|
||||||
|
+ ret = interface->getCameraIdList(cb);
|
||||||
|
if (!ret.isOk()) {
|
||||||
|
ALOGE("%s: Transaction error in getting camera ID list from provider '%s': %s",
|
||||||
|
__FUNCTION__, mProviderName.c_str(), linked.description().c_str());
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
From 0d20180865ec1cb65b2dc15a5413716699ba7e96 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Tue, 19 May 2020 14:01:14 +0200
|
||||||
|
Subject: [PATCH 10/27] Add a property to force camera timestamp source
|
||||||
|
|
||||||
|
Some devices wrongly report their timesource
|
||||||
|
Camera's timesource can either be CLOCK_MONOTONIC, or CLOCK_BOOTTIME
|
||||||
|
The former doesn't increment in sleep, while the later does.
|
||||||
|
There is a camera HAL property for that, though some devices don't
|
||||||
|
report it properly.
|
||||||
|
|
||||||
|
This issue happens on Xiaomi Redmi 7A, it needs to force the value to 1
|
||||||
|
|
||||||
|
Add a property persist.sys.phh.camera.force_timestampsource to force
|
||||||
|
timestamp source.
|
||||||
|
---
|
||||||
|
.../libcameraservice/device3/Camera3Device.cpp | 12 ++++++++++--
|
||||||
|
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
|
||||||
|
index 6fb7dfd71f..082428beb0 100644
|
||||||
|
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
|
||||||
|
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
|
||||||
|
@@ -194,8 +194,16 @@ status_t Camera3Device::initializeCommonLocked() {
|
||||||
|
mTimestampOffset = getMonoToBoottimeOffset();
|
||||||
|
camera_metadata_entry timestampSource =
|
||||||
|
mDeviceInfo.find(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE);
|
||||||
|
- if (timestampSource.count > 0 && timestampSource.data.u8[0] ==
|
||||||
|
- ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME) {
|
||||||
|
+ int timestampSourceValue = 0;
|
||||||
|
+ if ((timestampSource.count > 0 && timestampSource.data.u8[0] ==
|
||||||
|
+ ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME)) {
|
||||||
|
+ timestampSourceValue = 1;
|
||||||
|
+ }
|
||||||
|
+ int forceTimestampSource = property_get_int32("persist.sys.phh.camera.force_timestampsource", -1);
|
||||||
|
+ //Don't override if it's -1, default value
|
||||||
|
+ if(forceTimestampSource == 0) timestampSourceValue = 0;
|
||||||
|
+ if(forceTimestampSource == 1) timestampSourceValue = 1;
|
||||||
|
+ if (timestampSourceValue == 1) {
|
||||||
|
mDeviceTimeBaseIsRealtime = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+87
@@ -0,0 +1,87 @@
|
|||||||
|
From 775dc822264016796b73795df280c0a40906a3ae Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Tue, 24 Apr 2018 00:14:28 +0200
|
||||||
|
Subject: [PATCH 11/27] FIH devices: Fix "Earpiece" audio output
|
||||||
|
|
||||||
|
On some FIH devices (confirmed on Razer, and probably on Aquos SS2),
|
||||||
|
Earpiece is not listed in attachedDevices, and devicePort's profile
|
||||||
|
mentions it is AUDIO_CHANNEL_IN_MONO, instead of AUDIO_CHANNEL_OUT_MONO.
|
||||||
|
|
||||||
|
Detect such cases (output device, but got only AUDIO_CHANNEL_IN_MONO),
|
||||||
|
and fix both channelMasks and attachedDevices
|
||||||
|
|
||||||
|
Change-Id: I4a88ba6d34d0fcd346eeea2ca903772f0271040a
|
||||||
|
---
|
||||||
|
.../managerdefinitions/src/Serializer.cpp | 27 ++++++++++++++++---
|
||||||
|
1 file changed, 24 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
index 45ee70ab6e..2bf5705512 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
@@ -416,23 +416,32 @@ std::variant<status_t, AudioGainTraits::Element> PolicySerializer::deserialize<A
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool fixedEarpieceChannels = false;
|
||||||
|
template<>
|
||||||
|
std::variant<status_t, AudioProfileTraits::Element>
|
||||||
|
PolicySerializer::deserialize<AudioProfileTraits>(
|
||||||
|
- const xmlNode *cur, AudioProfileTraits::PtrSerializingCtx /*serializingContext*/)
|
||||||
|
+ const xmlNode *cur, AudioProfileTraits::PtrSerializingCtx serializingContext)
|
||||||
|
{
|
||||||
|
using Attributes = AudioProfileTraits::Attributes;
|
||||||
|
+ bool isOutput = serializingContext != nullptr;
|
||||||
|
|
||||||
|
std::string samplingRates = getXmlAttribute(cur, Attributes::samplingRates);
|
||||||
|
std::string format = getXmlAttribute(cur, Attributes::format);
|
||||||
|
std::string channels = getXmlAttribute(cur, Attributes::channelMasks);
|
||||||
|
+ ChannelTraits::Collection channelsMask = channelMasksFromString(channels, ",");
|
||||||
|
+
|
||||||
|
+ //Some Foxconn devices have wrong earpiece channel mask, leading to no channel mask
|
||||||
|
+ if(channelsMask.size() == 1 && *channelsMask.begin() == AUDIO_CHANNEL_IN_MONO && isOutput) {
|
||||||
|
+ fixedEarpieceChannels = true;
|
||||||
|
+ channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (mIgnoreVendorExtensions && maybeVendorExtension(format)) {
|
||||||
|
ALOGI("%s: vendor extension format \"%s\" skipped", __func__, format.c_str());
|
||||||
|
return NO_INIT;
|
||||||
|
}
|
||||||
|
AudioProfileTraits::Element profile = new AudioProfile(formatFromString(format, gDynamicFormat),
|
||||||
|
- channelMasksFromString(channels, mChannelMasksSeparator.c_str()),
|
||||||
|
+ channelsMask,
|
||||||
|
samplingRatesFromString(samplingRates, mSamplingRatesSeparator.c_str()));
|
||||||
|
|
||||||
|
profile->setDynamicFormat(profile->getFormat() == gDynamicFormat);
|
||||||
|
@@ -571,7 +580,11 @@ std::variant<status_t, DevicePortTraits::Element> PolicySerializer::deserialize<
|
||||||
|
new DeviceDescriptor(type, name, address, encodedFormats);
|
||||||
|
|
||||||
|
AudioProfileTraits::Collection profiles;
|
||||||
|
- status_t status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
|
||||||
|
+ status_t status;
|
||||||
|
+ if(audio_is_output_devices(type))
|
||||||
|
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, (AudioProfileTraits::PtrSerializingCtx)1);
|
||||||
|
+ else
|
||||||
|
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
|
||||||
|
if (status != NO_ERROR) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
@@ -882,6 +895,14 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if(fixedEarpieceChannels) {
|
||||||
|
+ sp<DeviceDescriptor> device =
|
||||||
|
+ module->getDeclaredDevices().getDeviceFromTagName("Earpiece");
|
||||||
|
+ if(device != 0)
|
||||||
|
+ ctx->addDevice(device);
|
||||||
|
+ fixedEarpieceChannels = false;
|
||||||
|
+ }
|
||||||
|
return module;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
From b0f09457da9d8ed272cc8cfb26763ea7ffa60a7d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sat, 12 Sep 2020 12:32:50 +0200
|
||||||
|
Subject: [PATCH 12/27] No longer make re-assigning legacy audio groups fatal.
|
||||||
|
Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING which is defined
|
||||||
|
by framework too
|
||||||
|
|
||||||
|
Change-Id: I794fe22d63a8af705be4f5f09b9879ecaab3eae5
|
||||||
|
---
|
||||||
|
services/audiopolicy/engine/common/src/EngineBase.cpp | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp
|
||||||
|
index 99507eee5d..e31cc21b17 100644
|
||||||
|
--- a/services/audiopolicy/engine/common/src/EngineBase.cpp
|
||||||
|
+++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
|
||||||
|
@@ -222,9 +222,9 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
|
||||||
|
}
|
||||||
|
if (group.stream != AUDIO_STREAM_DEFAULT) {
|
||||||
|
// A legacy stream can be assigned once to a volume group
|
||||||
|
- LOG_ALWAYS_FATAL_IF(checkStreamForGroups(group.stream, mVolumeGroups),
|
||||||
|
- "stream %s already assigned to a volume group, "
|
||||||
|
- "review the configuration", toString(group.stream).c_str());
|
||||||
|
+ if(checkStreamForGroups(group.stream, mVolumeGroups)) {
|
||||||
|
+ ALOGE("stream %s already assigned to a volume group, review the configuration", toString(group.stream).c_str());
|
||||||
|
+ }
|
||||||
|
volumeGroup->addSupportedStream(group.stream);
|
||||||
|
}
|
||||||
|
addSupportedAttributesToGroup(group, volumeGroup, strategy);
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
From 60ae0874a3dcf3c41bbddc40438707ab5043b346 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Mon, 21 Dec 2020 20:19:11 +0100
|
||||||
|
Subject: [PATCH 13/27] Make camera IDs filter-out optional
|
||||||
|
|
||||||
|
Nowadays most people have Camera 2 apps, and would like to have all
|
||||||
|
cameras, rather than limit which cameras are available.
|
||||||
|
Add a property for that.
|
||||||
|
---
|
||||||
|
.../camera/libcameraservice/common/CameraProviderManager.cpp | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
index d9fc2ef135..292342238d 100644
|
||||||
|
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
@@ -260,7 +260,9 @@ std::vector<std::string> CameraProviderManager::getAPI1CompatibleCameraDeviceIds
|
||||||
|
// API1 app doesn't handle logical and physical camera devices well. So
|
||||||
|
// for each camera facing, only take the first id advertised by HAL in
|
||||||
|
// all [logical, physical1, physical2, ...] id combos, and filter out the rest.
|
||||||
|
- filterLogicalCameraIdsLocked(providerDeviceIds);
|
||||||
|
+ if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) {
|
||||||
|
+ filterLogicalCameraIdsLocked(providerDeviceIds);
|
||||||
|
+ }
|
||||||
|
collectDeviceIdsLocked(providerDeviceIds, publicDeviceIds, systemDeviceIds);
|
||||||
|
}
|
||||||
|
auto sortFunc =
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
From ce308a54ba2c124fe2f13b82cb3eec26ccb939a5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sat, 13 Mar 2021 14:20:03 -0500
|
||||||
|
Subject: [PATCH 14/27] Support Samsung R multi-cams
|
||||||
|
|
||||||
|
Change-Id: If46f385e8dd16185cbf37ab083e6a1242e1d1555
|
||||||
|
---
|
||||||
|
services/camera/libcameraservice/Android.bp | 1 +
|
||||||
|
.../libcameraservice/common/hidl/HidlProviderInfo.cpp | 8 +++++++-
|
||||||
|
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
|
||||||
|
index 7c4e4d9bcd..1faeb60ba7 100644
|
||||||
|
--- a/services/camera/libcameraservice/Android.bp
|
||||||
|
+++ b/services/camera/libcameraservice/Android.bp
|
||||||
|
@@ -165,6 +165,7 @@ cc_library_shared {
|
||||||
|
"android.hardware.camera.device@3.7",
|
||||||
|
"android.hardware.camera.device-V1-ndk",
|
||||||
|
"vendor.samsung.hardware.camera.provider@3.0",
|
||||||
|
+ "vendor.samsung.hardware.camera.provider@4.0",
|
||||||
|
"media_permission-aidl-cpp",
|
||||||
|
],
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
||||||
|
index 1acf9c2990..367ffb8cdc 100644
|
||||||
|
--- a/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
||||||
|
+++ b/services/camera/libcameraservice/common/hidl/HidlProviderInfo.cpp
|
||||||
|
@@ -28,6 +28,7 @@
|
||||||
|
|
||||||
|
#include <android/hardware/camera/device/3.7/ICameraDevice.h>
|
||||||
|
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
|
||||||
|
+#include <vendor/samsung/hardware/camera/provider/4.0/ISehCameraProvider.h>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
const bool kEnableLazyHal(property_get_bool("ro.camera.enableLazyHal", false));
|
||||||
|
@@ -173,7 +174,9 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
||||||
|
}
|
||||||
|
|
||||||
|
auto samsungCast = vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider::castFrom(interface);
|
||||||
|
+ auto samsung40Cast = vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider::castFrom(interface);
|
||||||
|
auto samsungProvider = samsungCast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider>>(samsungCast) : nullptr;
|
||||||
|
+ auto samsung40Provider = samsung40Cast.isOk() ? static_cast<sp<vendor::samsung::hardware::camera::provider::V4_0::ISehCameraProvider>>(samsung40Cast) : nullptr;
|
||||||
|
|
||||||
|
hardware::Return<bool> linked = interface->linkToDeath(this, /*cookie*/ mId);
|
||||||
|
if (!linked.isOk()) {
|
||||||
|
@@ -211,6 +214,7 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
||||||
|
status = idStatus;
|
||||||
|
if (status == Status::OK) {
|
||||||
|
for (auto& name : cameraDeviceNames) {
|
||||||
|
+ ALOGE("Listing camera ID %s", name.c_str());
|
||||||
|
uint16_t major, minor;
|
||||||
|
std::string type, id;
|
||||||
|
status_t res = parseDeviceName(name, &major, &minor, &type, &id);
|
||||||
|
@@ -224,7 +228,9 @@ status_t HidlProviderInfo::initializeHidlProvider(
|
||||||
|
}
|
||||||
|
} };
|
||||||
|
hardware::Return<void> ret;
|
||||||
|
- if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
||||||
|
+ if(samsung40Provider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
||||||
|
+ ret = samsung40Provider->sehGetCameraIdList(cb);
|
||||||
|
+ else if(samsungProvider != nullptr && property_get_bool("persist.sys.phh.samsung.camera_ids", false))
|
||||||
|
ret = samsungProvider->sehGetCameraIdList(cb);
|
||||||
|
else
|
||||||
|
ret = interface->getCameraIdList(cb);
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
From a8dd44229768011b7796c963aa0cc4c34f663cbf Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Tue, 23 Mar 2021 00:16:42 +0100
|
||||||
|
Subject: [PATCH 15/27] Don't crash on unknown audio devices
|
||||||
|
|
||||||
|
Change-Id: I2df8d88f742da6a84aa8888cdf19de25444de919
|
||||||
|
---
|
||||||
|
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
index 2bf5705512..78812b1098 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
@@ -867,7 +867,7 @@ std::variant<status_t, ModuleTraits::Element> PolicySerializer::deserialize<Modu
|
||||||
|
sp<DeviceDescriptor> device = module->getDeclaredDevices().
|
||||||
|
getDeviceFromTagName(std::string(reinterpret_cast<const char*>(
|
||||||
|
attachedDevice.get())));
|
||||||
|
- if (device == nullptr && mIgnoreVendorExtensions) {
|
||||||
|
+ if (device == nullptr) {
|
||||||
|
ALOGW("Skipped attached device \"%s\" because it likely uses a vendor"
|
||||||
|
"extension type",
|
||||||
|
reinterpret_cast<const char*>(attachedDevice.get()));
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
From a12df382effb38dd39beafd75de33f4e3efeb6e7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sun, 28 Mar 2021 18:54:47 +0200
|
||||||
|
Subject: [PATCH 16/27] Not all sources in a route are valid. Dont ignore the
|
||||||
|
whole route because of one broken source
|
||||||
|
|
||||||
|
Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d
|
||||||
|
---
|
||||||
|
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
index 78812b1098..9addf7dbdc 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
@@ -667,7 +667,7 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
||||||
|
if (source == NULL) {
|
||||||
|
source = ctx->findPortByTagName(trim(devTag));
|
||||||
|
}
|
||||||
|
- if (source == NULL && !mIgnoreVendorExtensions) {
|
||||||
|
+ if (source == NULL) {
|
||||||
|
ALOGE("%s: no source found with name=%s", __func__, devTag);
|
||||||
|
return BAD_VALUE;
|
||||||
|
} else if (source == NULL) {
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
From 08b6eef1e529f2ccc4e7f114b6ba8d658a587809 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sun, 28 Mar 2021 14:48:49 +0200
|
||||||
|
Subject: [PATCH 17/27] Use a fake volume policy when none has been found
|
||||||
|
|
||||||
|
This is useful, because on Samsung devices, the "real"
|
||||||
|
(=non-gsi-cheating) audio policy doesn't have any volume policy.
|
||||||
|
|
||||||
|
This requires actually adding the fake audio policy xml file (done in
|
||||||
|
device/phh/treble)
|
||||||
|
|
||||||
|
Change-Id: I461a3f22893ab2b1d96d67f22397369b2cae41e5
|
||||||
|
---
|
||||||
|
services/audiopolicy/engine/config/src/EngineConfig.cpp | 7 ++++++-
|
||||||
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/engine/config/src/EngineConfig.cpp b/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
||||||
|
index 6f560d558d..92cf03e418 100644
|
||||||
|
--- a/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
||||||
|
+++ b/services/audiopolicy/engine/config/src/EngineConfig.cpp
|
||||||
|
@@ -724,7 +724,12 @@ android::status_t parseLegacyVolumeFile(const char* path, VolumeGroups &volumeGr
|
||||||
|
android::status_t parseLegacyVolumes(VolumeGroups &volumeGroups) {
|
||||||
|
if (std::string audioPolicyXmlConfigFile = audio_get_audio_policy_config_file();
|
||||||
|
!audioPolicyXmlConfigFile.empty()) {
|
||||||
|
- return parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups);
|
||||||
|
+ int ret = parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups);
|
||||||
|
+ if (ret == NO_ERROR && volumeGroups.size() == 0) {
|
||||||
|
+ ret = parseLegacyVolumeFile("/system/etc/fake_audio_policy_volume.xml", volumeGroups);
|
||||||
|
+ ALOGE("Parsing volume for /system/etc/fake_audio_policy_volume.xml gave %zu", volumeGroups.size());
|
||||||
|
+ }
|
||||||
|
+ return ret;
|
||||||
|
} else {
|
||||||
|
ALOGE("No readable audio policy config file found");
|
||||||
|
return BAD_VALUE;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
From 1e5b723ba89f94976124da664d5524325f84c029 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sat, 7 Aug 2021 11:11:39 +0200
|
||||||
|
Subject: [PATCH 18/27] When aux cameras are enabled, ignore "system only"
|
||||||
|
camera flag (it shouldnt be q security issue since secure cameras are listed
|
||||||
|
otherwise)
|
||||||
|
|
||||||
|
---
|
||||||
|
.../libcameraservice/common/CameraProviderManager.cpp | 10 ++++++----
|
||||||
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
index 292342238d..4a2fb94da3 100644
|
||||||
|
--- a/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
+++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp
|
||||||
|
@@ -978,10 +978,12 @@ SystemCameraKind CameraProviderManager::ProviderInfo::DeviceInfo3::getSystemCame
|
||||||
|
|
||||||
|
// Go through the capabilities and check if it has
|
||||||
|
// ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA
|
||||||
|
- for (size_t i = 0; i < entryCap.count; ++i) {
|
||||||
|
- uint8_t capability = entryCap.data.u8[i];
|
||||||
|
- if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA) {
|
||||||
|
- return SystemCameraKind::SYSTEM_ONLY_CAMERA;
|
||||||
|
+ if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) {
|
||||||
|
+ for (size_t i = 0; i < entryCap.count; ++i) {
|
||||||
|
+ uint8_t capability = entryCap.data.u8[i];
|
||||||
|
+ if (capability == ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA) {
|
||||||
|
+ return SystemCameraKind::SYSTEM_ONLY_CAMERA;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SystemCameraKind::PUBLIC;
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+81
@@ -0,0 +1,81 @@
|
|||||||
|
From e132448df71613b3f39390a392676db0847ce21e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Mon, 11 Oct 2021 16:10:42 -0400
|
||||||
|
Subject: [PATCH 19/27] Revert "Remove support for audio HAL V2 from the
|
||||||
|
framework"
|
||||||
|
|
||||||
|
This reverts commit cbf517f837f7bf8a59f3ff8aa1e0e3e19612e251.
|
||||||
|
|
||||||
|
Also enable new extensions required to actually build
|
||||||
|
|
||||||
|
Change-Id: Icfd638a91b22ffa6d2cd6d19a624e699a85a850a
|
||||||
|
---
|
||||||
|
media/libaudiohal/Android.bp | 1 +
|
||||||
|
media/libaudiohal/FactoryHalHidl.cpp | 5 +++--
|
||||||
|
media/libaudiohal/impl/Android.bp | 18 ++++++++++++++++++
|
||||||
|
3 files changed, 22 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/media/libaudiohal/Android.bp b/media/libaudiohal/Android.bp
|
||||||
|
index 5f63e8de04..aa1d825d2f 100644
|
||||||
|
--- a/media/libaudiohal/Android.bp
|
||||||
|
+++ b/media/libaudiohal/Android.bp
|
||||||
|
@@ -23,6 +23,7 @@ cc_library_shared {
|
||||||
|
],
|
||||||
|
|
||||||
|
required: [
|
||||||
|
+ "libaudiohal@2.0",
|
||||||
|
"libaudiohal@4.0",
|
||||||
|
"libaudiohal@5.0",
|
||||||
|
"libaudiohal@6.0",
|
||||||
|
diff --git a/media/libaudiohal/FactoryHalHidl.cpp b/media/libaudiohal/FactoryHalHidl.cpp
|
||||||
|
index 590fec5443..46b6bd757a 100644
|
||||||
|
--- a/media/libaudiohal/FactoryHalHidl.cpp
|
||||||
|
+++ b/media/libaudiohal/FactoryHalHidl.cpp
|
||||||
|
@@ -36,12 +36,13 @@ namespace {
|
||||||
|
*/
|
||||||
|
#define CONC_VERSION(maj, min) #maj "." #min
|
||||||
|
#define DECLARE_VERSION(maj, min) std::make_pair(std::make_pair(maj, min), CONC_VERSION(maj, min))
|
||||||
|
-static constexpr std::array<std::pair<std::pair<int, int>, const char*>, 5> sAudioHALVersions = {
|
||||||
|
+static constexpr std::array<std::pair<std::pair<int, int>, const char*>, 6> sAudioHALVersions = {
|
||||||
|
DECLARE_VERSION(7, 1),
|
||||||
|
DECLARE_VERSION(7, 0),
|
||||||
|
DECLARE_VERSION(6, 0),
|
||||||
|
DECLARE_VERSION(5, 0),
|
||||||
|
- DECLARE_VERSION(4, 0)
|
||||||
|
+ DECLARE_VERSION(4, 0),
|
||||||
|
+ DECLARE_VERSION(2, 0)
|
||||||
|
};
|
||||||
|
|
||||||
|
bool createHalService(const std::string& version, const std::string& interface,
|
||||||
|
diff --git a/media/libaudiohal/impl/Android.bp b/media/libaudiohal/impl/Android.bp
|
||||||
|
index d30883a95c..7bba88ca0a 100644
|
||||||
|
--- a/media/libaudiohal/impl/Android.bp
|
||||||
|
+++ b/media/libaudiohal/impl/Android.bp
|
||||||
|
@@ -68,6 +68,24 @@ cc_defaults {
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
+cc_library_shared {
|
||||||
|
+ name: "libaudiohal@2.0",
|
||||||
|
+ defaults: ["libaudiohal_default"],
|
||||||
|
+ shared_libs: [
|
||||||
|
+ "android.hardware.audio.common@2.0",
|
||||||
|
+ "android.hardware.audio.common@2.0-util",
|
||||||
|
+ "android.hardware.audio.effect@2.0",
|
||||||
|
+ "android.hardware.audio.effect@2.0-util",
|
||||||
|
+ "android.hardware.audio@2.0",
|
||||||
|
+ "android.hardware.audio@2.0-util",
|
||||||
|
+ ],
|
||||||
|
+ cflags: [
|
||||||
|
+ "-DMAJOR_VERSION=2",
|
||||||
|
+ "-DMINOR_VERSION=0",
|
||||||
|
+ "-include common/all-versions/VersionMacro.h",
|
||||||
|
+ ]
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
cc_library_shared {
|
||||||
|
name: "libaudiohal@4.0",
|
||||||
|
defaults: ["libaudiohal_default"],
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
From ad429fa67055370b25424e5a1457e58df1406732 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sun, 30 Jan 2022 07:40:19 -0500
|
||||||
|
Subject: [PATCH 20/27] Fix parsing audio hal 7.0 audio policies
|
||||||
|
|
||||||
|
Google changed separator from natural "," to weird " "
|
||||||
|
We broke its support in "FIH devices: Fix "Earpiece" audio output"
|
||||||
|
|
||||||
|
Change-Id: I458b8b6a6498dd9cf748e00843ff65c561579902
|
||||||
|
---
|
||||||
|
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
index 9addf7dbdc..9d3d9fd169 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
@@ -428,7 +428,7 @@ PolicySerializer::deserialize<AudioProfileTraits>(
|
||||||
|
std::string samplingRates = getXmlAttribute(cur, Attributes::samplingRates);
|
||||||
|
std::string format = getXmlAttribute(cur, Attributes::format);
|
||||||
|
std::string channels = getXmlAttribute(cur, Attributes::channelMasks);
|
||||||
|
- ChannelTraits::Collection channelsMask = channelMasksFromString(channels, ",");
|
||||||
|
+ ChannelTraits::Collection channelsMask = channelMasksFromString(channels, mChannelMasksSeparator.c_str());
|
||||||
|
|
||||||
|
//Some Foxconn devices have wrong earpiece channel mask, leading to no channel mask
|
||||||
|
if(channelsMask.size() == 1 && *channelsMask.begin() == AUDIO_CHANNEL_IN_MONO && isOutput) {
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
From af8dc4fe8272deb5350182390b307e757d1b2199 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pierre-Hugues Husson <phh@phh.me>
|
||||||
|
Date: Sat, 12 Mar 2022 18:07:43 -0500
|
||||||
|
Subject: [PATCH 21/27] fixup! Not all sources in a route are valid. Dont
|
||||||
|
ignore the whole route because of one broken source
|
||||||
|
|
||||||
|
---
|
||||||
|
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
index 9d3d9fd169..95d2463230 100644
|
||||||
|
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||||
|
@@ -667,7 +667,7 @@ std::variant<status_t, RouteTraits::Element> PolicySerializer::deserialize<Route
|
||||||
|
if (source == NULL) {
|
||||||
|
source = ctx->findPortByTagName(trim(devTag));
|
||||||
|
}
|
||||||
|
- if (source == NULL) {
|
||||||
|
+ if (source == NULL && false) {
|
||||||
|
ALOGE("%s: no source found with name=%s", __func__, devTag);
|
||||||
|
return BAD_VALUE;
|
||||||
|
} else if (source == NULL) {
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user