Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream #41

Merged
merged 4 commits into from
Mar 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/private/android_filesystem_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
#define AID_MOT_DLNA 9011 /* DLNA native */
#endif // MOTOROLA_UIDS

#define AID_MTKCCCI 9996
#define AID_NVRAM 9997

#define AID_MISC 9998 /* access to misc storage */
#define AID_NOBODY 9999

Expand Down Expand Up @@ -207,6 +210,8 @@ static const struct android_id_info android_ids[] = {
{ "mot_dlna", AID_MOT_DLNA, },
#endif
{ "sensors", AID_SENSORS, },
{ "ccci", AID_MTKCCCI, },
{ "nvram", AID_NVRAM, },
{ "misc", AID_MISC, },
{ "nobody", AID_NOBODY, },
{ "theme_man", AID_THEMEMAN },
Expand Down
6 changes: 6 additions & 0 deletions include/system/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ enum {
AUDIO_DEVICE_IN_USB_DEVICE = AUDIO_DEVICE_BIT_IN | 0x1000,
AUDIO_DEVICE_IN_ANC_HEADSET = AUDIO_DEVICE_BIT_IN | 0x2000,
AUDIO_DEVICE_IN_PROXY = AUDIO_DEVICE_BIT_IN | 0x4000,
#ifdef MTK_HARDWARE
AUDIO_DEVICE_IN_FM = AUDIO_DEVICE_BIT_IN | 0x8000,
#endif
#ifdef QCOM_HARDWARE
AUDIO_DEVICE_IN_FM_RX = AUDIO_DEVICE_BIT_IN | 0x8000,
AUDIO_DEVICE_IN_FM_RX_A2DP = AUDIO_DEVICE_BIT_IN | 0x10000,
Expand All @@ -516,6 +519,9 @@ enum {
AUDIO_DEVICE_IN_USB_DEVICE |
AUDIO_DEVICE_IN_PROXY |
AUDIO_DEVICE_IN_ANC_HEADSET |
#ifdef MTK_HARDWARE
AUDIO_DEVICE_IN_FM |
#endif
#ifdef QCOM_HARDWARE
AUDIO_DEVICE_IN_FM_RX |
AUDIO_DEVICE_IN_FM_RX_A2DP |
Expand Down
11 changes: 11 additions & 0 deletions include/system/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ enum {
* GL_OES_EGL_image_external OpenGL ES extension.
*/

#ifdef MTK_HARDWARE
HAL_PIXEL_FORMAT_I420 = 0x00000100, // MTK I420
HAL_PIXEL_FORMAT_NV12_BLK = 0x00000101, // MTK NV12 block progres
HAL_PIXEL_FORMAT_NV12_BLK_FCM = 0x00000102, // MTK NV12 block field m

HAL_PIXEL_FORMAT_YUV_PRIVATE = 0x00000103, // I420 or NV12_BLK or NV

HAL_PIXEL_FORMAT_I420_DI = 0x00000106, // MTK I420 for deinterla
HAL_PIXEL_FORMAT_YV12_DI = 0x00000107, // MTK YV12 for deinterla
#endif

/*
* Android YUV format:
*
Expand Down
20 changes: 14 additions & 6 deletions init/init_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct import {
const char *filename;
};

static void *parse_service(struct parse_state *state, int nargs, char **args);
static void *parse_service(struct parse_state *state, int nargs, char **args, bool redefine);
static void parse_line_service(struct parse_state *state, int nargs, char **args);

static void *parse_action(struct parse_state *state, int nargs, char **args);
Expand Down Expand Up @@ -145,6 +145,7 @@ int lookup_keyword(const char *s)
case 's':
if (!strcmp(s, "eclabel")) return K_seclabel;
if (!strcmp(s, "ervice")) return K_service;
if (!strcmp(s, "ervice_redefine")) return K_service_redefine;
if (!strcmp(s, "etcon")) return K_setcon;
if (!strcmp(s, "etenforce")) return K_setenforce;
if (!strcmp(s, "etenv")) return K_setenv;
Expand Down Expand Up @@ -328,7 +329,8 @@ void parse_new_section(struct parse_state *state, int kw,
nargs > 1 ? args[1] : "");
switch(kw) {
case K_service:
state->context = parse_service(state, nargs, args);
case K_service_redefine:
state->context = parse_service(state, nargs, args, (kw == K_service_redefine));
if (state->context) {
state->parse_line = parse_line_service;
return;
Expand Down Expand Up @@ -673,7 +675,7 @@ int action_queue_empty()
return list_empty(&action_queue);
}

static void *parse_service(struct parse_state *state, int nargs, char **args)
static void *parse_service(struct parse_state *state, int nargs, char **args, bool redefine)
{
struct service *svc;
if (nargs < 3) {
Expand All @@ -686,13 +688,18 @@ static void *parse_service(struct parse_state *state, int nargs, char **args)
}

svc = service_find_by_name(args[1]);
if (svc) {
if (svc && !redefine) {
parse_error(state, "ignored duplicate definition of service '%s'\n", args[1]);
return 0;
}

nargs -= 2;
svc = calloc(1, sizeof(*svc) + sizeof(char*) * nargs);

if (!svc) {
svc = calloc(1, sizeof(*svc) + sizeof(char*) * nargs);
redefine = false;
}

if (!svc) {
parse_error(state, "out of memory\n");
return 0;
Expand All @@ -704,7 +711,8 @@ static void *parse_service(struct parse_state *state, int nargs, char **args)
svc->nargs = nargs;
svc->onrestart.name = "onrestart";
list_init(&svc->onrestart.commands);
list_add_tail(&service_list, &svc->slist);
if (!redefine)
list_add_tail(&service_list, &svc->slist);
return svc;
}

Expand Down
1 change: 1 addition & 0 deletions init/keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ enum {
KEYWORD(rmdir, COMMAND, 1, do_rmdir)
KEYWORD(seclabel, OPTION, 0, 0)
KEYWORD(service, SECTION, 0, 0)
KEYWORD(service_redefine, SECTION, 0, 0)
KEYWORD(setcon, COMMAND, 1, do_setcon)
KEYWORD(setenforce, COMMAND, 1, do_setenforce)
KEYWORD(setenv, OPTION, 2, 0)
Expand Down
4 changes: 4 additions & 0 deletions init/property_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ struct {
{ "wc_transport.", AID_BLUETOOTH, AID_SYSTEM },
{ "net.pdp", AID_RADIO, AID_RADIO },
{ "service.bootanim.exit", AID_GRAPHICS, 0 },
#ifdef MTK_HARDWARE
{ "nvram_init", AID_NVRAM, 0 },
{ "gps.", AID_GPS, AID_SYSTEM },
#endif
#ifdef PROPERTY_PERMS_APPEND
PROPERTY_PERMS_APPEND
#endif
Expand Down
4 changes: 4 additions & 0 deletions libcutils/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ endif
LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS)
LOCAL_STATIC_LIBRARIES := liblog
LOCAL_CFLAGS += $(targetSmpFlag)

ifeq ($(BOARD_HAS_MTK_HARDWARE), true)
LOCAL_WHOLE_STATIC_LIBRARIES += libpmem-dev
endif
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
Expand Down
7 changes: 7 additions & 0 deletions liblog/logd_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ int __android_log_write(int prio, const char *tag, const char *msg)
!strcmp(tag, "KINETO") ||
!strncmp(tag, "KIPC", 4) ||
!strncmp(tag, "Kineto", 6) ||
!strncmp(tag, "MUXD", 4) ||
!strncmp(tag, "QCRIL", 5) ||
!strncmp(tag, "QC-RIL", 6) ||
!strncmp(tag, "QC-QMI", 6) ||
Expand Down Expand Up @@ -426,3 +427,9 @@ int __android_log_btwrite(int32_t tag, char type, const void *payload,

return write_to_log(LOG_ID_EVENTS, vec, 3);
}

#ifdef MTK_HARDWARE
void __attribute__((weak)) __xlog_buf_printf(void *args) {
return;
}
#endif
2 changes: 1 addition & 1 deletion rootdir/init.rc
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ service drm /system/bin/drmserver
service media /system/bin/mediaserver
class main
user media
group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc qcom_diag mediadrm
group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc qcom_diag mediadrm nvram ccci radio
ioprio rt 4

service bootanim /system/bin/bootanimation
Expand Down