mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 04:25:33 -04:00
Revert "universal7885: camera.provider: drop front camera hacks"
Change-Id: I3946a41bdde83388205d4ebcc39bc9f63e88d9d8 Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
a61a974d0e
commit
874efff89c
2 changed files with 28 additions and 1 deletions
|
|
@ -23,11 +23,15 @@
|
||||||
using ::android::NO_ERROR;
|
using ::android::NO_ERROR;
|
||||||
using ::android::OK;
|
using ::android::OK;
|
||||||
|
|
||||||
|
using ::android::hardware::Void;
|
||||||
|
using ::android::hardware::hidl_vec;
|
||||||
|
using ::android::hardware::hidl_string;
|
||||||
|
|
||||||
const int kMaxCameraIdLen = 16;
|
const int kMaxCameraIdLen = 16;
|
||||||
|
|
||||||
SamsungCameraProvider::SamsungCameraProvider() : LegacyCameraProviderImpl_2_5() {
|
SamsungCameraProvider::SamsungCameraProvider() : LegacyCameraProviderImpl_2_5() {
|
||||||
mExtraIDs.push_back(50);
|
mExtraIDs.push_back(50);
|
||||||
|
mDisabledIDs.push_back(2);
|
||||||
if (!mInitFailed) {
|
if (!mInitFailed) {
|
||||||
for (int i : mExtraIDs) {
|
for (int i : mExtraIDs) {
|
||||||
struct camera_info info;
|
struct camera_info info;
|
||||||
|
|
@ -59,4 +63,24 @@ SamsungCameraProvider::SamsungCameraProvider() : LegacyCameraProviderImpl_2_5()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Return<void> SamsungCameraProvider::getCameraIdList(
|
||||||
|
ICameraProvider::getCameraIdList_cb _hidl_cb) {
|
||||||
|
std::vector<hidl_string> deviceNameList;
|
||||||
|
for (auto const& deviceNamePair : mCameraDeviceNames) {
|
||||||
|
int id = std::stoi(deviceNamePair.first);
|
||||||
|
if (id >= mNumberOfLegacyCameras || std::find(mDisabledIDs.begin(), mDisabledIDs.end(), id) != mDisabledIDs.end()) {
|
||||||
|
// External camera devices must be reported through the device status change callback,
|
||||||
|
// not in this list.
|
||||||
|
// Linux4: Also skip disabled camera IDs.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (mCameraStatusMap[deviceNamePair.first] == CAMERA_DEVICE_STATUS_PRESENT) {
|
||||||
|
deviceNameList.push_back(deviceNamePair.second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hidl_vec<hidl_string> hidlDeviceNameList(deviceNameList);
|
||||||
|
_hidl_cb(::android::hardware::camera::common::V1_0::Status::OK, hidlDeviceNameList);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
SamsungCameraProvider::~SamsungCameraProvider() {}
|
SamsungCameraProvider::~SamsungCameraProvider() {}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#define SAMSUNG_CAMERA_DEBUG
|
#define SAMSUNG_CAMERA_DEBUG
|
||||||
|
|
||||||
|
using ::android::hardware::camera::provider::V2_5::ICameraProvider;
|
||||||
using ::android::hardware::camera::provider::V2_5::implementation::LegacyCameraProviderImpl_2_5;
|
using ::android::hardware::camera::provider::V2_5::implementation::LegacyCameraProviderImpl_2_5;
|
||||||
using ::android::hardware::Return;
|
using ::android::hardware::Return;
|
||||||
|
|
||||||
|
|
@ -28,8 +29,10 @@ public:
|
||||||
SamsungCameraProvider();
|
SamsungCameraProvider();
|
||||||
~SamsungCameraProvider();
|
~SamsungCameraProvider();
|
||||||
|
|
||||||
|
Return<void> getCameraIdList(ICameraProvider::getCameraIdList_cb _hidl_cb);
|
||||||
private:
|
private:
|
||||||
std::vector<int> mExtraIDs;
|
std::vector<int> mExtraIDs;
|
||||||
|
std::vector<int> mDisabledIDs;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SAMSUNG_CAMERA_PROVIDER_H
|
#endif // SAMSUNG_CAMERA_PROVIDER_H
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue