update everything we missed previously to oreo

This commit is contained in:
PythonLimited 2019-01-14 16:20:17 +01:00
parent 1b135312b8
commit e3deb6ad34
11 changed files with 220 additions and 7566 deletions

View file

@ -15,8 +15,13 @@
# Inherit from qcom-common # Inherit from qcom-common
-include device/samsung/qcom-common/BoardConfigCommon.mk -include device/samsung/qcom-common/BoardConfigCommon.mk
#-include vendor/qcom/proprietary/common/msm8226/BoardConfigVendor.mk
VENDOR_PATH := device/samsung/msm8226-common VENDOR_PATH := device/samsung/msm8226-common
#QC_PROP_ROOT := vendor/qcom/proprietary
#PROTOBUF_SUPPORTED := true
include device/samsung/msm8226-common/board/*.mk include device/samsung/msm8226-common/board/*.mk
TARGET_SPECIFIC_HEADER_PATH := $(VENDOR_PATH)/include TARGET_SPECIFIC_HEADER_PATH := $(VENDOR_PATH)/include

View file

@ -1,4 +1,6 @@
# Camera # Camera
TARGET_HAS_LEGACY_CAMERA_HAL1 := true
USE_DEVICE_SPECIFIC_CAMERA := 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_PLATFORM_TEXT_RELOCATIONS := true
TARGET_NEEDS_LEGACY_CAMERA_HAL1_DYN_NATIVE_HANDLE := true

View file

@ -1,3 +1,3 @@
# Radio # Radio
BOARD_PROVIDES_LIBRIL := true BOARD_PROVIDES_LIBRIL := false
TARGET_RIL_VARIANT := caf TARGET_RIL_VARIANT := caf

View file

@ -1,23 +1,36 @@
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_C_INCLUDES := \
system/media/camera/include
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
CameraWrapper.cpp CameraWrapper.cpp
LOCAL_STATIC_LIBRARIES := libbase libarect
LOCAL_SHARED_LIBRARIES := \ 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.hidl.token@1.0-utils \
android.hardware.graphics.bufferqueue@1.0 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_HEADER_LIBRARIES := libnativebase_headers
LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
#include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)

View file

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -18,35 +18,25 @@
* @file CameraWrapper.cpp * @file CameraWrapper.cpp
* *
* This file wraps a vendor camera module. * This file wraps a vendor camera module.
*
*/ */
//#define LOG_NDEBUG 0
#define LOG_TAG "CameraWrapper" #define LOG_TAG "CameraWrapper"
#include <camera/CameraParameters.h>
#include <camera/Camera.h>
#include <cutils/log.h> #include <cutils/log.h>
#include <hardware/camera.h>
#include <hardware/hardware.h>
#include <utils/String8.h>
#include <utils/threads.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"; #define OPEN_RETRIES 10
static const char DIS_DISABLE[] = "disable"; #define OPEN_RETRY_MSEC 40
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 BACK_CAMERA_ID 0 static android::Mutex gCameraWrapperLock;
#define FRONT_CAMERA_ID 1
using namespace android;
static Mutex gCameraWrapperLock;
static camera_module_t *gVendorModule = 0; static camera_module_t *gVendorModule = 0;
static camera_notify_callback gUserNotifyCb = NULL; 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_number_of_cameras(void);
static int camera_get_camera_info(int camera_id, struct camera_info *info); 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 = { static struct hw_module_methods_t camera_module_methods = {
.open = camera_device_open, .open = camera_device_open
}; };
camera_module_t HAL_MODULE_INFO_SYM = { 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, .module_api_version = CAMERA_MODULE_API_VERSION_1_0,
.hal_api_version = HARDWARE_HAL_API_VERSION, .hal_api_version = HARDWARE_HAL_API_VERSION,
.id = CAMERA_HARDWARE_MODULE_ID, .id = CAMERA_HARDWARE_MODULE_ID,
.name = "MSM8974 Camera Wrapper", .name = "Armani Camera Wrapper",
.author = "The CyanogenMod Project", .author = "The CyanogenMod Project",
.methods = &camera_module_methods, .methods = &camera_module_methods,
.dso = NULL, .dso = NULL, /* remove compilation warnings */
.reserved = {0}, .reserved = {0}, /* remove compilation warnings */
}, },
.get_number_of_cameras = camera_get_number_of_cameras, .get_number_of_cameras = camera_get_number_of_cameras,
.get_camera_info = camera_get_camera_info, .get_camera_info = camera_get_camera_info,
.set_callbacks = NULL, .set_callbacks = NULL, /* remove compilation warnings */
.get_vendor_tag_ops = NULL, .get_vendor_tag_ops = NULL, /* remove compilation warnings */
.open_legacy = NULL, .open_legacy = NULL, /* remove compilation warnings */
.set_torch_mode = NULL, .set_torch_mode = NULL, /* remove compilation warnings */
.init = NULL, .init = NULL, /* remove compilation warnings */
.reserved = {0}, .reserved = {0}, /* remove compilation warnings */
}; };
typedef struct wrapper_camera_device { typedef struct wrapper_camera_device {
@ -99,11 +96,11 @@ typedef struct wrapper_camera_device {
__wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \ __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() static int check_vendor_module()
{ {
int rv; int rv = 0;
ALOGV("%s", __FUNCTION__); ALOGV("%s", __FUNCTION__);
if (gVendorModule) if (gVendorModule)
@ -112,73 +109,32 @@ static int check_vendor_module()
rv = hw_get_module_by_class("camera", "vendor", rv = hw_get_module_by_class("camera", "vendor",
(const hw_module_t**)&gVendorModule); (const hw_module_t**)&gVendorModule);
if (rv) if (rv)
ALOGE("Failed to open vendor camera module %d", rv); ALOGE("failed to open vendor camera module");
return rv; return rv;
} }
#define KEY_VIDEO_HFR_VALUES "video-hfr-values" static char *camera_fixup_getparams(int id, const char *settings)
// 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 &params) {
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)
{ {
CameraParameters params; android::CameraParameters params;
params.unflatten(String8(settings)); params.unflatten(android::String8(settings));
#if !LOG_NDEBUG
ALOGV("%s: original parameters:", __FUNCTION__); ALOGV("%s: original parameters:", __FUNCTION__);
params.dump(); params.dump();
#endif
const char *recordHint = params.get(CameraParameters::KEY_RECORDING_HINT); /* Remove HDR mode in front camera */
bool videoMode = recordHint ? !strcmp(recordHint, "true") : false; if (id == 1) {
params.set(android::CameraParameters::KEY_SUPPORTED_SCENE_MODES,
//Hide nv12-venus from Android. "auto,asd,landscape,snow,beach,sunset,night,portrait,backlight,sports,steadyphoto,flowers,candlelight,fireworks,party,night-portrait,theatre,action,AR");
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);
} }
/* If the vendor has HFR values but doesn't also expose that #if !LOG_NDEBUG
* this can be turned off, fixup the params to tell the Camera ALOGV("%s: fixed parameters:", __FUNCTION__);
* 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__);
params.dump(); params.dump();
#endif
String8 strParams = params.flatten(); android::String8 strParams = params.flatten();
char *ret = strdup(strParams.string()); char *ret = strdup(strParams.string());
return ret; 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) static char *camera_fixup_setparams(int id, const char *settings)
{ {
CameraParameters params; bool videoMode = false;
params.unflatten(String8(settings)); bool hdrMode = false;
android::CameraParameters params;
params.unflatten(android::String8(settings));
#if !LOG_NDEBUG
ALOGV("%s: original parameters:", __FUNCTION__); ALOGV("%s: original parameters:", __FUNCTION__);
params.dump(); params.dump();
#endif
bool wasTorch = false; if (params.get(android::CameraParameters::KEY_RECORDING_HINT)) {
if (fixed_set_params[id]) { videoMode = !strcmp(params.get(android::CameraParameters::KEY_RECORDING_HINT), "true");
/* 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);
} }
const char *recordingHint = params.get(CameraParameters::KEY_RECORDING_HINT); if (params.get(android::CameraParameters::KEY_SCENE_MODE)) {
bool isVideo = recordingHint && !strcmp(recordingHint, "true"); hdrMode = (!strcmp(params.get(android::CameraParameters::KEY_SCENE_MODE), "hdr"));
const char *flashMode = params.get(CameraParameters::KEY_FLASH_MODE); }
bool isTorch = flashMode && !strcmp(flashMode, CameraParameters::FLASH_MODE_TORCH);
if (!isTorch && !wasTorch) { /* Disable ZSL and HDR snapshots in video mode */
if (isVideo) { if (videoMode) {
params.set(KEY_DIS, DIS_DISABLE); params.set(KEY_QC_ZSL, "off");
params.set(KEY_ZSL, OFF); if (hdrMode) {
params.set(android::CameraParameters::KEY_SCENE_MODE, "auto");
}
} else { } else {
params.set(KEY_ZSL, ON); params.set(KEY_QC_ZSL, "on");
}
} }
if (id == BACK_CAMERA_ID) { /* Enable Morpho EasyHDR and disable flash in HDR mode */
params.set(KEY_PHASE_AF, ON); if (hdrMode && !videoMode) {
params.set(KEY_DYNAMIC_RANGE_CONTROL, ON); params.set(KEY_QC_MORPHO_HDR, "true");
if (isVideo) { params.set(KEY_QC_AE_BRACKET_HDR, "AE-Bracket");
/* need to translate video-hdr to rt-hdr */ params.set(KEY_QC_CAPTURE_BURST_EXPOSURE, "-6,8,0");
const char *vhdr = params.get(KEY_QC_VIDEO_HDR); params.set(android::CameraParameters::KEY_FLASH_MODE, android::CameraParameters::FLASH_MODE_OFF);
params.set(KEY_QC_RT_HDR, vhdr && !strcmp(vhdr, "on") ? ON : 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(); params.dump();
#endif
String8 strParams = params.flatten(); android::String8 strParams = params.flatten();
if (fixed_set_params[id]) if (fixed_set_params[id])
free(fixed_set_params[id]); free(fixed_set_params[id]);
fixed_set_params[id] = strdup(strParams.string()); 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, static int camera_set_preview_window(struct camera_device *device,
struct preview_stream_ops *window) 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, ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); (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); 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, ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); (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) 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 *params = VENDOR_CALL(device, get_parameters);
char *tmp = camera_fixup_getparams(CAMERA_ID(device), params); char *tmp = camera_fixup_getparams(CAMERA_ID(device), params);
VENDOR_CALL(device, put_parameters, params); VENDOR_CALL(device, put_parameters, params);
params = tmp; params = tmp;
return params; return params;
} }
static void camera_put_parameters(__unused struct camera_device *device, static void camera_put_parameters(struct camera_device *device __unused, char *params)
char *params)
{ {
if (params) if (params)
free(params); free(params);
@ -561,7 +507,7 @@ static int camera_device_close(hw_device_t *device)
ALOGV("%s", __FUNCTION__); ALOGV("%s", __FUNCTION__);
Mutex::Autolock lock(gCameraWrapperLock); android::Mutex::Autolock lock(gCameraWrapperLock);
if (!device) { if (!device) {
ret = -EINVAL; ret = -EINVAL;
@ -579,7 +525,6 @@ static int camera_device_close(hw_device_t *device)
if (wrapper_dev->base.ops) if (wrapper_dev->base.ops)
free(wrapper_dev->base.ops); free(wrapper_dev->base.ops);
free(wrapper_dev); free(wrapper_dev);
done: done:
#ifdef HEAPTRACKER #ifdef HEAPTRACKER
heaptracker_free_leaked_memory(); 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 * 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 rv = 0;
int num_cameras = 0; int num_cameras = 0;
int camera_id; int cameraid;
wrapper_camera_device_t *camera_device = NULL; wrapper_camera_device_t *camera_device = NULL;
camera_device_ops_t *camera_ops = NULL; camera_device_ops_t *camera_ops = NULL;
Mutex::Autolock lock(gCameraWrapperLock); android::Mutex::Autolock lock(gCameraWrapperLock);
ALOGV("%s", __FUNCTION__); ALOGV("%s", __FUNCTION__);
@ -615,43 +559,49 @@ static int camera_device_open(const hw_module_t *module, const char *name,
if (check_vendor_module()) if (check_vendor_module())
return -EINVAL; return -EINVAL;
camera_id = atoi(name); cameraid = atoi(name);
num_cameras = gVendorModule->get_number_of_cameras(); num_cameras = gVendorModule->get_number_of_cameras();
fixed_set_params = (char **) malloc(sizeof(char *) *num_cameras); fixed_set_params = (char **) malloc(sizeof(char *) * num_cameras);
if (!fixed_set_params) { if (!fixed_set_params) {
ALOGE("Parameter memory allocation fail"); ALOGE("parameter memory allocation fail");
rv = -ENOMEM; rv = -ENOMEM;
goto fail; goto fail;
} }
memset(fixed_set_params, 0, sizeof(char *) * num_cameras); memset(fixed_set_params, 0, sizeof(char *) * num_cameras);
if (camera_id > num_cameras) { if (cameraid > num_cameras) {
ALOGE("Camera service provided camera_id out of bounds, " ALOGE("camera service provided cameraid out of bounds, "
"camera_id = %d, num supported = %d", "cameraid = %d, num supported = %d",
camera_id, num_cameras); cameraid, num_cameras);
rv = -EINVAL; rv = -EINVAL;
goto fail; goto fail;
} }
camera_device = (wrapper_camera_device_t*) camera_device = (wrapper_camera_device_t*)malloc(sizeof(*camera_device));
malloc(sizeof(*camera_device));
if (!camera_device) { if (!camera_device) {
ALOGE("camera_device allocation fail"); ALOGE("camera_device allocation fail");
rv = -ENOMEM; rv = -ENOMEM;
goto fail; goto fail;
} }
memset(camera_device, 0, sizeof(*camera_device)); 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( rv = gVendorModule->common.methods->open(
(const hw_module_t*)gVendorModule, name, (const hw_module_t*)gVendorModule, name,
(hw_device_t**)&(camera_device->vendor)); (hw_device_t**)&(camera_device->vendor));
retry = --retries > 0 && rv;
if (retry)
usleep(OPEN_RETRY_MSEC * 1000);
} while (retry);
if (rv) { if (rv) {
ALOGE("Vendor camera open fail"); ALOGE("vendor camera open fail");
goto 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)); __FUNCTION__, (uintptr_t)(camera_device->vendor));
camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops)); 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)); memset(camera_ops, 0, sizeof(*camera_ops));
camera_device->base.common.tag = HARDWARE_DEVICE_TAG; 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.module = (hw_module_t *)(module);
camera_device->base.common.close = camera_device_close; camera_device->base.common.close = camera_device_close;
camera_device->base.ops = camera_ops; 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 0;
return gVendorModule->get_camera_info(camera_id, info); return gVendorModule->get_camera_info(camera_id, info);
} }

11
imx175/Android.mk Normal file
View 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
View 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

View file

@ -33,8 +33,12 @@ TARGET_SCREEN_WIDTH := 720
# Audio # Audio
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.audio@2.0-impl \ android.hardware.audio@2.0-impl \
android.hardware.audio@2.0-service \
android.hardware.audio.effect@2.0-impl \ 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.a2dp.default \
audio.primary.msm8226 \ audio.primary.msm8226 \
audio.r_submix.default \ audio.r_submix.default \
@ -52,14 +56,12 @@ PRODUCT_PROPERTY_OVERRIDES += \
av.offload.enable=true av.offload.enable=true
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
libwvm_shim \
imx175_shim imx175_shim
# Camera # Camera
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-impl-legacy \ android.hardware.camera.provider@2.4-impl-legacy \
android.hardware.camera.provider@2.4-service \ camera.device@1.0-impl-legacy \
camera.device@1.0-impl \
libboringssl-compat \ libboringssl-compat \
camera.msm8226 \ camera.msm8226 \
libxml2 \ libxml2 \
@ -81,7 +83,8 @@ PRODUCT_PACKAGES += \
android.hardware.graphics.allocator@2.0-impl \ android.hardware.graphics.allocator@2.0-impl \
android.hardware.graphics.allocator@2.0-service \ android.hardware.graphics.allocator@2.0-service \
android.hardware.graphics.mapper@2.0-impl \ 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 # Ebtables
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
@ -128,6 +131,7 @@ PRODUCT_PACKAGES += \
# DRM # DRM
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.drm@1.0-impl \ android.hardware.drm@1.0-impl \
android.hardware.drm@1.0-service
# Permissions # Permissions
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
@ -175,11 +179,13 @@ PRODUCT_COPY_FILES += \
# Bluetooth # Bluetooth
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
libbt-vendor \ libbt-vendor \
android.hardware.bluetooth@1.0-impl android.hardware.bluetooth@1.0-impl \
android.hardware.bluetooth@1.0-service
# Keymaster HAL # Keymaster HAL
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.keymaster@3.0-impl android.hardware.keymaster@3.0-impl \
android.hardware.keymaster@3.0-service
# Vibrator # Vibrator
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
@ -211,6 +217,7 @@ PRODUCT_PACKAGES += \
# Lights # Lights
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.light@2.0-impl \ android.hardware.light@2.0-impl \
android.hardware.light@2.0-service \
lights.MSM8226 lights.MSM8226
# Wifi # Wifi

