Skip to content

Commit

Permalink
libcameraservice: add TARGET_CAMERA_NEEDS_CLIENT_INFO
Browse files Browse the repository at this point in the history
write camera package name if matches

Change-Id: Ia84d5f7f3961945e2143968eb572f5d9106d0297

libcameraservice: write all pkgNames

Change-Id: I85c2e9d4ffb56cc08aea1c1eabc1ed2ec45c0217

SKULSHADY: Convert to soong config variable
  • Loading branch information
darkobas authored and NurKeinNeid committed Apr 17, 2021
1 parent 6dbe8f1 commit b5b146d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions services/camera/libcameraservice/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
cc_library_shared {
name: "libcameraservice",
defaults: [
"camera_needs_client_info_defaults",
"no_cameraserver_defaults",
"qti_camera_device_defaults" ,
"needs_camera_boottime" ,
Expand Down
10 changes: 9 additions & 1 deletion services/camera/libcameraservice/CameraService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <cstring>
#include <ctime>
#include <string>
#ifdef TARGET_NEEDS_CLIENT_INFO
#include <iostream>
#include <fstream>
#endif
#include <sys/types.h>
#include <inttypes.h>
#include <pthread.h>
Expand Down Expand Up @@ -1492,7 +1496,6 @@ Status CameraService::connect(
ret.toString8());
return ret;
}

*device = client;
return ret;
}
Expand Down Expand Up @@ -2961,6 +2964,11 @@ status_t CameraService::BasicClient::startCameraOps() {
// Notify listeners of camera open/close status
sCameraService->updateOpenCloseStatus(mCameraIdStr, true/*open*/, mClientPackageName);

#ifdef TARGET_NEEDS_CLIENT_INFO
std::ofstream cpf("/data/misc/aosp/client_package_name");
std::string cpn = String8(mClientPackageName).string();
cpf << cpn;
#endif
return OK;
}

Expand Down

0 comments on commit b5b146d

Please sign in to comment.