forked from PeterGSI/patches
Bring back hacks for Sony camera
This commit is contained in:
parent
2cbf15fc89
commit
22cda1eb90
|
@ -1,7 +1,7 @@
|
|||
From 51deb8e31ca57f19420277cc92b26375233e9050 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Thu, 18 Aug 2022 15:44:46 -0400
|
||||
Subject: [PATCH 1/3] APM: Restore S, R and Q behavior respectively for
|
||||
Subject: [PATCH 1/4] APM: Restore S, R and Q behavior respectively for
|
||||
telephony audio
|
||||
|
||||
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From 5def9ad1a26e28d517666e34301dc725c1660e36 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Wed, 24 Aug 2022 15:42:39 -0400
|
||||
Subject: [PATCH 2/3] APM: Optionally force-load audio policy for system-side
|
||||
Subject: [PATCH 2/4] APM: Optionally force-load audio policy for system-side
|
||||
bt audio HAL
|
||||
|
||||
Required to support our system-side bt audio implementation, i.e.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From e31fc6f3f79848e6f7e7b1b4abe82aa26571cf7b Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Thu, 25 Aug 2022 13:30:29 -0400
|
||||
Subject: [PATCH 3/3] APM: Remove A2DP audio ports from the primary HAL
|
||||
Subject: [PATCH 3/4] APM: Remove A2DP audio ports from the primary HAL
|
||||
|
||||
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
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
From 9d5b1f22e00167bd6f75fde20ace1c1d1e964318 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Wed, 1 Jun 2022 16:56:46 -0400
|
||||
Subject: [PATCH 4/4] 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 abaea6639f..59b59f44fb 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>
|
||||
@@ -205,6 +206,15 @@ std::vector<std::string> CameraProviderManager::getCameraDeviceIds() const {
|
||||
deviceIds.push_back(id);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ 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;
|
||||
}
|
||||
|
||||
@@ -271,6 +281,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.37.2
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From 0f7b66cc9930141f645569f354e901bef5ae384b Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Tue, 12 Oct 2021 21:37:22 -0400
|
||||
Subject: [PATCH 1/3] PackageParser: support glob matching for properties
|
||||
Subject: [PATCH 1/4] PackageParser: support glob matching for properties
|
||||
|
||||
Needed to make phh's vendor overlays work
|
||||
---
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From 381aa92ab038fc6c0157c5b9396218e80ed3ae65 Mon Sep 17 00:00:00 2001
|
||||
From: dhacker29 <dhackerdvm@gmail.com>
|
||||
Date: Tue, 24 Nov 2015 01:53:47 -0500
|
||||
Subject: [PATCH 2/3] fw/b: Use ro.build.version.incremental to signal OTA
|
||||
Subject: [PATCH 2/4] fw/b: Use ro.build.version.incremental to signal OTA
|
||||
upgrades
|
||||
|
||||
[PeterCxy]: On T, there is a new class PackagePartitions that is
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From effc76211ce9b665c4f9418d86d2b1a8aa67d42b Mon Sep 17 00:00:00 2001
|
||||
From: Danny Lin <danny@kdrag0n.dev>
|
||||
Date: Sat, 16 Oct 2021 05:27:57 -0700
|
||||
Subject: [PATCH 3/3] Add support for app signature spoofing
|
||||
Subject: [PATCH 3/4] 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
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
From bd9fc170c2125e142f19805cceaaabe354ba6da8 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Wed, 1 Jun 2022 16:56:20 -0400
|
||||
Subject: [PATCH 4/4] Implement a persistent property to override the default
|
||||
primary camera (0)
|
||||
|
||||
Change-Id: I49b45d00bf71d7932591b3516d49a680e1b6568b
|
||||
---
|
||||
core/java/android/hardware/Camera.java | 6 ++++++
|
||||
core/java/android/hardware/camera2/CameraManager.java | 9 +++++++++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
|
||||
index 3bdd39f5d7d7..fff46f20342b 100644
|
||||
--- a/core/java/android/hardware/Camera.java
|
||||
+++ b/core/java/android/hardware/Camera.java
|
||||
@@ -45,6 +45,7 @@ import android.os.Message;
|
||||
import android.os.Process;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
+import android.os.SystemProperties;
|
||||
import android.renderscript.Allocation;
|
||||
import android.renderscript.Element;
|
||||
import android.renderscript.RSIllegalArgumentException;
|
||||
@@ -408,6 +409,11 @@ public class Camera {
|
||||
* @see #open(int)
|
||||
*/
|
||||
public static Camera open() {
|
||||
+ int altPrimaryCamera = SystemProperties.getInt("persist.sys.alt_primary_camera", -1);
|
||||
+ if (altPrimaryCamera > 0) {
|
||||
+ return new Camera(altPrimaryCamera);
|
||||
+ }
|
||||
+
|
||||
int numberOfCameras = getNumberOfCameras();
|
||||
CameraInfo cameraInfo = new CameraInfo();
|
||||
for (int i = 0; i < numberOfCameras; i++) {
|
||||
diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java
|
||||
index d6d3a97687b5..c86c909a4109 100644
|
||||
--- a/core/java/android/hardware/camera2/CameraManager.java
|
||||
+++ b/core/java/android/hardware/camera2/CameraManager.java
|
||||
@@ -1723,6 +1723,15 @@ public final class CameraManager {
|
||||
}
|
||||
}});
|
||||
|
||||
+ // HAXX: Allow overriding default primary camera (assumed to be camera 0) via property
|
||||
+ // Should match with libcameraservice/common/CameraProviderManager.cpp
|
||||
+ int altPrimaryCamera = SystemProperties.getInt("persist.sys.alt_primary_camera", -1);
|
||||
+ if (altPrimaryCamera > 0 && altPrimaryCamera < cameraIds.length) {
|
||||
+ String origPrimary = cameraIds[0];
|
||||
+ cameraIds[0] = cameraIds[altPrimaryCamera];
|
||||
+ cameraIds[altPrimaryCamera] = origPrimary;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
public static boolean cameraStatusesContains(CameraStatus[] cameraStatuses, String id) {
|
||||
--
|
||||
2.37.2
|
||||
|
Loading…
Reference in New Issue