View file

@ -532,6 +532,7 @@ service charger /sbin/healthd -c
service ds_fmc_appd /system/bin/ds_fmc_appd -p "rmnet0" -D service ds_fmc_appd /system/bin/ds_fmc_appd -p "rmnet0" -D
class late_start class late_start
user root
group radio wifi inet group radio wifi inet
disabled disabled
oneshot oneshot
@ -576,8 +577,13 @@ service qcamerasvr /system/bin/mm-qcamera-daemon
service qmuxd /system/bin/qmuxd service qmuxd /system/bin/qmuxd
class main class main
user radio user root
group radio audio bluetooth gps oem_2950 diag log 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 service debug_log /system/bin/sh /debug_log.sh
class main class main
@ -591,7 +597,7 @@ service qseecomd /system/bin/qseecomd
service rfs_access /system/bin/rfs_access service rfs_access /system/bin/rfs_access
class core class core
user system user root
group system net_raw group system net_raw
service rmt_storage /system/bin/rmt_storage service rmt_storage /system/bin/rmt_storage
@ -599,13 +605,9 @@ service rmt_storage /system/bin/rmt_storage
user root user root
disabled disabled
on property:neo.netmgr=true
start netmgr
on property:ro.boot.emmc=true on property:ro.boot.emmc=true
start rfs_access start rfs_access
start rmt_storage start rmt_storage
write /sdcard/test 1
# Limit to SoC reset (1) and independent SSR (3) # Limit to SoC reset (1) and independent SSR (3)
on property:persist.sys.ssr.restart_level=1 on property:persist.sys.ssr.restart_level=1

