forked from DroidFreak32/lineage_surnia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-DNM-HAL1-Hack-disable-UID-active-check.patch
40 lines (32 loc) · 1.86 KB
/
0001-DNM-HAL1-Hack-disable-UID-active-check.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 7cfcb78ede66d3f4dd2f5460e5f38827cb5affe1 Mon Sep 17 00:00:00 2001
From: Kyle Harrison <[email protected]>
Date: Fri, 17 Aug 2018 17:10:53 +0000
Subject: [PATCH] [DNM] HAL1 Hack disable UID active check
- This is a temporary hack - I expect LOS will make a proper fix eventually.
The check to isUidActive (introduced in P) is expecting to be called from the cameraserver but with the Camera HAL1
patches, it is being called from the mediaserver. This triggers a permissions denial and stops the camera from working.
So, disable this check for HAL1 devices to allow the camera to function.
Change-Id: Ibe5d5e14cc7efde54c20ab961d6d452ad5dc367f
---
services/camera/libcameraservice/CameraService.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 7a79b217f..de0fac5db 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -912,6 +912,7 @@ Status CameraService::validateClientPermissionsLocked(const String8& cameraId,
clientName8.string(), clientUid, clientPid, cameraId.string());
}
+#ifndef NO_CAMERA_SERVER
// Make sure the UID is in an active state to use the camera
if (!mUidPolicy->isUidActive(callingUid, String16(clientName8))) {
ALOGE("Access Denial: can't use the camera from an idle UID pid=%d, uid=%d",
@@ -920,6 +921,7 @@ Status CameraService::validateClientPermissionsLocked(const String8& cameraId,
"Caller \"%s\" (PID %d, UID %d) cannot open camera \"%s\" from background",
clientName8.string(), clientUid, clientPid, cameraId.string());
}
+#endif
// Only use passed in clientPid to check permission. Use calling PID as the client PID that's
// connected to camera service directly.
--
2.17.1