Skip to content

Commit 4326fc0

Browse files
lostark13kutemeikito
authored andcommitted
cameraserver: Let multiple cameras opened by stock camera application
Let conflicting camera devices list be empty and let the camera hal manage it. Old camera hals mark camera device as conflicting if the new camera device is opened. Fixes dual video camera mode for old devices Change-Id: I2043dee762ddcef96432e440cc6017181950a4c3 Signed-off-by: Lostark13 <tushar9915@gmail.com> Signed-off-by: chrisl7 <wandersonrodriguesf1@gmail.com> Signed-off-by: Edwiin Kusuma Jaya <kutemeikito0905@gmail.com>
1 parent 2232715 commit 4326fc0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

services/camera/libcameraservice/CameraService.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,10 @@ void CameraService::finishConnectLocked(const sp<BasicClient>& client,
14481448
oomScoreOffset, systemNativeClient);
14491449
auto evicted = mActiveClientManager.addAndEvict(clientDescriptor);
14501450

1451+
if (strcmp(String8(client->getPackageName()).string(), "com.android.camera") == 0) {
1452+
evicted.clear();
1453+
}
1454+
14511455
logConnected(desc->getKey(), static_cast<int>(desc->getOwnerId()),
14521456
String8(client->getPackageName()));
14531457

@@ -1557,6 +1561,9 @@ status_t CameraService::handleEvictionsLocked(const String8& cameraId, int clien
15571561
// Find clients that would be evicted
15581562
auto evicted = mActiveClientManager.wouldEvict(clientDescriptor);
15591563

1564+
if (strcmp(String8(packageName).string(), "com.android.camera") == 0) {
1565+
evicted.clear();
1566+
}
15601567
// If the incoming client was 'evicted,' higher priority clients have the camera in the
15611568
// background, so we cannot do evictions
15621569
if (std::find(evicted.begin(), evicted.end(), clientDescriptor) != evicted.end()) {

0 commit comments

Comments
 (0)