View file

@ -2,7 +2,6 @@
dalvik.vm.dex2oat-swap=false dalvik.vm.dex2oat-swap=false
# Audio # Audio
persist.media.treble_omx=false
af.fast_track_multiplier=1 af.fast_track_multiplier=1
audio_hal.period_size=192 audio_hal.period_size=192
audio.offload.video=true audio.offload.video=true
@ -33,15 +32,11 @@ ro.bluetooth.dun=true
ro.bluetooth.hfp.ver=1.6 ro.bluetooth.hfp.ver=1.6
ro.qualcomm.bt.hci_transport=smd ro.qualcomm.bt.hci_transport=smd
# Camera # Camera / Media
camera2.portability.force_api=1 camera2.portability.force_api=1
persist.camera.feature.cac=1 media.stagefright.legacyencoder=true
persist.camera.snapshot_raw=1 media.stagefright.less-secure=true
persist.camera.dumping=1 persist.media.treble_omx=false
persist.camera.snap.format=0
persist.camera.dumpimg=1
persist.camera.dumpmetadata=1
persist.camera.zsl_raw=1
# Dalvik # Dalvik
dalvik.vm.heapstartsize=8m dalvik.vm.heapstartsize=8m
@ -70,19 +65,29 @@ sys.io.scheduler=bfq
# NFC # NFC
ro.nfc.port=I2C ro.nfc.port=I2C
#####
# Radio # Radio
# this prop is only for samsung
ro.debug_level=0x4948 # ro.debug_level=0x4948
#####
# Perf rild.libpath=/vendor/lib/libril-qc-qmi-1.so
ro.vendor.extension_library=/vendor/lib/libqti-perfd-client.so rild.libargs=-d /dev/smd0
persist.rild.nitz_plmn=
persist.data.netmgrd.qos.enable=true persist.rild.nitz_long_ons_0=
persist.data.qmi.adb_logmask=0 persist.rild.nitz_long_ons_1=
persist.radio.add_power_save=1 persist.rild.nitz_long_ons_2=
rild.libpath=/system/vendor/lib/libsec-ril.so persist.rild.nitz_long_ons_3=
ro.telephony.mms_data_profile=5 persist.rild.nitz_short_ons_0=
ro.ril.telephony.qan_resp_strings=6 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 # Ril sends only one RIL_UNSOL_CALL_RING, so set call_ring.multiple to false
ro.telephony.call_ring.multiple=0 ro.telephony.call_ring.multiple=0