mirror of
https://github.com/S3NEO/android_device_samsung_msm8226-common.git
synced 2024-11-06 21:55:45 +00:00
update everything we missed previously to oreo
This commit is contained in:
parent
1b135312b8
commit
e3deb6ad34
11 changed files with 220 additions and 7566 deletions
|
@ -15,8 +15,13 @@
|
|||
# Inherit from qcom-common
|
||||
-include device/samsung/qcom-common/BoardConfigCommon.mk
|
||||
|
||||
#-include vendor/qcom/proprietary/common/msm8226/BoardConfigVendor.mk
|
||||
|
||||
VENDOR_PATH := device/samsung/msm8226-common
|
||||
|
||||
#QC_PROP_ROOT := vendor/qcom/proprietary
|
||||
#PROTOBUF_SUPPORTED := true
|
||||
|
||||
include device/samsung/msm8226-common/board/*.mk
|
||||
|
||||
TARGET_SPECIFIC_HEADER_PATH := $(VENDOR_PATH)/include
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# Camera
|
||||
TARGET_HAS_LEGACY_CAMERA_HAL1 := true
|
||||
USE_DEVICE_SPECIFIC_CAMERA := true
|
||||
TARGET_HAS_LEGACY_CAMERA_HAL1 := true
|
||||
TARGET_USES_NON_TREBLE_CAMERA := true
|
||||
TARGET_NEEDS_PLATFORM_TEXT_RELOCATIONS := true
|
||||
TARGET_NEEDS_LEGACY_CAMERA_HAL1_DYN_NATIVE_HANDLE := true
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Radio
|
||||
BOARD_PROVIDES_LIBRIL := true
|
||||
BOARD_PROVIDES_LIBRIL := false
|
||||
TARGET_RIL_VARIANT := caf
|
||||
|
|
|
@ -1,23 +1,36 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
system/media/camera/include
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
CameraWrapper.cpp
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libbase libarect
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libhardware liblog libcamera_client libutils libcutils libdl \
|
||||
libhardware \
|
||||
libbase \
|
||||
libhidltransport \
|
||||
liblog \
|
||||
libcamera_client \
|
||||
libutils \
|
||||
libcutils \
|
||||
libgui \
|
||||
libdl \
|
||||
android.hidl.token@1.0-utils \
|
||||
android.hardware.graphics.bufferqueue@1.0
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
framework/native/include \
|
||||
system/media/camera/include
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
libarect \
|
||||
libbase
|
||||
|
||||
LOCAL_HEADER_LIBRARIES := libnativebase_headers
|
||||
|
||||
LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_PROPRIETARY_MODULE := true
|
||||
LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
#include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2016, The CyanogenMod Project
|
||||
* Copyright (C) 2016, The CyanogenMod Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -18,35 +18,25 @@
|
|||
* @file CameraWrapper.cpp
|
||||
*
|
||||
* This file wraps a vendor camera module.
|
||||
*
|
||||
*/
|
||||
|
||||
//#define LOG_NDEBUG 0
|
||||
|
||||
#define LOG_TAG "CameraWrapper"
|
||||
|
||||
#include <camera/CameraParameters.h>
|
||||
#include <camera/Camera.h>
|
||||
#include <cutils/log.h>
|
||||
#include <hardware/camera.h>
|
||||
#include <hardware/hardware.h>
|
||||
#include <utils/String8.h>
|
||||
|
||||
#include <utils/threads.h>
|
||||
#include <utils/String8.h>
|
||||
#include <hardware/hardware.h>
|
||||
#include <hardware/camera.h>
|
||||
#include <camera/Camera.h>
|
||||
#include <camera/CameraParameters.h>
|
||||
|
||||
static const char KEY_DIS[] = "dis";
|
||||
static const char DIS_DISABLE[] = "disable";
|
||||
static const char KEY_ZSL[] = "zsl";
|
||||
static const char ON[] = "on";
|
||||
static const char OFF[] = "off";
|
||||
static const char KEY_PHASE_AF[] = "phase-af";
|
||||
static const char KEY_DYNAMIC_RANGE_CONTROL[] = "dynamic-range-control";
|
||||
static const char KEY_QC_RT_HDR[] = "rt-hdr";
|
||||
static const char KEY_QC_VIDEO_HDR[] = "video-hdr";
|
||||
static const char KEY_QC_VIDEO_HDR_VALUES[] = "video-hdr-values";
|
||||
#define OPEN_RETRIES 10
|
||||
#define OPEN_RETRY_MSEC 40
|
||||
|
||||
#define BACK_CAMERA_ID 0
|
||||
#define FRONT_CAMERA_ID 1
|
||||
|
||||
using namespace android;
|
||||
|
||||
static Mutex gCameraWrapperLock;
|
||||
static android::Mutex gCameraWrapperLock;
|
||||
static camera_module_t *gVendorModule = 0;
|
||||
|
||||
static camera_notify_callback gUserNotifyCb = NULL;
|
||||
|
@ -62,8 +52,15 @@ static int camera_device_open(const hw_module_t *module, const char *name,
|
|||
static int camera_get_number_of_cameras(void);
|
||||
static int camera_get_camera_info(int camera_id, struct camera_info *info);
|
||||
|
||||
const char KEY_QC_AE_BRACKET_HDR[] = "ae-bracket-hdr";
|
||||
const char KEY_QC_CAPTURE_BURST_EXPOSURE[] = "capture-burst-exposures";
|
||||
const char KEY_QC_MORPHO_HDR[] = "morpho-hdr";
|
||||
const char KEY_QC_ZSL[] = "zsl";
|
||||
const char FOCUS_MODE_MANUAL_POSITION[] = "manual";
|
||||
const char WHITE_BALANCE_MANUAL_CCT[] = "manual-cct";
|
||||
|
||||
static struct hw_module_methods_t camera_module_methods = {
|
||||
.open = camera_device_open,
|
||||
.open = camera_device_open
|
||||
};
|
||||
|
||||
camera_module_t HAL_MODULE_INFO_SYM = {
|
||||
|
@ -72,20 +69,20 @@ camera_module_t HAL_MODULE_INFO_SYM = {
|
|||
.module_api_version = CAMERA_MODULE_API_VERSION_1_0,
|
||||
.hal_api_version = HARDWARE_HAL_API_VERSION,
|
||||
.id = CAMERA_HARDWARE_MODULE_ID,
|
||||
.name = "MSM8974 Camera Wrapper",
|
||||
.name = "Armani Camera Wrapper",
|
||||
.author = "The CyanogenMod Project",
|
||||
.methods = &camera_module_methods,
|
||||
.dso = NULL,
|
||||
.reserved = {0},
|
||||
.dso = NULL, /* remove compilation warnings */
|
||||
.reserved = {0}, /* remove compilation warnings */
|
||||
},
|
||||
.get_number_of_cameras = camera_get_number_of_cameras,
|
||||
.get_camera_info = camera_get_camera_info,
|
||||
.set_callbacks = NULL,
|
||||
.get_vendor_tag_ops = NULL,
|
||||
.open_legacy = NULL,
|
||||
.set_torch_mode = NULL,
|
||||
.init = NULL,
|
||||
.reserved = {0},
|
||||
.set_callbacks = NULL, /* remove compilation warnings */
|
||||
.get_vendor_tag_ops = NULL, /* remove compilation warnings */
|
||||
.open_legacy = NULL, /* remove compilation warnings */
|
||||
.set_torch_mode = NULL, /* remove compilation warnings */
|
||||
.init = NULL, /* remove compilation warnings */
|
||||
.reserved = {0}, /* remove compilation warnings */
|
||||
};
|
||||
|
||||
typedef struct wrapper_camera_device {
|
||||
|
@ -99,11 +96,11 @@ typedef struct wrapper_camera_device {
|
|||
__wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \
|
||||
})
|
||||
|
||||
#define CAMERA_ID(device) (((wrapper_camera_device_t *)device)->id)
|
||||
#define CAMERA_ID(device) (((wrapper_camera_device_t *)(device))->id)
|
||||
|
||||
static int check_vendor_module()
|
||||
{
|
||||
int rv;
|
||||
int rv = 0;
|
||||
ALOGV("%s", __FUNCTION__);
|
||||
|
||||
if (gVendorModule)
|
||||
|
@ -112,73 +109,32 @@ static int check_vendor_module()
|
|||
rv = hw_get_module_by_class("camera", "vendor",
|
||||
(const hw_module_t**)&gVendorModule);
|
||||
if (rv)
|
||||
ALOGE("Failed to open vendor camera module %d", rv);
|
||||
|
||||
ALOGE("failed to open vendor camera module");
|
||||
return rv;
|
||||
}
|
||||
|
||||
#define KEY_VIDEO_HFR_VALUES "video-hfr-values"
|
||||
|
||||
// nv12-venus is needed for blobs, but
|
||||
// framework has no idea what it is
|
||||
#define PIXEL_FORMAT_NV12_VENUS "nv12-venus"
|
||||
|
||||
static bool is_4k_video(CameraParameters ¶ms) {
|
||||
int video_width, video_height;
|
||||
params.getVideoSize(&video_width, &video_height);
|
||||
ALOGV("%s : VideoSize is %x", __FUNCTION__, video_width * video_height);
|
||||
return video_width * video_height == 3840 * 2160;
|
||||
}
|
||||
|
||||
static char *camera_fixup_getparams(int __attribute__((unused)) id,
|
||||
const char *settings)
|
||||
static char *camera_fixup_getparams(int id, const char *settings)
|
||||
{
|
||||
CameraParameters params;
|
||||
params.unflatten(String8(settings));
|
||||
android::CameraParameters params;
|
||||
params.unflatten(android::String8(settings));
|
||||
|
||||
#if !LOG_NDEBUG
|
||||
ALOGV("%s: original parameters:", __FUNCTION__);
|
||||
params.dump();
|
||||
#endif
|
||||
|
||||
const char *recordHint = params.get(CameraParameters::KEY_RECORDING_HINT);
|
||||
bool videoMode = recordHint ? !strcmp(recordHint, "true") : false;
|
||||
|
||||
//Hide nv12-venus from Android.
|
||||
if (strcmp (params.getPreviewFormat(), PIXEL_FORMAT_NV12_VENUS) == 0)
|
||||
params.setPreviewFormat(params.PIXEL_FORMAT_YUV420SP);
|
||||
|
||||
const char *videoSizeValues = params.get(
|
||||
CameraParameters::KEY_SUPPORTED_VIDEO_SIZES);
|
||||
if (videoSizeValues) {
|
||||
char videoSizes[strlen(videoSizeValues) + 10 + 1];
|
||||
sprintf(videoSizes, "3840x2160,%s", videoSizeValues);
|
||||
params.set(CameraParameters::KEY_SUPPORTED_VIDEO_SIZES,
|
||||
videoSizes);
|
||||
/* Remove HDR mode in front camera */
|
||||
if (id == 1) {
|
||||
params.set(android::CameraParameters::KEY_SUPPORTED_SCENE_MODES,
|
||||
"auto,asd,landscape,snow,beach,sunset,night,portrait,backlight,sports,steadyphoto,flowers,candlelight,fireworks,party,night-portrait,theatre,action,AR");
|
||||
}
|
||||
|
||||
/* If the vendor has HFR values but doesn't also expose that
|
||||
* this can be turned off, fixup the params to tell the Camera
|
||||
* that it really is okay to turn it off.
|
||||
*/
|
||||
const char *hfrModeValues = params.get(KEY_VIDEO_HFR_VALUES);
|
||||
if (hfrModeValues && !strstr(hfrModeValues, "off")) {
|
||||
char hfrModes[strlen(hfrModeValues) + 4 + 1];
|
||||
sprintf(hfrModes, "%s,off", hfrModeValues);
|
||||
params.set(KEY_VIDEO_HFR_VALUES, hfrModes);
|
||||
}
|
||||
|
||||
/* Enforce video-snapshot-supported to true */
|
||||
if (videoMode) {
|
||||
params.set(CameraParameters::KEY_VIDEO_SNAPSHOT_SUPPORTED, "true");
|
||||
}
|
||||
|
||||
/* advertise video HDR mode support */
|
||||
if (id == BACK_CAMERA_ID)
|
||||
params.set(KEY_QC_VIDEO_HDR_VALUES, "on,off");
|
||||
|
||||
ALOGV("%s: Fixed parameters:", __FUNCTION__);
|
||||
#if !LOG_NDEBUG
|
||||
ALOGV("%s: fixed parameters:", __FUNCTION__);
|
||||
params.dump();
|
||||
#endif
|
||||
|
||||
String8 strParams = params.flatten();
|
||||
android::String8 strParams = params.flatten();
|
||||
char *ret = strdup(strParams.string());
|
||||
|
||||
return ret;
|
||||
|
@ -186,52 +142,53 @@ static char *camera_fixup_getparams(int __attribute__((unused)) id,
|
|||
|
||||
static char *camera_fixup_setparams(int id, const char *settings)
|
||||
{
|
||||
CameraParameters params;
|
||||
params.unflatten(String8(settings));
|
||||
bool videoMode = false;
|
||||
bool hdrMode = false;
|
||||
|
||||
android::CameraParameters params;
|
||||
params.unflatten(android::String8(settings));
|
||||
|
||||
#if !LOG_NDEBUG
|
||||
ALOGV("%s: original parameters:", __FUNCTION__);
|
||||
params.dump();
|
||||
#endif
|
||||
|
||||
bool wasTorch = false;
|
||||
if (fixed_set_params[id]) {
|
||||
/* When torch mode is switched off, it is important not to set ZSL, to
|
||||
avoid a segmentation violation in libcameraservice.so. Hence, check
|
||||
if the last call to setparams enabled torch mode */
|
||||
CameraParameters old_params;
|
||||
old_params.unflatten(String8(fixed_set_params[id]));
|
||||
|
||||
const char *old_flashMode = old_params.get(CameraParameters::KEY_FLASH_MODE);
|
||||
wasTorch = old_flashMode && !strcmp(old_flashMode, CameraParameters::FLASH_MODE_TORCH);
|
||||
if (params.get(android::CameraParameters::KEY_RECORDING_HINT)) {
|
||||
videoMode = !strcmp(params.get(android::CameraParameters::KEY_RECORDING_HINT), "true");
|
||||
}
|
||||
|
||||
const char *recordingHint = params.get(CameraParameters::KEY_RECORDING_HINT);
|
||||
bool isVideo = recordingHint && !strcmp(recordingHint, "true");
|
||||
const char *flashMode = params.get(CameraParameters::KEY_FLASH_MODE);
|
||||
bool isTorch = flashMode && !strcmp(flashMode, CameraParameters::FLASH_MODE_TORCH);
|
||||
if (params.get(android::CameraParameters::KEY_SCENE_MODE)) {
|
||||
hdrMode = (!strcmp(params.get(android::CameraParameters::KEY_SCENE_MODE), "hdr"));
|
||||
}
|
||||
|
||||
if (!isTorch && !wasTorch) {
|
||||
if (isVideo) {
|
||||
params.set(KEY_DIS, DIS_DISABLE);
|
||||
params.set(KEY_ZSL, OFF);
|
||||
/* Disable ZSL and HDR snapshots in video mode */
|
||||
if (videoMode) {
|
||||
params.set(KEY_QC_ZSL, "off");
|
||||
if (hdrMode) {
|
||||
params.set(android::CameraParameters::KEY_SCENE_MODE, "auto");
|
||||
}
|
||||
} else {
|
||||
params.set(KEY_ZSL, ON);
|
||||
}
|
||||
params.set(KEY_QC_ZSL, "on");
|
||||
}
|
||||
|
||||
if (id == BACK_CAMERA_ID) {
|
||||
params.set(KEY_PHASE_AF, ON);
|
||||
params.set(KEY_DYNAMIC_RANGE_CONTROL, ON);
|
||||
if (isVideo) {
|
||||
/* need to translate video-hdr to rt-hdr */
|
||||
const char *vhdr = params.get(KEY_QC_VIDEO_HDR);
|
||||
params.set(KEY_QC_RT_HDR, vhdr && !strcmp(vhdr, "on") ? ON : OFF);
|
||||
}
|
||||
/* Enable Morpho EasyHDR and disable flash in HDR mode */
|
||||
if (hdrMode && !videoMode) {
|
||||
params.set(KEY_QC_MORPHO_HDR, "true");
|
||||
params.set(KEY_QC_AE_BRACKET_HDR, "AE-Bracket");
|
||||
params.set(KEY_QC_CAPTURE_BURST_EXPOSURE, "-6,8,0");
|
||||
params.set(android::CameraParameters::KEY_FLASH_MODE, android::CameraParameters::FLASH_MODE_OFF);
|
||||
} else {
|
||||
params.set(KEY_QC_MORPHO_HDR, "false");
|
||||
params.set(KEY_QC_AE_BRACKET_HDR, "Off");
|
||||
params.set(KEY_QC_CAPTURE_BURST_EXPOSURE, "0,0,0");
|
||||
}
|
||||
|
||||
ALOGV("%s: Fixed parameters:", __FUNCTION__);
|
||||
#if !LOG_NDEBUG
|
||||
ALOGV("%s: fixed parameters:", __FUNCTION__);
|
||||
params.dump();
|
||||
#endif
|
||||
|
||||
String8 strParams = params.flatten();
|
||||
android::String8 strParams = params.flatten();
|
||||
if (fixed_set_params[id])
|
||||
free(fixed_set_params[id]);
|
||||
fixed_set_params[id] = strdup(strParams.string());
|
||||
|
@ -241,10 +198,8 @@ static char *camera_fixup_setparams(int id, const char *settings)
|
|||
}
|
||||
|
||||
/*******************************************************************
|
||||
* Implementation of camera_device_ops functions
|
||||
* implementation of camera_device_ops functions
|
||||
*******************************************************************/
|
||||
static char *camera_get_parameters(struct camera_device *device);
|
||||
static int camera_set_parameters(struct camera_device *device, const char *params);
|
||||
|
||||
static int camera_set_preview_window(struct camera_device *device,
|
||||
struct preview_stream_ops *window)
|
||||
|
@ -389,15 +344,6 @@ static int camera_start_recording(struct camera_device *device)
|
|||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||
|
||||
CameraParameters parameters;
|
||||
parameters.unflatten(String8(camera_get_parameters(device)));
|
||||
|
||||
if (is_4k_video(parameters)) {
|
||||
ALOGV("%s : UHD detected, switching preview-format to nv12-venus", __FUNCTION__);
|
||||
parameters.setPreviewFormat(PIXEL_FORMAT_NV12_VENUS);
|
||||
camera_set_parameters(device, strdup(parameters.flatten().string()));
|
||||
}
|
||||
|
||||
return VENDOR_CALL(device, start_recording);
|
||||
}
|
||||
|
||||
|
@ -488,9 +434,11 @@ static int camera_set_parameters(struct camera_device *device,
|
|||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||
|
||||
char *tmp = camera_fixup_setparams(CAMERA_ID(device), params);
|
||||
char *tmp = NULL;
|
||||
tmp = camera_fixup_setparams(CAMERA_ID(device), params);
|
||||
|
||||
return VENDOR_CALL(device, set_parameters, tmp);
|
||||
int ret = VENDOR_CALL(device, set_parameters, tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *camera_get_parameters(struct camera_device *device)
|
||||
|
@ -504,15 +452,13 @@ static char *camera_get_parameters(struct camera_device *device)
|
|||
char *params = VENDOR_CALL(device, get_parameters);
|
||||
|
||||
char *tmp = camera_fixup_getparams(CAMERA_ID(device), params);
|
||||
|
||||
VENDOR_CALL(device, put_parameters, params);
|
||||
params = tmp;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
static void camera_put_parameters(__unused struct camera_device *device,
|
||||
char *params)
|
||||
static void camera_put_parameters(struct camera_device *device __unused, char *params)
|
||||
{
|
||||
if (params)
|
||||
free(params);
|
||||
|
@ -561,7 +507,7 @@ static int camera_device_close(hw_device_t *device)
|
|||
|
||||
ALOGV("%s", __FUNCTION__);
|
||||
|
||||
Mutex::Autolock lock(gCameraWrapperLock);
|
||||
android::Mutex::Autolock lock(gCameraWrapperLock);
|
||||
|
||||
if (!device) {
|
||||
ret = -EINVAL;
|
||||
|
@ -579,7 +525,6 @@ static int camera_device_close(hw_device_t *device)
|
|||
if (wrapper_dev->base.ops)
|
||||
free(wrapper_dev->base.ops);
|
||||
free(wrapper_dev);
|
||||
|
||||
done:
|
||||
#ifdef HEAPTRACKER
|
||||
heaptracker_free_leaked_memory();
|
||||
|
@ -588,13 +533,12 @@ done:
|
|||
}
|
||||
|
||||
/*******************************************************************
|
||||
* Implementation of camera_module functions
|
||||
* implementation of camera_module functions
|
||||
*******************************************************************/
|
||||
|
||||
/*
|
||||
* Open device handle to one of the cameras
|
||||
/* open device handle to one of the cameras
|
||||
*
|
||||
* Assume camera service will keep singleton of each camera
|
||||
* assume camera service will keep singleton of each camera
|
||||
* so this function will always only be called once per camera instance
|
||||
*/
|
||||
|
||||
|
@ -603,11 +547,11 @@ static int camera_device_open(const hw_module_t *module, const char *name,
|
|||
{
|
||||
int rv = 0;
|
||||
int num_cameras = 0;
|
||||
int camera_id;
|
||||
int cameraid;
|
||||
wrapper_camera_device_t *camera_device = NULL;
|
||||
camera_device_ops_t *camera_ops = NULL;
|
||||
|
||||
Mutex::Autolock lock(gCameraWrapperLock);
|
||||
android::Mutex::Autolock lock(gCameraWrapperLock);
|
||||
|
||||
ALOGV("%s", __FUNCTION__);
|
||||
|
||||
|
@ -615,43 +559,49 @@ static int camera_device_open(const hw_module_t *module, const char *name,
|
|||
if (check_vendor_module())
|
||||
return -EINVAL;
|
||||
|
||||
camera_id = atoi(name);
|
||||
cameraid = atoi(name);
|
||||
num_cameras = gVendorModule->get_number_of_cameras();
|
||||
|
||||
fixed_set_params = (char **) malloc(sizeof(char *) * num_cameras);
|
||||
if (!fixed_set_params) {
|
||||
ALOGE("Parameter memory allocation fail");
|
||||
ALOGE("parameter memory allocation fail");
|
||||
rv = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
memset(fixed_set_params, 0, sizeof(char *) * num_cameras);
|
||||
|
||||
if (camera_id > num_cameras) {
|
||||
ALOGE("Camera service provided camera_id out of bounds, "
|
||||
"camera_id = %d, num supported = %d",
|
||||
camera_id, num_cameras);
|
||||
if (cameraid > num_cameras) {
|
||||
ALOGE("camera service provided cameraid out of bounds, "
|
||||
"cameraid = %d, num supported = %d",
|
||||
cameraid, num_cameras);
|
||||
rv = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
camera_device = (wrapper_camera_device_t*)
|
||||
malloc(sizeof(*camera_device));
|
||||
camera_device = (wrapper_camera_device_t*)malloc(sizeof(*camera_device));
|
||||
if (!camera_device) {
|
||||
ALOGE("camera_device allocation fail");
|
||||
rv = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
memset(camera_device, 0, sizeof(*camera_device));
|
||||
camera_device->id = camera_id;
|
||||
camera_device->id = cameraid;
|
||||
|
||||
int retries = OPEN_RETRIES;
|
||||
bool retry;
|
||||
do {
|
||||
rv = gVendorModule->common.methods->open(
|
||||
(const hw_module_t*)gVendorModule, name,
|
||||
(hw_device_t**)&(camera_device->vendor));
|
||||
retry = --retries > 0 && rv;
|
||||
if (retry)
|
||||
usleep(OPEN_RETRY_MSEC * 1000);
|
||||
} while (retry);
|
||||
if (rv) {
|
||||
ALOGE("Vendor camera open fail");
|
||||
ALOGE("vendor camera open fail");
|
||||
goto fail;
|
||||
}
|
||||
ALOGV("%s: Got vendor camera device 0x%08X",
|
||||
ALOGV("%s: got vendor camera device 0x%08X",
|
||||
__FUNCTION__, (uintptr_t)(camera_device->vendor));
|
||||
|
||||
camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops));
|
||||
|
@ -664,7 +614,7 @@ static int camera_device_open(const hw_module_t *module, const char *name,
|
|||
memset(camera_ops, 0, sizeof(*camera_ops));
|
||||
|
||||
camera_device->base.common.tag = HARDWARE_DEVICE_TAG;
|
||||
camera_device->base.common.version = CAMERA_DEVICE_API_VERSION_1_0;
|
||||
camera_device->base.common.version = HARDWARE_DEVICE_API_VERSION(1, 0);
|
||||
camera_device->base.common.module = (hw_module_t *)(module);
|
||||
camera_device->base.common.close = camera_device_close;
|
||||
camera_device->base.ops = camera_ops;
|
||||
|
@ -726,3 +676,4 @@ static int camera_get_camera_info(int camera_id, struct camera_info *info)
|
|||
return 0;
|
||||
return gVendorModule->get_camera_info(camera_id, info);
|
||||
}
|
||||
|
||||
|
|
11
imx175/Android.mk
Normal file
11
imx175/Android.mk
Normal file
|
@ -0,0 +1,11 @@
|
|||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := imx175_shim.cpp
|
||||
LOCAL_MODULE := libimx175_shim
|
||||
LOCAL_SHARED_LIBRARIES := liblog
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
17
imx175/imx175_shim.cpp
Normal file
17
imx175/imx175_shim.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include <cutils/log.h>
|
||||
#include <sys/types.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C" {
|
||||
int property_get(const char * key, char * value, const char * default_value) {
|
||||
ALOGE("%s: E", __FUNCTION__);
|
||||
if (strcmp("ro.revision", key) == 0) {
|
||||
ALOGE("%s: ro.revision was called!", __FUNCTION__);
|
||||
strcpy(value, "4");
|
||||
return 3;
|
||||
}
|
||||
ALOGE("%s: called other property: %s", __FUNCTION__, key);
|
||||
return ((int( * )(const char * , char *, const char * ))(dlsym((void * ) - 1, "property_get")))(key, value, default_value);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
21
msm8226.mk
21
msm8226.mk
|
@ -33,8 +33,12 @@ TARGET_SCREEN_WIDTH := 720
|
|||
# Audio
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.audio@2.0-impl \
|
||||
android.hardware.audio@2.0-service \
|
||||
android.hardware.audio.effect@2.0-impl \
|
||||
audio_policy.msm8974 \
|
||||
android.hardware.audio.effect@2.0-service \
|
||||
android.hardware.broadcastradio@1.0-impl \
|
||||
android.hardware.soundtrigger@2.0-impl \
|
||||
audio_policy.msm8226 \
|
||||
audio.a2dp.default \
|
||||
audio.primary.msm8226 \
|
||||
audio.r_submix.default \
|
||||
|
@ -52,14 +56,12 @@ PRODUCT_PROPERTY_OVERRIDES += \
|
|||
av.offload.enable=true
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libwvm_shim \
|
||||
imx175_shim
|
||||
|
||||
# Camera
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.camera.provider@2.4-impl-legacy \
|
||||
android.hardware.camera.provider@2.4-service \
|
||||
camera.device@1.0-impl \
|
||||
camera.device@1.0-impl-legacy \
|
||||
libboringssl-compat \
|
||||
camera.msm8226 \
|
||||
libxml2 \
|
||||
|
@ -81,7 +83,8 @@ PRODUCT_PACKAGES += \
|
|||
android.hardware.graphics.allocator@2.0-impl \
|
||||
android.hardware.graphics.allocator@2.0-service \
|
||||
android.hardware.graphics.mapper@2.0-impl \
|
||||
android.hardware.memtrack@1.0-impl
|
||||
android.hardware.memtrack@1.0-impl \
|
||||
android.hardware.memtrack@1.0-service
|
||||
|
||||
# Ebtables
|
||||
PRODUCT_PACKAGES += \
|
||||
|
@ -128,6 +131,7 @@ PRODUCT_PACKAGES += \
|
|||
# DRM
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.drm@1.0-impl \
|
||||
android.hardware.drm@1.0-service
|
||||
|
||||
# Permissions
|
||||
PRODUCT_COPY_FILES += \
|
||||
|
@ -175,11 +179,13 @@ PRODUCT_COPY_FILES += \
|
|||
# Bluetooth
|
||||
PRODUCT_PACKAGES += \
|
||||
libbt-vendor \
|
||||
android.hardware.bluetooth@1.0-impl
|
||||
android.hardware.bluetooth@1.0-impl \
|
||||
android.hardware.bluetooth@1.0-service
|
||||
|
||||
# Keymaster HAL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.keymaster@3.0-impl
|
||||
android.hardware.keymaster@3.0-impl \
|
||||
android.hardware.keymaster@3.0-service
|
||||
|
||||
# Vibrator
|
||||
PRODUCT_PACKAGES += \
|
||||
|
@ -211,6 +217,7 @@ PRODUCT_PACKAGES += \
|
|||
# Lights
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.light@2.0-impl \
|
||||
android.hardware.light@2.0-service \
|
||||
lights.MSM8226
|
||||
|
||||
# Wifi
|
||||
|
|
|
@ -532,6 +532,7 @@ service charger /sbin/healthd -c
|
|||
|
||||
service ds_fmc_appd /system/bin/ds_fmc_appd -p "rmnet0" -D
|
||||
class late_start
|
||||
user root
|
||||
group radio wifi inet
|
||||
disabled
|
||||
oneshot
|
||||
|
@ -576,8 +577,13 @@ service qcamerasvr /system/bin/mm-qcamera-daemon
|
|||
|
||||
service qmuxd /system/bin/qmuxd
|
||||
class main
|
||||
user radio
|
||||
group radio audio bluetooth gps oem_2950 diag log
|
||||
user root
|
||||
group radio audio bluetooth gps oem_2950 diag log qcom_diag
|
||||
|
||||
service netmgrd /system/bin/netmgrd
|
||||
class main
|
||||
user root
|
||||
group radio audio bluetooth gps oem_2950 diag log qcom_diag
|
||||
|
||||
service debug_log /system/bin/sh /debug_log.sh
|
||||
class main
|
||||
|
@ -591,7 +597,7 @@ service qseecomd /system/bin/qseecomd
|
|||
|
||||
service rfs_access /system/bin/rfs_access
|
||||
class core
|
||||
user system
|
||||
user root
|
||||
group system net_raw
|
||||
|
||||
service rmt_storage /system/bin/rmt_storage
|
||||
|
@ -599,13 +605,9 @@ service rmt_storage /system/bin/rmt_storage
|
|||
user root
|
||||
disabled
|
||||
|
||||
on property:neo.netmgr=true
|
||||
start netmgr
|
||||
|
||||
on property:ro.boot.emmc=true
|
||||
start rfs_access
|
||||
start rmt_storage
|
||||
write /sdcard/test 1
|
||||
|
||||
# Limit to SoC reset (1) and independent SSR (3)
|
||||
on property:persist.sys.ssr.restart_level=1
|
||||
|
|
47
system.prop
47
system.prop
|
@ -2,7 +2,6 @@
|
|||
dalvik.vm.dex2oat-swap=false
|
||||
|
||||
# Audio
|
||||
persist.media.treble_omx=false
|
||||
af.fast_track_multiplier=1
|
||||
audio_hal.period_size=192
|
||||
audio.offload.video=true
|
||||
|
@ -33,15 +32,11 @@ ro.bluetooth.dun=true
|
|||
ro.bluetooth.hfp.ver=1.6
|
||||
ro.qualcomm.bt.hci_transport=smd
|
||||
|
||||
# Camera
|
||||
# Camera / Media
|
||||
camera2.portability.force_api=1
|
||||
persist.camera.feature.cac=1
|
||||
persist.camera.snapshot_raw=1
|
||||
persist.camera.dumping=1
|
||||
persist.camera.snap.format=0
|
||||
persist.camera.dumpimg=1
|
||||
persist.camera.dumpmetadata=1
|
||||
persist.camera.zsl_raw=1
|
||||
media.stagefright.legacyencoder=true
|
||||
media.stagefright.less-secure=true
|
||||
persist.media.treble_omx=false
|
||||
|
||||
# Dalvik
|
||||
dalvik.vm.heapstartsize=8m
|
||||
|
@ -70,19 +65,29 @@ sys.io.scheduler=bfq
|
|||
# NFC
|
||||
ro.nfc.port=I2C
|
||||
|
||||
#####
|
||||
# Radio
|
||||
|
||||
ro.debug_level=0x4948
|
||||
|
||||
# Perf
|
||||
ro.vendor.extension_library=/vendor/lib/libqti-perfd-client.so
|
||||
|
||||
persist.data.netmgrd.qos.enable=true
|
||||
persist.data.qmi.adb_logmask=0
|
||||
persist.radio.add_power_save=1
|
||||
rild.libpath=/system/vendor/lib/libsec-ril.so
|
||||
ro.telephony.mms_data_profile=5
|
||||
ro.ril.telephony.qan_resp_strings=6
|
||||
# this prop is only for samsung
|
||||
# ro.debug_level=0x4948
|
||||
#####
|
||||
rild.libpath=/vendor/lib/libril-qc-qmi-1.so
|
||||
rild.libargs=-d /dev/smd0
|
||||
persist.rild.nitz_plmn=
|
||||
persist.rild.nitz_long_ons_0=
|
||||
persist.rild.nitz_long_ons_1=
|
||||
persist.rild.nitz_long_ons_2=
|
||||
persist.rild.nitz_long_ons_3=
|
||||
persist.rild.nitz_short_ons_0=
|
||||
persist.rild.nitz_short_ons_1=
|
||||
persist.rild.nitz_short_ons_2=
|
||||
persist.rild.nitz_short_ons_3=
|
||||
ril.subscription.types=NV,RUIM
|
||||
DEVICE_PROVISIONED=1
|
||||
ro.telephony.default_network=9
|
||||
ro.baseband.arch=msm
|
||||
persist.radio.jbims=1
|
||||
persist.rmnet.mux=enabled
|
||||
persist.data.iwlan.enable=true
|
||||
|
||||
# Ril sends only one RIL_UNSOL_CALL_RING, so set call_ring.multiple to false
|
||||
ro.telephony.call_ring.multiple=0
|
||||
|
|
Loading…
Reference in a new issue