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

Pulling this to Z #2

Open
wants to merge 27 commits into
base: kk4.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9a3d995
init: Fix queue_all_property_triggers with nonexistent properties
benoitgoby Sep 24, 2013
ff2f9bb
Merge commit 'refs/changes/89/189/1' of https://gerrit.slimroms.net/S…
kufikugel Dec 10, 2013
a5c7077
audio: Add APIs for supported compress formats
Nov 5, 2013
7ad26db
Slim >>> OSE
lownslow200sx Jan 10, 2014
6663f3c
healtd: Send messages to Android log, not the kernel log
tixy Dec 10, 2013
5fcb95a
Merge remote-tracking branch 'slim/kk4.4-caf' into ose-caf
lownslow200sx Jan 12, 2014
4cadb7b
init: Add vendor-specific initialization hooks
Sep 24, 2013
e2e2995
init: Add vendor-specific initialization hooks
Sep 24, 2013
800ac8a
Add keystore to system group
hyperb1iss Mar 1, 2014
093d62f
Merge remote-tracking branch 'slim/kk4.4-caf' into ose
timpohladthomas Mar 10, 2014
6bccda0
Merge remote-tracking branch 'slim/kk4.4' into ose
timpohladthomas Mar 18, 2014
70a7f58
audio: Add Dolby subformat
Oct 15, 2013
e68b48c
system/audio: Add the the SPDIF device entry
Dec 15, 2013
8bb8fc9
audio: New audio formats for PCM Offload
Jan 10, 2014
1ffb8b8
Underp an ifdef
hyperb1iss Mar 7, 2014
7229919
Merge remote-tracking branch 'slim/kk4.4-caf' into ose
timpohladthomas Mar 21, 2014
29d8064
ueventd: fix a busy loop while reading uevents
amir73il Nov 10, 2013
0174494
Merge remote-tracking branch 'slim/kk4.4-caf' into ose
timpohladthomas May 3, 2014
d758a47
fix up adb to prefer /sbin/sh if it exists
koush Feb 23, 2010
7cc632b
Merge remote-tracking branch 'slim/kk4.4-caf' into ose
timpohladthomas May 28, 2014
52c4065
Merge tag 'android-4.4.3_r1.1' into HEAD
kufikugel Jun 8, 2014
a4aceb2
Merge remote-tracking branch 'slim/kk4.4-caf' into ose
timpohladthomas Jun 15, 2014
7e7be2b
fs_mgr: Add f2fs filesystem check
kumajaya Mar 20, 2014
249b72e
audio: Add support for FLAC in compress offload path
Mar 7, 2014
2907750
Merge remote-tracking branch 'slim/kk4.4-caf' into ose
timpohladthomas Jul 13, 2014
9ef9314
System/core: Start qrng daemon upon power up
Nov 7, 2012
41a1a39
audio: Unhide MP2/WMA enums
Oct 12, 2014
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
3 changes: 1 addition & 2 deletions adb/adb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,12 +1313,11 @@ int adb_main(int is_daemon, int server_port)
** AID_NET_BT and AID_NET_BT_ADMIN to diagnose bluetooth (hcidump)
** AID_SDCARD_R to allow reading from the SD card
** AID_SDCARD_RW to allow writing to the SD card
** AID_MOUNT to allow unmounting the SD card before rebooting
** AID_NET_BW_STATS to read out qtaguid statistics
*/
gid_t groups[] = { AID_ADB, AID_LOG, AID_INPUT, AID_INET, AID_GRAPHICS,
AID_NET_BT, AID_NET_BT_ADMIN, AID_SDCARD_R, AID_SDCARD_RW,
AID_MOUNT, AID_NET_BW_STATS };
AID_NET_BW_STATS };
if (setgroups(sizeof(groups)/sizeof(groups[0]), groups) != 0) {
exit(1);
}
Expand Down
4 changes: 2 additions & 2 deletions adb/adb_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ int adb_connect(const char *service)
} else {
// if server was running, check its version to make sure it is not out of date
char buf[100];
int n;
size_t n;
int version = ADB_SERVER_VERSION - 1;

// if we have a file descriptor, then parse version result
Expand All @@ -250,7 +250,7 @@ int adb_connect(const char *service)

buf[4] = 0;
n = strtoul(buf, 0, 16);
if(n > (int)sizeof(buf)) goto error;
if(n > sizeof(buf)) goto error;
if(readx(fd, buf, n)) goto error;
adb_close(fd);

Expand Down
30 changes: 14 additions & 16 deletions adb/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,10 @@ void reboot_service(int fd, void *arg)
{
char buf[100];
char property_val[PROPERTY_VALUE_MAX];
int pid, ret;
int ret;

sync();

/* Attempt to unmount the SD card first.
* No need to bother checking for errors.
*/
pid = fork();
if (pid == 0) {
/* ask vdc to unmount it */
execl("/system/bin/vdc", "/system/bin/vdc", "volume", "unmount",
getenv("EXTERNAL_STORAGE"), "force", NULL);
} else if (pid > 0) {
/* wait until vdc succeeds or fails */
waitpid(pid, &ret, 0);
}

ret = snprintf(property_val, sizeof(property_val), "reboot,%s", (char *) arg);
if (ret >= (int) sizeof(property_val)) {
snprintf(buf, sizeof(buf), "reboot string too long. length=%d\n", ret);
Expand Down Expand Up @@ -262,8 +249,10 @@ static int create_subprocess(const char *cmd, const char *arg0, const char *arg1

#if ADB_HOST
#define SHELL_COMMAND "/bin/sh"
#define ALTERNATE_SHELL_COMMAND ""
#else
#define SHELL_COMMAND "/system/bin/sh"
#define ALTERNATE_SHELL_COMMAND "/sbin/sh"
#endif

#if !ADB_HOST
Expand Down Expand Up @@ -304,10 +293,19 @@ static int create_subproc_thread(const char *name)
adb_thread_t t;
int ret_fd;
pid_t pid;
const char* shell_command;
struct stat filecheck;
if (stat(ALTERNATE_SHELL_COMMAND, &filecheck) == 0) {
shell_command = ALTERNATE_SHELL_COMMAND;
}
else {
shell_command = SHELL_COMMAND;
}

if(name) {
ret_fd = create_subprocess(SHELL_COMMAND, "-c", name, &pid);
ret_fd = create_subprocess(shell_command, "-c", name, &pid);
} else {
ret_fd = create_subprocess(SHELL_COMMAND, "-", 0, &pid);
ret_fd = create_subprocess(shell_command, "-", 0, &pid);
}
D("create_subprocess() ret_fd=%d pid=%d\n", ret_fd, pid);

Expand Down
20 changes: 20 additions & 0 deletions fs_mgr/fs_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#define KEY_IN_FOOTER "footer"

#define E2FSCK_BIN "/system/bin/e2fsck"
#define F2FS_FSCK_BIN "/system/bin/fsck.f2fs"
#define MKSWAP_BIN "/system/bin/mkswap"

#define FSCK_LOG_FILE "/dev/fscklogs/log"
Expand Down Expand Up @@ -466,6 +467,10 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
"-y",
blk_device
};
char *f2fs_fsck_argv[] = {
F2FS_FSCK_BIN,
blk_device
};

/* Check for the types of filesystems we know how to check */
if (!strcmp(fs_type, "ext2") || !strcmp(fs_type, "ext3") || !strcmp(fs_type, "ext4")) {
Expand Down Expand Up @@ -497,6 +502,21 @@ static void check_fs(char *blk_device, char *fs_type, char *target)
/* No need to check for error in fork, we can't really handle it now */
ERROR("Failed trying to run %s\n", E2FSCK_BIN);
}
} else if (!strcmp(fs_type, "f2fs")) {
ret = mount(blk_device, target, fs_type, tmpmnt_flags, "");
if (!ret) {
umount(target);
}

INFO("Running %s on %s\n", F2FS_FSCK_BIN, blk_device);

ret = android_fork_execvp_ext(ARRAY_SIZE(f2fs_fsck_argv), f2fs_fsck_argv,
&status, true, LOG_KLOG | LOG_FILE,
true, FSCK_LOG_FILE);

if (ret < 0) {
ERROR("Failed trying to run %s\n", F2FS_FSCK_BIN);
}
}

return;
Expand Down
75 changes: 71 additions & 4 deletions include/system/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ typedef enum {
AUDIO_FORMAT_PCM_SUB_8_BIT = 0x2, /* DO NOT CHANGE - PCM unsigned 8 bits */
AUDIO_FORMAT_PCM_SUB_32_BIT = 0x3, /* PCM signed .31 fixed point */
AUDIO_FORMAT_PCM_SUB_8_24_BIT = 0x4, /* PCM signed 7.24 fixed point */
#ifdef QCOM_HARDWARE
AUDIO_FORMAT_PCM_SUB_24_BIT = 0x5, /* PCM signed 24 fixed point */
#endif
} audio_format_pcm_sub_fmt_t;

/* MP3 sub format field definition : can use 11 LSBs in the same way as MP3
Expand All @@ -141,6 +144,15 @@ typedef enum {
AUDIO_FORMAT_VORBIS_SUB_NONE = 0x0,
} audio_format_vorbis_sub_fmt_t;

#ifdef QCOM_HARDWARE
/* DOLBY (AC3/EAC3) sub format field definition: specify dual-mono acmod... */

typedef enum {
AUDIO_FORMAT_DOLBY_SUB_NONE = 0x0,
AUDIO_FORMAT_DOLBY_SUB_DM = 0x1, /* Clips with the Dual Mono content*/
} audio_format_dolby_sub_fmt_t;
#endif

/* Audio format consists in a main format field (upper 8 bits) and a sub format
* field (lower 24 bits).
*
Expand All @@ -161,22 +173,24 @@ typedef enum {
AUDIO_FORMAT_HE_AAC_V1 = 0x05000000UL,
AUDIO_FORMAT_HE_AAC_V2 = 0x06000000UL,
AUDIO_FORMAT_VORBIS = 0x07000000UL,
AUDIO_FORMAT_WMA = 0x0d000000UL,
AUDIO_FORMAT_WMA_PRO = 0x0e000000UL,
AUDIO_FORMAT_MP2 = 0x15000000UL,
#ifdef QCOM_HARDWARE
AUDIO_FORMAT_EVRC = 0x08000000UL,
AUDIO_FORMAT_QCELP = 0x09000000UL,
AUDIO_FORMAT_AC3 = 0x0a000000UL,
AUDIO_FORMAT_AC3_PLUS = 0x0b000000UL,
AUDIO_FORMAT_DTS = 0x0c000000UL,
AUDIO_FORMAT_WMA = 0x0d000000UL,
AUDIO_FORMAT_WMA_PRO = 0x0e000000UL,
AUDIO_FORMAT_AAC_ADIF = 0x0f000000UL,
AUDIO_FORMAT_EVRCB = 0x10000000UL,
AUDIO_FORMAT_EVRCWB = 0x11000000UL,
AUDIO_FORMAT_EAC3 = 0x12000000UL,
AUDIO_FORMAT_DTS_LBR = 0x13000000UL,
AUDIO_FORMAT_AMR_WB_PLUS = 0x14000000UL,
AUDIO_FORMAT_MP2 = 0x15000000UL,
AUDIO_FORMAT_EVRCNW = 0x16000000UL,
AUDIO_FORMAT_PCM_OFFLOAD = 0x17000000UL,
AUDIO_FORMAT_FLAC = 0x18000000UL,
#endif
AUDIO_FORMAT_MAIN_MASK = 0xFF000000UL,
AUDIO_FORMAT_SUB_MASK = 0x00FFFFFFUL,
Expand All @@ -190,6 +204,20 @@ typedef enum {
AUDIO_FORMAT_PCM_SUB_32_BIT),
AUDIO_FORMAT_PCM_8_24_BIT = (AUDIO_FORMAT_PCM |
AUDIO_FORMAT_PCM_SUB_8_24_BIT),
#ifdef QCOM_HARDWARE
AUDIO_FORMAT_PCM_24_BIT = (AUDIO_FORMAT_PCM |
AUDIO_FORMAT_PCM_SUB_24_BIT),
AUDIO_FORMAT_AC3_DM = (AUDIO_FORMAT_AC3 |
AUDIO_FORMAT_DOLBY_SUB_DM),
AUDIO_FORMAT_EAC3_DM = (AUDIO_FORMAT_EAC3 |
AUDIO_FORMAT_DOLBY_SUB_DM),

/*Offload PCM formats*/
AUDIO_FORMAT_PCM_16_BIT_OFFLOAD = (AUDIO_FORMAT_PCM_OFFLOAD |
AUDIO_FORMAT_PCM_SUB_16_BIT),
AUDIO_FORMAT_PCM_24_BIT_OFFLOAD = (AUDIO_FORMAT_PCM_OFFLOAD |
AUDIO_FORMAT_PCM_SUB_8_24_BIT),
#endif
} audio_format_t;

enum {
Expand Down Expand Up @@ -388,6 +416,7 @@ enum {
#ifdef QCOM_HARDWARE
AUDIO_DEVICE_OUT_FM = 0x80000,
AUDIO_DEVICE_OUT_FM_TX = 0x100000,
AUDIO_DEVICE_OUT_SPDIF = 0x200000,
#endif
AUDIO_DEVICE_OUT_DEFAULT = AUDIO_DEVICE_BIT_DEFAULT,
AUDIO_DEVICE_OUT_ALL = (AUDIO_DEVICE_OUT_EARPIECE |
Expand All @@ -412,6 +441,7 @@ enum {
#ifdef QCOM_HARDWARE
AUDIO_DEVICE_OUT_FM |
AUDIO_DEVICE_OUT_FM_TX |
AUDIO_DEVICE_OUT_SPDIF |
#endif
AUDIO_DEVICE_OUT_DEFAULT),
AUDIO_DEVICE_OUT_ALL_A2DP = (AUDIO_DEVICE_OUT_BLUETOOTH_A2DP |
Expand Down Expand Up @@ -550,6 +580,7 @@ typedef struct {
int64_t duration_us; // duration in microseconds, -1 if unknown
bool has_video; // true if stream is tied to a video stream
bool is_streaming; // true if streaming, false if local playback
uint16_t bit_width; // bits per sample
} audio_offload_info_t;

#define AUDIO_MAKE_OFFLOAD_INFO_VERSION(maj,min) \
Expand Down Expand Up @@ -718,6 +749,7 @@ static inline bool audio_is_valid_format(audio_format_t format)
case AUDIO_FORMAT_HE_AAC_V1:
case AUDIO_FORMAT_HE_AAC_V2:
case AUDIO_FORMAT_VORBIS:
return true;
#ifdef QCOM_HARDWARE
case AUDIO_FORMAT_QCELP:
case AUDIO_FORMAT_EVRC:
Expand All @@ -733,8 +765,15 @@ static inline bool audio_is_valid_format(audio_format_t format)
case AUDIO_FORMAT_AMR_WB_PLUS:
case AUDIO_FORMAT_MP2:
case AUDIO_FORMAT_EVRCNW:
#endif
case AUDIO_FORMAT_FLAC:
return true;
case AUDIO_FORMAT_PCM_OFFLOAD:
if (format != AUDIO_FORMAT_PCM_16_BIT_OFFLOAD &&
format != AUDIO_FORMAT_PCM_24_BIT_OFFLOAD) {
return false;
}
return true;
#endif
default:
return false;
}
Expand All @@ -746,6 +785,11 @@ static inline bool audio_is_linear_pcm(audio_format_t format)
}

#ifdef QCOM_HARDWARE
static inline bool audio_is_offload_pcm(audio_format_t format)
{
return ((format & AUDIO_FORMAT_MAIN_MASK) == AUDIO_FORMAT_PCM_OFFLOAD);
}

static inline bool audio_is_supported_compressed(audio_format_t format)
{
if (format == AUDIO_FORMAT_AMR_NB ||
Expand All @@ -760,6 +804,28 @@ static inline bool audio_is_supported_compressed(audio_format_t format)
else
return false;
}

static inline bool audio_is_compress_capture_format(audio_format_t format)
{
if (format == AUDIO_FORMAT_AMR_WB)
return true;
else
return false;
}

static inline bool audio_is_compress_voip_format(audio_format_t format)
{

if (format == AUDIO_FORMAT_AMR_NB ||
format == AUDIO_FORMAT_AMR_WB ||
format == AUDIO_FORMAT_EVRC ||
format == AUDIO_FORMAT_EVRCB ||
format == AUDIO_FORMAT_EVRCWB ||
format == AUDIO_FORMAT_EVRCNW)
return true;
else
return false;
}
#endif

static inline size_t audio_bytes_per_sample(audio_format_t format)
Expand Down Expand Up @@ -795,6 +861,7 @@ static inline size_t audio_bytes_per_sample(audio_format_t format)
break;
#endif
default:
size = sizeof(uint8_t);
break;
}
return size;
Expand Down
7 changes: 6 additions & 1 deletion init/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ LOCAL_SRC_FILES:= \
init_parser.c \
ueventd.c \
ueventd_parser.c \
watchdogd.c
watchdogd.c \
vendor_init.c

ifeq ($(strip $(INIT_BOOTCHART)),true)
LOCAL_SRC_FILES += bootchart.c
Expand Down Expand Up @@ -69,6 +70,10 @@ LOCAL_STATIC_LIBRARIES := \
libmincrypt \
libext4_utils_static

ifneq ($(strip $(TARGET_INIT_VENDOR_LIB)),)
LOCAL_WHOLE_STATIC_LIBRARIES += $(TARGET_INIT_VENDOR_LIB)
endif

include $(BUILD_EXECUTABLE)

# Make a symlink from /sbin/ueventd and /sbin/watchdogd to /init
Expand Down
27 changes: 27 additions & 0 deletions init/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,30 @@

END OF TERMS AND CONDITIONS


Copyright (c) 2013, 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 "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.
9 changes: 7 additions & 2 deletions init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include "util.h"
#include "ueventd.h"
#include "watchdogd.h"
#include "vendor_init.h"

struct selabel_handle *sehandle;
struct selabel_handle *sehandle_prop;
Expand Down Expand Up @@ -911,6 +912,11 @@ static int property_service_init_action(int nargs, char **args)
* that /data/local.prop cannot interfere with them.
*/
start_property_service();

/* update with vendor-specific property runtime
* overrides
*/
vendor_load_properties();
return 0;
}

Expand Down Expand Up @@ -960,7 +966,6 @@ static int bootchart_init_action(int nargs, char **args)
#endif

static const struct selinux_opt seopts_prop[] = {
{ SELABEL_OPT_PATH, "/data/security/property_contexts" },
{ SELABEL_OPT_PATH, "/property_contexts" },
{ 0, NULL }
};
Expand Down Expand Up @@ -1300,7 +1305,7 @@ int main(int argc, char **argv)
continue;

for (i = 0; i < fd_count; i++) {
if (ufds[i].revents == POLLIN) {
if (ufds[i].revents & POLLIN) {
if (ufds[i].fd == get_property_set_fd())
handle_property_set_fd();
else if (ufds[i].fd == get_keychord_fd())
Expand Down
Loading