Merge branch 'lineage-15.1' into origin/tmp

This commit is contained in:
PythonLimited 2018-08-06 09:24:23 +02:00
commit f9a3852163
48 changed files with 477 additions and 1174 deletions

View file

@ -20,25 +20,31 @@ VENDOR_PATH := device/samsung/msm8226-common
include device/samsung/msm8226-common/board/*.mk
TARGET_SPECIFIC_HEADER_PATH := $(VENDOR_PATH)/include
# CMHW
BOARD_HARDWARE_CLASS += $(VENDOR_PATH)/cmhw
# Filesystem
TARGET_FS_CONFIG_GEN := device/samsung/msm8226-common/config.fs
#ADB
TARGET_USES_LEGACY_ADB_INTERFACE :=true
#HIDL
PRODUCT_COPY_FILES += \
$(VENDOR_PATH)/manifest.xml:system/vendor/manifest.xml
# Custom RIL class
BOARD_RIL_CLASS := ../../../$(VENDOR_PATH)/ril
# Fonts
EXTENDED_FONT_FOOTPRINT := true
# FMRadio
AUDIO_FEATURE_ENABLED_FM := true
TARGET_QCOM_NO_FM_FIRMWARE := true
BOARD_HAVE_QCOM_FM := true
# Properties (reset them here, include more in device if needed)
TARGET_SYSTEM_PROP := $(VENDOR_PATH)/system.prop
# SELinux
-include device/qcom/sepolicy/sepolicy.mk
BOARD_SEPOLICY_DIRS += $(VENDOR_PATH)/sepolicy
include device/qcom/sepolicy/sepolicy.mk
include device/qcom/sepolicy/legacy-sepolicy.mk

3
board/art.mk Normal file
View file

@ -0,0 +1,3 @@
# ART
WITH_DEXPREOPT := true
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true

View file

@ -1,6 +1,4 @@
# Camera
TARGET_HAS_LEGACY_CAMERA_HAL1 := true
TARGET_PROVIDES_CAMERA_HAL := true
USE_DEVICE_SPECIFIC_CAMERA := true
#Faceproc needs this to load
TARGET_NEEDS_PLATFORM_TEXT_RELOCATIONS := true

5
board/shims.mk Normal file
View file

@ -0,0 +1,5 @@
# Shims
TARGET_LD_SHIM_LIBS += \
/system/vendor/lib/libwvm.so|libwvm_shim.so \
/system/lib/libcrypto.so|libboringssl-compat.so \
/system/vendor/lib/libmmcamera_imx175.so|libimx175_shim.so

View file

@ -1,72 +1,19 @@
ifeq ($(TARGET_PROVIDES_CAMERA_HAL),true)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
ifeq ($(TARGET_NEED_DISABLE_AUTOFOCUS),true)
LOCAL_CFLAGS += -DDISABLE_AUTOFOCUS
endif
ifeq ($(TARGET_NEED_DISABLE_FACE_DETECTION),true)
LOCAL_CFLAGS += -DDISABLE_FACE_DETECTION
endif
ifeq ($(TARGET_NEED_DISABLE_FACE_DETECTION_BOTH_CAMERAS),true)
LOCAL_CFLAGS += -DDISABLE_FACE_DETECTION_BOTH_CAMERAS
endif
ifeq ($(TARGET_NEED_CAMERA_ZSL),true)
LOCAL_CFLAGS += -DENABLE_ZSL
endif
ifeq ($(TARGET_NEED_FFC_PICTURE_FIXUP),true)
LOCAL_CFLAGS += -DFFC_PICTURE_FIXUP
endif
ifeq ($(TARGET_NEED_FFC_VIDEO_FIXUP),true)
LOCAL_CFLAGS += -DFFC_VIDEO_FIXUP
endif
ifeq ($(TARGET_NEED_SAMSUNG_CAMERA_MODE),true)
LOCAL_CFLAGS += -DSAMSUNG_CAMERA_MODE
endif
ifeq ($(TARGET_ADD_ISO_MODE_50),true)
LOCAL_CFLAGS += -DISO_MODE_50
endif
ifeq ($(TARGET_ADD_ISO_MODE_1600),true)
LOCAL_CFLAGS += -DISO_MODE_1600
endif
ifeq ($(TARGET_ADD_ISO_MODE_HJR),true)
LOCAL_CFLAGS += -DISO_MODE_HJR
endif
LOCAL_C_INCLUDES := \
framework/native/include \
system/media/camera/include
system/media/camera/include \
frameworks/native/include/media/openmax
LOCAL_SRC_FILES := \
CameraWrapper.cpp
LOCAL_SHARED_LIBRARIES := \
libhardware \
liblog \
libcamera_client \
libgui \
libhidltransport \
libutils \
android.hidl.token@1.0-utils
libhardware liblog libcamera_client libutils libcutils libgui libsensor
LOCAL_STATIC_LIBRARIES := \
libarect
LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/hw
LOCAL_MODULE := camera.msm8226
LOCAL_MODULE_TAGS := optional
LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_SHARED_LIBRARY)
endif

View file

@ -1,6 +1,6 @@
/*
* Copyright (C) 2013-2016, The CyanogenMod Project
* Copyright (C) 2017, The LineageOS Project
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2018 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,21 +23,26 @@
*/
//#define LOG_NDEBUG 0
#define LOG_TAG "CameraWrapper"
#include <cutils/log.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>
#include <hardware/camera.h>
#include <hardware/hardware.h>
#include <utils/String8.h>
#include <utils/threads.h>
static android::Mutex gCameraWrapperLock;
static camera_module_t* gVendorModule = 0;
#include "CameraWrapper.h"
static char** fixed_set_params = NULL;
static const char PIXEL_FORMAT_YUV420SP_NV21E[] = "yuv420sp-nv21e";
#define BACK_CAMERA 0
#define FRONT_CAMERA 1
using namespace android;
static Mutex gCameraWrapperLock;
static camera_module_t *gVendorModule = 0;
static camera_notify_callback gUserNotifyCb = NULL;
static camera_data_callback gUserDataCb = NULL;
@ -45,231 +50,123 @@ static camera_data_timestamp_callback gUserDataCbTimestamp = NULL;
static camera_request_memory gUserGetMemory = NULL;
static void *gUserCameraDevice = NULL;
static int camera_device_open(const hw_module_t* module, const char* name, hw_device_t** device);
static char **fixed_set_params = NULL;
static int camera_device_open(const hw_module_t *module, const char *name,
hw_device_t **device);
static int camera_get_number_of_cameras(void);
static int camera_get_camera_info(int camera_id, struct camera_info* info);
static int camera_send_command(struct camera_device* device, int32_t cmd, int32_t arg1,
int32_t arg2);
static int camera_get_camera_info(int camera_id, struct camera_info *info);
static struct hw_module_methods_t camera_module_methods = {
.open = camera_device_open,
.open = camera_device_open
};
camera_module_t HAL_MODULE_INFO_SYM = {
.common =
{
.tag = HARDWARE_MODULE_TAG,
.module_api_version = CAMERA_MODULE_API_VERSION_1_0,
.hal_api_version = HARDWARE_HAL_API_VERSION,
.id = CAMERA_HARDWARE_MODULE_ID,
.name = "Samsung msm8930 Camera Wrapper",
.author = "The CyanogenMod Project",
.methods = &camera_module_methods,
.dso = NULL, /* remove compilation warnings */
.reserved = {0}, /* remove compilation warnings */
},
.common = {
.tag = HARDWARE_MODULE_TAG,
.version_major = 1,
.version_minor = 0,
.id = CAMERA_HARDWARE_MODULE_ID,
.name = "msm8226 Camera Wrapper",
.author = "The CyanogenMod Project",
.methods = &camera_module_methods,
.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, /* remove compilation warnings */
.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 */
.open_legacy = NULL, /* remove compilation warnings */
.set_torch_mode = camera_set_torch_mode,
.init = NULL, /* remove compilation warnings */
.reserved = {0}, /* remove compilation warnings */
};
typedef struct wrapper_camera_device {
camera_device_t base;
int camera_released;
int id;
camera_device_t* vendor;
camera_device_t *vendor;
} wrapper_camera_device_t;
void camera_notify_cb(int32_t msg_type, int32_t ext1, int32_t ext2, void * /*user*/) {
gUserNotifyCb(msg_type, ext1, ext2, gUserCameraDevice);
}
#define VENDOR_CALL(device, func, ...) ({ \
wrapper_camera_device_t *__wrapper_dev = (wrapper_camera_device_t*) device; \
__wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \
})
void camera_data_cb(int32_t msg_type, const camera_memory_t *data, unsigned int index,
camera_frame_metadata_t *metadata, void * /*user*/) {
gUserDataCb(msg_type, data, index, metadata, gUserCameraDevice);
}
#define CAMERA_ID(device) (((wrapper_camera_device_t *)(device))->id)
void camera_data_cb_timestamp(nsecs_t timestamp, int32_t msg_type,
const camera_memory_t *data, unsigned index, void * /*user*/) {
gUserDataCbTimestamp(timestamp, msg_type, data, index, gUserCameraDevice);
}
camera_memory_t* camera_get_memory(int fd, size_t buf_size,
uint_t num_bufs, void * /*user*/) {
return gUserGetMemory(fd, buf_size, num_bufs, gUserCameraDevice);
}
#define VENDOR_CALL(device, func, ...) \
({ \
wrapper_camera_device_t* __wrapper_dev = (wrapper_camera_device_t*)device; \
__wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \
})
#define CAMERA_ID(device) (((wrapper_camera_device_t*)(device))->id)
static int check_vendor_module() {
static int check_vendor_module()
{
int rv = 0;
ALOGV("%s", __FUNCTION__);
if (gVendorModule) return 0;
if (gVendorModule)
return 0;
rv = hw_get_module_by_class("camera", "vendor", (const hw_module_t**)&gVendorModule);
if (rv) ALOGE("failed to open vendor camera module");
rv = hw_get_module_by_class("camera", "vendor",
(const hw_module_t**)&gVendorModule);
if (rv)
ALOGE("failed to open vendor camera module");
return rv;
}
const static char* iso_values[] = {
"auto,"
#ifdef ISO_MODE_50
"ISO50,"
#endif
#ifdef ISO_MODE_HJR
"ISO_HJR,"
#endif
"ISO100,ISO200,ISO400,ISO800"
#ifdef ISO_MODE_1600
",ISO1600"
#endif
};
static char* camera_fixup_getparams(int id, const char* settings) {
android::CameraParameters params;
params.unflatten(android::String8(settings));
static char *camera_fixup_getparams(int id, const char *settings)
{
CameraParameters params;
params.unflatten(String8(settings));
#if !LOG_NDEBUG
ALOGV("%s: original parameters:", __FUNCTION__);
params.dump();
#endif
params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]);
params.set(android::CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO, "1280x720");
params.set(android::CameraParameters::KEY_SUPPORTED_SCENE_MODES,
"auto,asd,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,"
"steadyphoto,fireworks,sports,party,candlelight,backlight,flowers,AR");
// fix params here
params.set(android::CameraParameters::KEY_EXPOSURE_COMPENSATION_STEP, "0.5");
params.set(android::CameraParameters::KEY_MIN_EXPOSURE_COMPENSATION, "-2");
params.set(android::CameraParameters::KEY_MAX_EXPOSURE_COMPENSATION, "2");
#ifdef FFC_PICTURE_FIXUP
if (id == 1) {
params.set(android::CameraParameters::KEY_SUPPORTED_PICTURE_SIZES,
"1392x1392,1280x720,640x480");
}
#endif
#ifdef FFC_VIDEO_FIXUP
if (id == 1) {
if (!params.get(android::CameraParameters::KEY_SUPPORTED_VIDEO_SIZES)) {
params.set(android::CameraParameters::KEY_SUPPORTED_VIDEO_SIZES,
"1280x720,640x480,320x240,176x144");
}
}
#endif
params.set(android::CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "640x360,640x480,352x288,320x240,176x144");
#ifdef DISABLE_FACE_DETECTION
#ifndef DISABLE_FACE_DETECTION_BOTH_CAMERAS
/* Disable face detection for front facing camera */
if (id == 1) {
#endif
params.remove(android::CameraParameters::KEY_QC_FACE_RECOGNITION);
params.remove(android::CameraParameters::KEY_QC_SUPPORTED_FACE_RECOGNITION);
params.remove(android::CameraParameters::KEY_QC_SUPPORTED_FACE_RECOGNITION_MODES);
params.remove(android::CameraParameters::KEY_QC_FACE_DETECTION);
params.remove(android::CameraParameters::KEY_QC_SUPPORTED_FACE_DETECTION);
params.remove(android::CameraParameters::KEY_FACE_DETECTION);
params.remove(android::CameraParameters::KEY_SUPPORTED_FACE_DETECTION);
#ifndef DISABLE_FACE_DETECTION_BOTH_CAMERAS
}
#endif
#endif
/* Enforce video-snapshot-supported to true */
params.set(android::CameraParameters::KEY_VIDEO_SNAPSHOT_SUPPORTED, "true");
#if !LOG_NDEBUG
ALOGV("%s: fixed parameters:", __FUNCTION__);
params.dump();
#endif
android::String8 strParams = params.flatten();
char* ret = strdup(strParams.string());
String8 strParams = params.flatten();
char *ret = strdup(strParams.string());
return ret;
}
static bool wasVideo = false;
static char* camera_fixup_setparams(struct camera_device* device, const char* settings) {
int id = CAMERA_ID(device);
android::CameraParameters params;
params.unflatten(android::String8(settings));
const char* camMode = params.get(android::CameraParameters::KEY_SAMSUNG_CAMERA_MODE);
const char* recordingHint = params.get(android::CameraParameters::KEY_RECORDING_HINT);
bool isVideo = false;
if (recordingHint) isVideo = !strcmp(recordingHint, "true");
static char *camera_fixup_setparams(int id, const char *settings)
{
CameraParameters params;
params.unflatten(String8(settings));
#if !LOG_NDEBUG
ALOGV("%s: original parameters:", __FUNCTION__);
params.dump();
#endif
if (params.get("iso")) {
const char* isoMode = params.get(android::CameraParameters::KEY_ISO_MODE);
if (strcmp(isoMode, "ISO50") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "50");
else if (strcmp(isoMode, "ISO100") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "100");
else if (strcmp(isoMode, "ISO200") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "200");
else if (strcmp(isoMode, "ISO400") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "400");
else if (strcmp(isoMode, "ISO800") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "800");
else if (strcmp(isoMode, "ISO1600") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "1600");
}
#ifdef SAMSUNG_CAMERA_MODE
/* Samsung camcorder mode */
if (id == 1) {
/* Enable for front camera only */
if (!(!strcmp(camMode, "1") && !isVideo) || wasVideo) {
/* Enable only if not already set (Snapchat) but do enable if the setting is left
over while switching from stills to video */
if ((!strcmp(params.get(android::CameraParameters::KEY_PREVIEW_FRAME_RATE), "15") ||
(!strcmp(params.get(android::CameraParameters::KEY_PREVIEW_SIZE), "320x240") &&
!strcmp(params.get(android::CameraParameters::KEY_JPEG_QUALITY), "96"))) &&
!isVideo) {
/* Do not set for video chat in Hangouts (Frame rate 15) or Skype (Preview size
320x240 and jpeg quality 96 */
} else {
/* "Normal case". Required to prevent distorted video and reboots
while taking snaps */
params.set(android::CameraParameters::KEY_SAMSUNG_CAMERA_MODE, isVideo ? "1" : "0");
}
wasVideo = (isVideo || wasVideo);
}
} else {
wasVideo = false;
}
#endif
#ifdef ENABLE_ZSL
if (id != 1) {
params.set(android::CameraParameters::KEY_ZSL, isVideo ? "off" : "on");
params.set(android::CameraParameters::KEY_CAMERA_MODE, isVideo ? "0" : "1");
}
#endif
params.set(android::CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "640x360,640x480,528x432,352x288,320x240,176x144");
params.set(android::CameraParameters::KEY_PREVIEW_FPS_RANGE, "7500,30000");
#if !LOG_NDEBUG
ALOGV("%s: fixed parameters:", __FUNCTION__);
params.dump();
#endif
android::String8 strParams = params.flatten();
if (fixed_set_params[id]) free(fixed_set_params[id]);
String8 strParams = params.flatten();
if (fixed_set_params[id])
free(fixed_set_params[id]);
fixed_set_params[id] = strdup(strParams.string());
char* ret = fixed_set_params[id];
char *ret = fixed_set_params[id];
return ret;
}
@ -278,24 +175,49 @@ static char* camera_fixup_setparams(struct camera_device* device, const char* se
* implementation of camera_device_ops functions
*******************************************************************/
static int camera_set_preview_window(struct camera_device* device,
struct preview_stream_ops* window) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_set_preview_window(struct camera_device *device,
struct preview_stream_ops *window)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, set_preview_window, window);
}
static void camera_set_callbacks(struct camera_device* device, camera_notify_callback notify_cb,
camera_data_callback data_cb,
camera_data_timestamp_callback data_cb_timestamp,
camera_request_memory get_memory, void* user) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
void camera_notify_cb(int32_t msg_type, int32_t ext1, int32_t ext2, void *user) {
gUserNotifyCb(msg_type, ext1, ext2, gUserCameraDevice);
}
if (!device) return;
void camera_data_cb(int32_t msg_type, const camera_memory_t *data, unsigned int index,
camera_frame_metadata_t *metadata, void *user) {
gUserDataCb(msg_type, data, index, metadata, gUserCameraDevice);
}
void camera_data_cb_timestamp(nsecs_t timestamp, int32_t msg_type,
const camera_memory_t *data, unsigned index, void *user) {
gUserDataCbTimestamp(timestamp, msg_type, data, index, gUserCameraDevice);
}
camera_memory_t* camera_get_memory(int fd, size_t buf_size,
uint_t num_bufs, void *user) {
return gUserGetMemory(fd, buf_size, num_bufs, gUserCameraDevice);
}
static void camera_set_callbacks(struct camera_device *device,
camera_notify_callback notify_cb,
camera_data_callback data_cb,
camera_data_timestamp_callback data_cb_timestamp,
camera_request_memory get_memory,
void *user)
{
if (!device)
return;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
gUserNotifyCb = notify_cb;
gUserDataCb = data_cb;
@ -307,226 +229,264 @@ static void camera_set_callbacks(struct camera_device* device, camera_notify_cal
camera_data_cb_timestamp, camera_get_memory, user);
}
static void camera_enable_msg_type(struct camera_device* device, int32_t msg_type) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static void camera_enable_msg_type(struct camera_device *device,
int32_t msg_type)
{
if (!device)
return;
if (!device) return;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
VENDOR_CALL(device, enable_msg_type, msg_type);
}
static void camera_disable_msg_type(struct camera_device* device, int32_t msg_type) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static void camera_disable_msg_type(struct camera_device *device,
int32_t msg_type)
{
if (!device)
return;
if (!device) return;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
VENDOR_CALL(device, disable_msg_type, msg_type);
}
static int camera_msg_type_enabled(struct camera_device* device, int32_t msg_type) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_msg_type_enabled(struct camera_device *device,
int32_t msg_type)
{
if (!device)
return 0;
if (!device) return 0;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, msg_type_enabled, msg_type);
}
static int camera_start_preview(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_start_preview(struct camera_device *device)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, start_preview);
}
static void camera_stop_preview(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static void camera_stop_preview(struct camera_device *device)
{
if (!device)
return;
if (!device) return;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
VENDOR_CALL(device, stop_preview);
}
static int camera_preview_enabled(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_preview_enabled(struct camera_device *device)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, preview_enabled);
}
static int camera_store_meta_data_in_buffers(struct camera_device* device, int enable) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_store_meta_data_in_buffers(struct camera_device *device,
int enable)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, store_meta_data_in_buffers, enable);
}
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));
static int camera_start_recording(struct camera_device *device)
{
if (!device)
return EINVAL;
if (!device) return EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, start_recording);
}
static void camera_stop_recording(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static void camera_stop_recording(struct camera_device *device)
{
if (!device)
return;
if (!device) return;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
VENDOR_CALL(device, stop_recording);
}
static int camera_recording_enabled(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_recording_enabled(struct camera_device *device)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, recording_enabled);
}
static void camera_release_recording_frame(struct camera_device* device, const void* opaque) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static void camera_release_recording_frame(struct camera_device *device,
const void *opaque)
{
if (!device)
return;
if (!device) return;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
VENDOR_CALL(device, release_recording_frame, opaque);
}
static int camera_auto_focus(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_auto_focus(struct camera_device *device)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, auto_focus);
}
static int camera_cancel_auto_focus(struct camera_device* device) {
int ret = 0;
static int camera_cancel_auto_focus(struct camera_device *device)
{
if (!device)
return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
if (!device) return -EINVAL;
/* APEXQ/EXPRESS: Calling cancel_auto_focus causes the camera to crash for unknown reasons.
* Disabling it has no adverse effect. For others, only call cancel_auto_focus when the
* preview is enabled. This is needed so some 3rd party camera apps don't lock up. */
#ifndef DISABLE_AUTOFOCUS
if (camera_preview_enabled(device)) ret = VENDOR_CALL(device, cancel_auto_focus);
#endif
return ret;
return VENDOR_CALL(device, cancel_auto_focus);
}
static int camera_take_picture(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_take_picture(struct camera_device *device)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, take_picture);
}
static int camera_cancel_picture(struct camera_device* device) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_cancel_picture(struct camera_device *device)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, cancel_picture);
}
static int camera_set_parameters(struct camera_device* device, const char* params) {
static int camera_set_parameters(struct camera_device *device,
const char *params)
{
if (!device)
return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
if (!device) return -EINVAL;
char* tmp = NULL;
tmp = camera_fixup_setparams(device, params);
char *tmp = NULL;
tmp = camera_fixup_setparams(CAMERA_ID(device), params);
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)
{
if (!device)
return NULL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
if (!device) return NULL;
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);
params = tmp;
return params;
}
static void camera_put_parameters(struct camera_device* device, char* params) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
if (params) free(params);
static void camera_put_parameters(struct camera_device *device, char *params)
{
if (params)
free(params);
}
static int camera_send_command(struct camera_device* device, int32_t cmd, int32_t arg1,
int32_t arg2) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_send_command(struct camera_device *device,
int32_t cmd, int32_t arg1, int32_t arg2)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, send_command, cmd, arg1, arg2);
}
static void camera_release(struct camera_device* device) {
static void camera_release(struct camera_device *device)
{
wrapper_camera_device_t* wrapper_dev = NULL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(wrapper_dev->vendor));
if (!device)
return;
if (!device) return;
wrapper_dev = (wrapper_camera_device_t*) device;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
VENDOR_CALL(device, release);
wrapper_dev->camera_released = true;
}
static int camera_dump(struct camera_device* device, int fd) {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
static int camera_dump(struct camera_device *device, int fd)
{
if (!device)
return -EINVAL;
if (!device) return -EINVAL;
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
return VENDOR_CALL(device, dump, fd);
}
extern "C" void heaptracker_free_leaked_memory(void);
static int camera_device_close(hw_device_t* device) {
static int camera_device_close(hw_device_t *device)
{
int ret = 0;
wrapper_camera_device_t* wrapper_dev = NULL;
wrapper_camera_device_t *wrapper_dev = NULL;
ALOGV("%s", __FUNCTION__);
android::Mutex::Autolock lock(gCameraWrapperLock);
Mutex::Autolock lock(gCameraWrapperLock);
if (!device) {
ret = -EINVAL;
@ -534,10 +494,11 @@ static int camera_device_close(hw_device_t* device) {
}
for (int i = 0; i < camera_get_number_of_cameras(); i++) {
if (fixed_set_params[i]) free(fixed_set_params[i]);
if (fixed_set_params[i])
free(fixed_set_params[i]);
}
wrapper_dev = (wrapper_camera_device_t*)device;
wrapper_dev = (wrapper_camera_device_t*) device;
if (!wrapper_dev->camera_released) {
ALOGI("%s: releasing camera device with id %d", __FUNCTION__,
@ -549,7 +510,8 @@ static int camera_device_close(hw_device_t* device) {
}
wrapper_dev->vendor->common.close((hw_device_t*)wrapper_dev->vendor);
if (wrapper_dev->base.ops) free(wrapper_dev->base.ops);
if (wrapper_dev->base.ops)
free(wrapper_dev->base.ops);
free(wrapper_dev);
done:
#ifdef HEAPTRACKER
@ -568,37 +530,38 @@ done:
* so this function will always only be called once per camera instance
*/
static int camera_device_open(const hw_module_t* module, const char* name, hw_device_t** device) {
static int camera_device_open(const hw_module_t *module, const char *name,
hw_device_t **device)
{
int rv = 0;
int num_cameras = 0;
int cameraid;
wrapper_camera_device_t* camera_device = NULL;
camera_device_ops_t* camera_ops = NULL;
wasVideo = false;
wrapper_camera_device_t *camera_device = NULL;
camera_device_ops_t *camera_ops = NULL;
android::Mutex::Autolock lock(gCameraWrapperLock);
Mutex::Autolock lock(gCameraWrapperLock);
ALOGV("%s", __FUNCTION__);
if (name != NULL) {
if (check_vendor_module()) return -EINVAL;
if (check_vendor_module())
return -EINVAL;
cameraid = atoi(name);
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) {
ALOGE("parameter memory allocation fail");
rv = -ENOMEM;
goto fail;
}
memset(fixed_set_params, 0, sizeof(char*) * num_cameras);
memset(fixed_set_params, 0, sizeof(char *) * num_cameras);
if (cameraid > num_cameras) {
ALOGE(
"camera service provided cameraid out of bounds, "
"cameraid = %d, num supported = %d",
cameraid, num_cameras);
ALOGE("camera service provided cameraid out of bounds, "
"cameraid = %d, num supported = %d",
cameraid, num_cameras);
rv = -EINVAL;
goto fail;
}
@ -613,14 +576,15 @@ static int camera_device_open(const hw_module_t* module, const char* name, hw_de
camera_device->camera_released = false;
camera_device->id = cameraid;
rv = gVendorModule->common.methods->open((const hw_module_t*)gVendorModule, name,
(hw_device_t**)&(camera_device->vendor));
rv = gVendorModule->common.methods->open(
(const hw_module_t*)gVendorModule, name,
(hw_device_t**)&(camera_device->vendor));
if (rv) {
ALOGE("vendor camera open fail");
goto fail;
}
ALOGV("%s: got vendor camera device 0x%08X", __FUNCTION__,
(uintptr_t)(camera_device->vendor));
ALOGV("%s: got vendor camera device 0x%08X",
__FUNCTION__, (uintptr_t)(camera_device->vendor));
camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops));
if (!camera_ops) {
@ -632,8 +596,8 @@ static int camera_device_open(const hw_module_t* module, const char* name, hw_de
memset(camera_ops, 0, sizeof(*camera_ops));
camera_device->base.common.tag = HARDWARE_DEVICE_TAG;
camera_device->base.common.version = HARDWARE_DEVICE_API_VERSION(1, 0);
camera_device->base.common.module = (hw_module_t*)(module);
camera_device->base.common.version = CAMERA_MODULE_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;
@ -679,14 +643,26 @@ fail:
return rv;
}
static int camera_get_number_of_cameras(void) {
static int camera_get_number_of_cameras(void)
{
ALOGV("%s", __FUNCTION__);
if (check_vendor_module()) return 0;
if (check_vendor_module())
return 0;
return gVendorModule->get_number_of_cameras();
}
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)
{
ALOGV("%s", __FUNCTION__);
if (check_vendor_module()) return 0;
if (check_vendor_module())
return 0;
return gVendorModule->get_camera_info(camera_id, info);
}
static int camera_set_torch_mode(const char* camera_id, bool enabled)
{
ALOGV("%s", __FUNCTION__);
if (check_vendor_module())
return 0;
return gVendorModule->set_torch_mode(camera_id, enabled);
}

19
camera/CameraWrapper.h Normal file
View file

@ -0,0 +1,19 @@
/*
* Copyright (C) 2018, The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <hardware/camera.h>
static int camera_set_torch_mode(const char* camera_id, bool enabled);

8
config.fs Normal file
View file

@ -0,0 +1,8 @@
[AID_QCOM_DIAG]
value:2950
[AID_RFS]
value:2951
[AID_RFS_SHARED]
value:2952

View file

@ -11,7 +11,7 @@
<hal format="hidl">
<name>android.hardware.wifi</name>
<transport>hwbinder</transport>
<version>1.0</version>
<version>1.1</version>
<interface>
<name>IWifi</name>
<instance>default</instance>
@ -54,11 +54,11 @@
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.ir</name>
<name>android.hardware.sensors</name>
<transport arch="32">passthrough</transport>
<version>1.0</version>
<interface>
<name>IConsumerIr</name>
<name>ISensors</name>
<instance>default</instance>
</interface>
</hal>

View file

@ -32,26 +32,25 @@ TARGET_SCREEN_WIDTH := 720
# Audio
PRODUCT_PACKAGES += \
audiod \
android.hardware.audio@2.0-impl \
android.hardware.audio.effect@2.0-impl \
audio_policy.msm8974 \
audio.a2dp.default \
audio.primary.msm8226 \
audio.r_submix.default \
audio.usb.default
# Also Audio
PRODUCT_PACKAGES += \
android.hardware.audio@2.0-impl \
android.hardware.audio.effect@2.0-impl \
android.hardware.broadcastradio@1.0-impl \
android.hardware.soundtrigger@2.0-impl
PRODUCT_PACKAGES += \
audio.usb.default \
libaudio-resampler \
libqcompostprocbundle \
libqcomvisualizer \
libqcompostprocbundle \
libqcomvoiceprocessing \
tinymix
# System properties
PRODUCT_PROPERTY_OVERRIDES += \
audio.offload.buffer.size.kb=32 \
audio.offload.gapless.enabled=false \
av.offload.enable=true
PRODUCT_PACKAGES += \
libwvm_shim \
imx175_shim
@ -59,11 +58,14 @@ PRODUCT_PACKAGES += \
# Camera
PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-impl \
camera.device@3.2-impl \
camera.msm8226 \
camera.device@1.0-impl \
libboringssl-compat \
camera.msm8226 \
libxml2 \
Snap
libshims_camera \
libshim_qcopt \
libshims_sensorlistener \
Camera2
# CRDA
PRODUCT_PACKAGES += \
@ -80,7 +82,6 @@ PRODUCT_PACKAGES += \
memtrack.msm8226 \
android.hardware.graphics.allocator@2.0-impl \
android.hardware.graphics.allocator@2.0-service \
android.hardware.graphics.composer@2.1-impl \
android.hardware.graphics.mapper@2.0-impl \
android.hardware.memtrack@1.0-impl
@ -169,6 +170,10 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/_hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/_hals.conf
# Sensors
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/_hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/_hals.conf
# Bluetooth
PRODUCT_PACKAGES += \
libbt-vendor \

View file

@ -1,24 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2015, 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.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources>
<!-- Base "touch slop" value used by ViewConfiguration as a
movement threshold where scrolling should begin. -->
<dimen name="config_viewConfigurationTouchSlop">4dp</dimen>
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Operating voltage for bluetooth controller. 0 by default-->
<integer translatable="false" name="config_bluetooth_operating_voltage_mv">3300</integer>
<!-- Default list of files pinned by the Pinner Service -->
<string-array translatable="false" name="config_defaultPinnerServiceFiles">
<item>"/system/framework/arm/boot-framework.oat"</item>
<item>"/system/framework/arm/boot-framework.vdex"</item>
<item>"/system/framework/oat/arm/services.odex"</item>
<item>"/system/framework/oat/arm/services.vdex"</item>
<item>"/system/framework/arm/boot.oat"</item>
<item>"/system/framework/arm/boot.vdex"</item>
<item>"/system/framework/arm/boot-core-libart.oat"</item>
<item>"/system/framework/arm/boot-core-libart.vdex"</item>
</string-array>
<!-- Should the pinner service pin the Camera application? -->
<bool name="config_pinnerCameraApp">true</bool>
<bool name="config_setColorTransformAccelerated">false</bool>
</resources>

View file

@ -1,13 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := liblog libcutils libbinder libutils
LOCAL_SRC_FILES := \
ril_shim.c
LOCAL_MODULE := libril_shim
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
include $(BUILD_SHARED_LIBRARY)

View file

@ -1,70 +0,0 @@
/*
* Copyright (C) 2015 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "SEC_RIL_SHIM"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <utils/Log.h>
//various funcs we'll need to call, in their mangled form
//android::Parcel::writeString16(char16_t const*, unsigned int)
extern void _ZN7android6Parcel13writeString16EPKDsj(void **str16P,
uint16_t const *str, unsigned int len);
//code exports we provide
void _ZN7android6Parcel13writeString16EPKtj(void **str16P,
unsigned short const *str, unsigned int len);
//library on-load and on-unload handlers (to help us set things up and tear them down)
void libEvtLoading(void) __attribute__((constructor));
void libEvtUnloading(void) __attribute__((destructor));
/*
* FUNCTION: android::Parcel::writeString16(unsigned short const*, unsigned int)
* USE: INTERPOSE: write String16 to binder
* NOTES: This function no longer exists in M, instead now one must pass
* in a char16_t instead of a short. M So we'll craft the same call here.
*/
void _ZN7android6Parcel13writeString16EPKtj(void **str16P,
unsigned short const *str, unsigned int len)
{
_ZN7android6Parcel13writeString16EPKDsj(str16P, str, len);
}
/*
* FUNCTION: libEvtLoading()
* USE: Handle library loading
* NOTES: This is a good time to log the fact that we were loaded and plan to
* do our thing.
*/
void libEvtLoading(void)
{
ALOGV("libbinder interposition library loaded");
}
/*
* FUNCTION: libEvtUnloading()
* USE: Handle library unloading
* NOTES: This is a good time to free whatever is unfreed and say goodbye
*/
void libEvtUnloading(void)
{
ALOGV("libbinder interposition library unloading. Goodbye...");
}

View file

@ -1,375 +0,0 @@
/*
* Copyright (c) 2014, The CyanogenMod Project. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony;
import static com.android.internal.telephony.RILConstants.*;
import android.content.Context;
import android.telephony.Rlog;
import android.os.AsyncResult;
import android.os.Message;
import android.os.Parcel;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.SignalStrength;
import com.android.internal.telephony.uicc.IccCardApplicationStatus;
import com.android.internal.telephony.uicc.IccCardStatus;
import java.util.ArrayList;
import java.util.Collections;
import com.android.internal.telephony.uicc.IccUtils;
/**
* Qualcomm RIL for Samsung MSM8226 Single-sim devices
* {@hide}
*/
public class SamsungMSM8226RIL extends RIL {
private static final int RIL_REQUEST_DIAL_EMERGENCY = 10001;
private static final int RIL_UNSOL_ON_SS_LL = 11055;
public SamsungMSM8226RIL(Context context, int preferredNetworkType, int cdmaSubscription) {
super(context, preferredNetworkType, cdmaSubscription, null);
mQANElements = 6;
}
public SamsungMSM8226RIL(Context context, int preferredNetworkType,
int cdmaSubscription, Integer instanceId) {
super(context, preferredNetworkType, cdmaSubscription, instanceId);
mQANElements = 6;
}
@Override
public void
dial(String address, int clirMode, UUSInfo uusInfo, Message result) {
if (PhoneNumberUtils.isEmergencyNumber(address)) {
dialEmergencyCall(address, clirMode, result);
return;
}
RILRequest rr = RILRequest.obtain(RIL_REQUEST_DIAL, result);
rr.mParcel.writeString(address);
rr.mParcel.writeInt(clirMode);
rr.mParcel.writeInt(0); // CallDetails.call_type
rr.mParcel.writeInt(1); // CallDetails.call_domain
rr.mParcel.writeString(""); // CallDetails.getCsvFromExtras
if (uusInfo == null) {
rr.mParcel.writeInt(0); // UUS information is absent
} else {
rr.mParcel.writeInt(1); // UUS information is present
rr.mParcel.writeInt(uusInfo.getType());
rr.mParcel.writeInt(uusInfo.getDcs());
rr.mParcel.writeByteArray(uusInfo.getUserData());
}
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
send(rr);
}
@Override
protected Object
responseIccCardStatus(Parcel p) {
IccCardApplicationStatus appStatus;
IccCardStatus cardStatus = new IccCardStatus();
cardStatus.setCardState(p.readInt());
cardStatus.setUniversalPinState(p.readInt());
cardStatus.mGsmUmtsSubscriptionAppIndex = p.readInt();
cardStatus.mCdmaSubscriptionAppIndex = p.readInt();
cardStatus.mImsSubscriptionAppIndex = p.readInt();
int numApplications = p.readInt();
// limit to maximum allowed applications
if (numApplications > IccCardStatus.CARD_MAX_APPS) {
numApplications = IccCardStatus.CARD_MAX_APPS;
}
cardStatus.mApplications = new IccCardApplicationStatus[numApplications];
for (int i = 0 ; i < numApplications ; i++) {
appStatus = new IccCardApplicationStatus();
appStatus.app_type = appStatus.AppTypeFromRILInt(p.readInt());
appStatus.app_state = appStatus.AppStateFromRILInt(p.readInt());
appStatus.perso_substate = appStatus.PersoSubstateFromRILInt(p.readInt());
appStatus.aid = p.readString();
appStatus.app_label = p.readString();
appStatus.pin1_replaced = p.readInt();
appStatus.pin1 = appStatus.PinStateFromRILInt(p.readInt());
appStatus.pin2 = appStatus.PinStateFromRILInt(p.readInt());
p.readInt(); // pin1_num_retries
p.readInt(); // puk1_num_retries
p.readInt(); // pin2_num_retries
p.readInt(); // puk2_num_retries
p.readInt(); // perso_unblock_retries
cardStatus.mApplications[i] = appStatus;
}
return cardStatus;
}
@Override
protected Object
responseCallList(Parcel p) {
int num;
int voiceSettings;
ArrayList<DriverCall> response;
DriverCall dc;
num = p.readInt();
response = new ArrayList<DriverCall>(num);
if (RILJ_LOGV) {
riljLog("responseCallList: num=" + num +
" mEmergencyCallbackModeRegistrant=" + mEmergencyCallbackModeRegistrant +
" mTestingEmergencyCall=" + mTestingEmergencyCall.get());
}
for (int i = 0 ; i < num ; i++) {
dc = new DriverCall();
dc.state = DriverCall.stateFromCLCC(p.readInt());
dc.index = p.readInt() & 0xff;
dc.TOA = p.readInt();
dc.isMpty = (0 != p.readInt());
dc.isMT = (0 != p.readInt());
dc.als = p.readInt();
voiceSettings = p.readInt();
dc.isVoice = (0 == voiceSettings) ? false : true;
boolean isVideo;
int call_type = p.readInt(); // Samsung CallDetails
int call_domain = p.readInt(); // Samsung CallDetails
String csv = p.readString(); // Samsung CallDetails
dc.isVoicePrivacy = (0 != p.readInt());
dc.number = p.readString();
int np = p.readInt();
dc.numberPresentation = DriverCall.presentationFromCLIP(np);
dc.name = p.readString();
dc.namePresentation = DriverCall.presentationFromCLIP(p.readInt());
int uusInfoPresent = p.readInt();
if (uusInfoPresent == 1) {
dc.uusInfo = new UUSInfo();
dc.uusInfo.setType(p.readInt());
dc.uusInfo.setDcs(p.readInt());
byte[] userData = p.createByteArray();
dc.uusInfo.setUserData(userData);
riljLogv(String.format("Incoming UUS : type=%d, dcs=%d, length=%d",
dc.uusInfo.getType(), dc.uusInfo.getDcs(),
dc.uusInfo.getUserData().length));
riljLogv("Incoming UUS : data (string)="
+ new String(dc.uusInfo.getUserData()));
riljLogv("Incoming UUS : data (hex): "
+ IccUtils.bytesToHexString(dc.uusInfo.getUserData()));
} else {
riljLogv("Incoming UUS : NOT present!");
}
// Make sure there's a leading + on addresses with a TOA of 145
dc.number = PhoneNumberUtils.stringFromStringAndTOA(dc.number, dc.TOA);
response.add(dc);
if (dc.isVoicePrivacy) {
mVoicePrivacyOnRegistrants.notifyRegistrants();
riljLog("InCall VoicePrivacy is enabled");
} else {
mVoicePrivacyOffRegistrants.notifyRegistrants();
riljLog("InCall VoicePrivacy is disabled");
}
}
Collections.sort(response);
if ((num == 0) && mTestingEmergencyCall.getAndSet(false)) {
if (mEmergencyCallbackModeRegistrant != null) {
riljLog("responseCallList: call ended, testing emergency call," +
" notify ECM Registrants");
mEmergencyCallbackModeRegistrant.notifyRegistrant();
}
}
return response;
}
@Override
protected Object
responseSignalStrength(Parcel p) {
int gsmSignalStrength = p.readInt() & 0xff;
int gsmBitErrorRate = p.readInt();
int cdmaDbm = p.readInt();
int cdmaEcio = p.readInt();
int evdoDbm = p.readInt();
int evdoEcio = p.readInt();
int evdoSnr = p.readInt();
int lteSignalStrength = p.readInt();
int lteRsrp = p.readInt();
int lteRsrq = p.readInt();
int lteRssnr = p.readInt();
int lteCqi = p.readInt();
int tdScdmaRscp = p.readInt();
// constructor sets default true, makeSignalStrengthFromRilParcel does not set it
boolean isGsm = true;
if ((lteSignalStrength & 0xff) == 255 || lteSignalStrength == 99) {
lteSignalStrength = 99;
lteRsrp = SignalStrength.INVALID;
lteRsrq = SignalStrength.INVALID;
lteRssnr = SignalStrength.INVALID;
lteCqi = SignalStrength.INVALID;
} else {
lteSignalStrength &= 0xff;
}
if (RILJ_LOGD)
riljLog("gsmSignalStrength:" + gsmSignalStrength + " gsmBitErrorRate:" + gsmBitErrorRate +
" cdmaDbm:" + cdmaDbm + " cdmaEcio:" + cdmaEcio + " evdoDbm:" + evdoDbm +
" evdoEcio: " + evdoEcio + " evdoSnr:" + evdoSnr +
" lteSignalStrength:" + lteSignalStrength + " lteRsrp:" + lteRsrp +
" lteRsrq:" + lteRsrq + " lteRssnr:" + lteRssnr + " lteCqi:" + lteCqi +
" tdScdmaRscp:" + tdScdmaRscp + " isGsm:" + (isGsm ? "true" : "false"));
return new SignalStrength(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio, evdoDbm,
evdoEcio, evdoSnr, lteSignalStrength, lteRsrp, lteRsrq, lteRssnr, lteCqi,
tdScdmaRscp, isGsm);
}
@Override
protected void
processUnsolicited (Parcel p, int type) {
Object ret;
int dataPosition = p.dataPosition();
int response = p.readInt();
int newResponse = response;
switch(response) {
case RIL_UNSOL_ON_SS_LL:
newResponse = RIL_UNSOL_ON_SS;
break;
}
if (newResponse != response) {
p.setDataPosition(dataPosition);
p.writeInt(newResponse);
}
p.setDataPosition(dataPosition);
super.processUnsolicited(p, type);
}
@Override
public void
acceptCall (Message result) {
RILRequest rr
= RILRequest.obtain(RIL_REQUEST_ANSWER, result);
rr.mParcel.writeInt(1);
rr.mParcel.writeInt(0);
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
send(rr);
}
private void
dialEmergencyCall(String address, int clirMode, Message result) {
RILRequest rr;
rr = RILRequest.obtain(RIL_REQUEST_DIAL_EMERGENCY, result);
rr.mParcel.writeString(address);
rr.mParcel.writeInt(clirMode);
rr.mParcel.writeInt(0); // CallDetails.call_type
rr.mParcel.writeInt(3); // CallDetails.call_domain
rr.mParcel.writeString(""); // CallDetails.getCsvFromExtra
rr.mParcel.writeInt(0); // Unknown
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
send(rr);
}
@Override
protected RILRequest
processSolicited (Parcel p, int type) {
int serial, error;
boolean found = false;
int dataPosition = p.dataPosition(); // save off position within the Parcel
serial = p.readInt();
error = p.readInt();
RILRequest rr = null;
/* Pre-process the reply before popping it */
synchronized (mRequestList) {
RILRequest tr = mRequestList.get(serial);
if (tr != null && tr.mSerial == serial) {
if (error == 0 || p.dataAvail() > 0) {
try {switch (tr.mRequest) {
/* Get those we're interested in */
case RIL_REQUEST_DATA_REGISTRATION_STATE:
rr = tr;
break;
}} catch (Throwable thr) {
// Exceptions here usually mean invalid RIL responses
if (tr.mResult != null) {
AsyncResult.forMessage(tr.mResult, null, thr);
tr.mResult.sendToTarget();
}
return tr;
}
}
}
}
if (rr == null) {
/* Nothing we care about, go up */
p.setDataPosition(dataPosition);
// Forward responses that we are not overriding to the super class
return super.processSolicited(p, type);
}
rr = findAndRemoveRequestFromList(serial);
if (rr == null) {
return rr;
}
Object ret = null;
if (error == 0 || p.dataAvail() > 0) {
switch (rr.mRequest) {
case RIL_REQUEST_DATA_REGISTRATION_STATE: ret = responseDataRegistrationState(p); break;
default:
throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest);
}
//break;
}
if (RILJ_LOGD) riljLog(rr.serialString() + "< " + requestToString(rr.mRequest)
+ " " + retToString(rr.mRequest, ret));
if (rr.mResult != null) {
AsyncResult.forMessage(rr.mResult, ret, null);
rr.mResult.sendToTarget();
}
return rr;
}
private Object
responseDataRegistrationState(Parcel p) {
String response[] = (String[])responseStrings(p);
/* DANGER WILL ROBINSON
* In some cases from Vodaphone we are receiving a RAT of 102
* while in tunnels of the metro. Lets Assume that if we
* receive 102 we actually want a RAT of 2 for EDGE service */
if (response.length > 4 &&
response[0].equals("1") &&
response[3].equals("102")) {
response[3] = "2";
}
return response;
}
}

View file

@ -1,89 +1,73 @@
# Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
on init
on enable-low-power
write /sys/module/lpm_levels/enable_low_power/l2 4
write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
# HMP scheduler settings
write /proc/sys/kernel/sched_ravg_hist_size 3
write /proc/sys/kernel/sched_window_stats_policy 3
# HMP Task packing settings for 8226
write /proc/sys/kernel/sched_small_task 50
# disable thermal core_control to update interactive governor settings
write /sys/module/msm_thermal/core_control/enabled 0
# Switch to interactive and let PowerHAL configure it
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/target_loads
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
# enable thermal core_control now
write /sys/module/msm_thermal/core_control/enabled 1
# bring all CPUs online
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
# Enable low power modes
write /sys/module/lpm_levels/parameters/sleep_disabled 0
write /sys/module/msm_thermal/core_control/enabled 1
# Set RPS mask
write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 2
# add a cpuset for the camera daemon
# we want all the cores for camera
mkdir /dev/cpuset/camera-daemon
chown system system /dev/cpuset/camera-daemon
chown system system /dev/cpuset/camera-daemon/tasks
chmod 0664 /dev/cpuset/camera-daemon/tasks
# Update foreground and background cpusets
# Reserve CPU 3 for the top app
write /dev/cpuset/foreground/cpus 0-2
write /dev/cpuset/background/cpus 0-2
write /dev/cpuset/system-background/cpus 0-1
write /dev/cpuset/top-app/cpus 0-3
write /dev/cpuset/camera-daemon/cpus 0-3
on charger
write /sys/module/lpm_levels/enable_low_power/l2 4
write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
write /sys/module/lpm_levels/parameters/sleep_disabled 0
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"
write /sys/module/msm_thermal/core_control/enabled 0
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
write /sys/module/msm_thermal/core_control/enabled 1
write /sys/devices/system/cpu/cpu1/online 0
write /sys/devices/system/cpu/cpu2/online 0
write /sys/devices/system/cpu/cpu3/online 0
on boot
on class_start:late_start
trigger enable-low-power
on property:init.svc.recovery=running
trigger enable-low-power
on property:dev.bootcomplete=1
setprop sys.io.scheduler "bfq"

View file

@ -30,7 +30,6 @@ import init.qcom.usb.rc
import init.target.rc
on early-init
export LD_SHIM_LIBS "/system/lib/hw/camera.vendor.msm8226.so|libboringssl-compat.so:/system/vendor/lib/libqomx_jpegenc.so|libboringssl-compat.so:/system/lib/libcrypto.so|libboringssl-compat.so:/system/lib/libril.so|libril_shim.so:/system/vendor/lib/libwvm.so|libwvm_shim.so:/system/vendor/lib/libmmcamera_imx175.so|libimx175_shim.so"
mount debugfs debugfs /sys/kernel/debug
@ -671,16 +670,3 @@ service dhcpcd_bnep3 /system/bin/dhcpcd -BKLG
service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG
disabled
oneshot
# Dual-sim support
on property:persist.radio.multisim.config=dsds
stop ril-daemon
start ril-daemon
start ril-daemon1
service ril-daemon1 /vendor/bin/hw/rild -l /system/lib/libsec-ril-dsds.so -c 2
class main
user radio
disabled
group radio cache inet misc audio log system drmrpc sdcard_r sdcard_rw shell wakelock
capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW

View file

@ -26,7 +26,7 @@
#
# the DIAG device node is not world writable/readable.
/dev/diag 0660 system qcom_diag
/dev/diag 0660 system oem_2950
/dev/genlock 0666 system system
/dev/kgsl 0666 system system

View file

@ -1 +0,0 @@
allow bluetooth bluetooth_efs_file:file read;

View file

@ -1,37 +0,0 @@
# Qualcomm MSM camera
type camera, domain;
type camera_exec, exec_type, file_type;
# Started by init
init_daemon_domain(camera)
allow camera self:process execmem;
allow camera camera_device:dir search;
allow camera { video_device camera_device }:chr_file rw_file_perms;
allow camera { surfaceflinger mediaserver }:fd use;
# Create /data/cam_socket0 as camera_socket
type_transition camera system_data_file:sock_file camera_socket "cam_socket0";
type_transition camera system_data_file:sock_file camera_socket "cam_socket1";
allow camera camera_socket:sock_file { create unlink };
allow camera system_data_file:dir remove_name;
allow camera system_data_file:sock_file unlink;
# All others under /data get camera_data_file
file_type_auto_trans(camera, system_data_file, camera_data_file);
allow camera camera_data_file:dir { write add_name };
allow camera camera_data_file:file create_file_perms;
# Connect to /data/app/sensor_ctl_socket
unix_socket_connect(camera, sensors, sensors)
allow camera sensors_socket:sock_file read;
allow camera devpts:chr_file { read write getattr };
allow camera device:chr_file { ioctl };
allow camera mpdecision:unix_stream_socket connectto;
allow camera servicemanager:binder call;
allow camera socket_device:sock_file write;
#allow camera system:binder call;
#allow camera system:unix_stream_socket { read write setopt };
allow camera system_data_file:file { open };

View file

@ -1,3 +0,0 @@
allow cameraserver system_data_file:sock_file write;
allow cameraserver camera_socket:sock_file write;
allow cameraserver mpctl_socket:dir search;

View file

@ -1,2 +0,0 @@
type io_device, dev_type;
type efs_block_device, dev_type;

View file

@ -1,6 +0,0 @@
type sensors_efs_file, file_type;
type sysfs_camera, fs_type, sysfs_type;
type sysfs_display, fs_type, sysfs_type;
type sysfs_vibeamp, fs_type, sysfs_type;
type wifi_efs_file, file_type;
type vcs_data_file, file_type, data_file_type;

View file

@ -1,39 +0,0 @@
# Bluetooth
/efs/bluetooth/bt_addr u:object_r:bluetooth_efs_file:s0
# Camera
/data/cam_socket.* u:object_r:camera_socket:s0
/sys/devices/virtual/camera(/.*)? u:object_r:sysfs_camera:s0
# CMHW
/sys/devices/virtual/timed_output/vibrator(/.*)? u:object_r:sysfs_vibeamp:s0
/sys/class/sec/sec_touchkey/keypad_enable u:object_r:sysfs_display:s0
# Display
/sys/devices/fd922800.qcom,mdss_dsi/lcd/panel/power_reduce u:object_r:sysfs_display:s0
# EFS
/dev/block/platform/msm_sdcc.1/by-name/efs u:object_r:efs_block_device:s0
# Fingerprint
/system/bin/vcsFPService u:object_r:vcs_exec:s0
/data/validity(/.*)? u:object_r:vcs_data_file:s0
/dev/validity(/.*)? u:object_r:vcs_device:s0
/dev/vfsspi u:object_r:vcs_device:s0
# NFC
/dev/pn547 u:object_r:nfc_device:s0
# Sensors
/dev/alps_io u:object_r:io_device:s0
/dev/iio:device0 u:object_r:io_device:s0
/efs/FactoryApp/baro_delta u:object_r:sensors_efs_file:s0
/efs/gyro_cal_data u:object_r:sensors_efs_file:s0
/efs/prox_cal u:object_r:sensors_efs_file:s0
# Thermal engine
/system/bin/thermal-engine u:object_r:thermal-engine_exec:s0
# WiFi
/data/.wifiver.info u:object_r:wifi_data_file:s0
/efs/wifi/.mac.info u:object_r:wifi_efs_file:s0

View file

@ -1 +0,0 @@
allow fingerprintd system_app:unix_stream_socket { connectto read write setopt };

View file

@ -1 +0,0 @@
allow fsck efs_block_device:blk_file rw_file_perms;

View file

@ -1,2 +0,0 @@
allow healthd device:dir r_dir_perms;
allow healthd rtc_device:chr_file rw_file_perms;

View file

@ -1,2 +0,0 @@
allow hostapd efs_file:dir search;
allow hostapd wifi_data_file:sock_file write;

View file

@ -1,3 +0,0 @@
allow init tmpfs:lnk_file create_file_perms;
allow init debugfs:dir mounton;
allow init wcnss_device:chr_file write;

View file

@ -1,2 +0,0 @@
allow kernel block_device:blk_file rw_file_perms;

View file

@ -1,7 +0,0 @@
allow mediaserver system_prop:property_service set;
#allow mediaserver shell_data_file:dir search;
allow mediaserver socket_device:sock_file write;
allow mediaserver sysfs_camera:dir search;
allow mediaserver sysfs_camera:file { getattr open read };
#allow mediaserver system_file:file execmod;

View file

@ -1,20 +0,0 @@
allow mm-qcamerad media_rw_data_file:dir search;
allow mm-qcamerad sysfs_camera:dir search;
allow mm-qcamerad sysfs_camera:file rw_file_perms;
allow mm-qcamerad system_data_file:dir w_dir_perms;
allow mm-qcamerad system_data_file:file open;
#allow mm-qcamerad system_file:file execmod;
allow mm-qcamerad system_data_file:sock_file unlink;
allow mm-qcamerad sensors_socket:sock_file read;
allow mm-qcamerad system_data_file:sock_file rw_file_perms;
allow mm-qcamerad system_data_file:sock_file rw_file_perms;
allow mm-qcamerad system_data_file:dir { add_name remove_name write };
allow mm-qcamerad system_data_file:sock_file { create unlink };
allow mm-qcamerad system_server:unix_stream_socket rw_socket_perms;
allow mm-qcamerad system_data_file:sock_file { create unlink };
binder_call(mm-qcamerad, servicemanager)
binder_call(mm-qcamerad, system_server)
unix_socket_connect(mm-qcamerad, mpctl, mpdecision)

View file

@ -1 +0,0 @@
allow mpdecision socket_device:dir write;

View file

@ -1 +0,0 @@
allow platform_app time_daemon:unix_stream_socket connectto;

View file

@ -1 +0,0 @@
type qseecomd_prop, property_type;

View file

@ -1,2 +0,0 @@
persist.sys.camera.preview u:object_r:camera_prop:s0
sys.qseecomd.enable u:object_r:qseecomd_prop:s0

View file

@ -1 +0,0 @@
allow tee qseecomd_prop:property_service set;

View file

@ -1,8 +0,0 @@
allow rild proc_net:file rw_file_perms;
allow rild self:capability { dac_override dac_read_search };
allow rild radio_data_file:dir r_dir_perms;
allow rild radio_data_file:file r_file_perms;
allow rild radio_data_file:lnk_file r_file_perms;
#allow rild system_app_data_file:dir rw_dir_perms;
#allow rild system_app_data_file:file create_file_perms;

View file

@ -1,7 +0,0 @@
# For com.validity.fingerprint
allow system_app vcs:process signull;
allow system_app vcs_data_file:dir r_dir_perms;
allow system_app vcs_data_file:file r_file_perms;
allow system_app vcs_device:dir r_dir_perms;
allow system_app vcs_device:file r_file_perms;
allow system_app vcs_device:fifo_file create_file_perms;

View file

@ -1,7 +0,0 @@
allow system_server efs_file:dir search;
allow system_server io_device:chr_file rw_file_perms;
allow system_server sensors_efs_file:file r_file_perms;
allow system_server sysfs_display:file rw_file_perms;;
allow system_server sysfs_vibeamp:dir search;
allow system_server sysfs_vibeamp:file rw_file_perms;
allow system_server wifi_data_file:sock_file unlink;

View file

@ -1,2 +0,0 @@
allow tee vcs_data_file:dir create_dir_perms;
allow tee vcs_data_file:file create_file_perms;

View file

@ -1,7 +0,0 @@
allow thermal-engine init:unix_stream_socket connectto;
allow thermal-engine sysfs_battery_supply:dir search;
allow thermal-engine sysfs_battery_supply:file { open read write };
allow thermal-engine self:capability chown;
allow thermal-engine socket_device:sock_file create_file_perms;

View file

@ -1,3 +0,0 @@
allow ueventd sysfs_camera:file rw_file_perms;
allow ueventd sysfs_vibeamp:file rw_file_perms;
#allow ueventd vcs_device:chr_file create_file_perms;

View file

@ -1,2 +0,0 @@
allow untrusted_app fuse:lnk_file read;
allow untrusted_app sysfs:file { getattr open read };

View file

@ -1,22 +0,0 @@
type vcs, domain;
type vcs_exec, exec_type, file_type;
# vcs
init_daemon_domain(vcs)
binder_use(vcs)
allow vcs system_app:process signull;
allow vcs vcs_data_file:dir create_dir_perms;
allow vcs vcs_data_file:file create_file_perms;
allow vcs vcs_device:dir create_dir_perms;
allow vcs vcs_device:file create_file_perms;
allow vcs vcs_device:fifo_file create_file_perms;
#allow vcs vcs_device:chr_file create_file_perms;
#allow vcs tee_device:chr_file rw_file_perms;
allow vcs firmware_file:dir r_dir_perms;
allow vcs firmware_file:file r_file_perms;

View file

@ -1,4 +0,0 @@
allow vold efs_file:dir r_file_perms;
allow vold persist_file:dir r_file_perms;
allow vold firmware_file:dir search;
allow vold firmware_file:file r_file_perms;

View file

@ -1,2 +0,0 @@
allow wcnss_service efs_file:dir search;
allow wcnss_service wifi_efs_file:file { getattr open read };

View file

@ -1,3 +0,0 @@
#allow wpa efs_file:dir search;
#allow wpa wifi_efs_file:file r_file_perms;
#allow wpa wifi_data_file:sock_file rw_file_perms;

View file

@ -1,12 +1,27 @@
# Art
dalvik.vm.dex2oat-swap=false
# Radio Temp
ro.carrier=wifi-only
ro.radio.noril=1
# Audio
persist.media.treble_omx=false
media.aac_51_output_enabled=true
mm.enable.smoothstreaming=true
ro.qc.sdk.audio.fluencetype=none
af.fast_track_multiplier=1
audio_hal.period_size=192
audio.offload.video=true
persist.audio.fluence.speaker=true
persist.audio.fluence.voicecall=true
persist.audio.fluence.voicerec=false
ro.qc.sdk.audio.fluencetype=fluence
use.voice.path.for.pcm.voip=false
use.dedicated.device.for.voip=true
audio.deep_buffer.media=true
audio.offload.pcm.16bit.enable=true
audio.offload.pcm.24bit.enable=true
audio.offload.multiple.enabled=false
audio.offload.buffer.size.kb=32
# Bluetooth
qcom.bluetooth.soc=smd
@ -25,6 +40,13 @@ ro.qualcomm.bt.hci_transport=smd
# Camera
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
# Dalvik
dalvik.vm.heapstartsize=8m
@ -59,7 +81,6 @@ persist.data.qmi.adb_logmask=0
persist.radio.add_power_save=1
rild.libargs=-d /dev/smd0
rild.libpath=/system/lib/libsec-ril.so
ro.telephony.ril_class=SamsungMSM8226RIL
ro.telephony.ril.config=simactivation
ro.use_data_netmgrd=false