OSDN Git Service

android-x86/system-core.git
7 years agoMerge tag 'android-6.0.1_r74' into marshmallow-x86 android-x86-6.0-r2
Chih-Wei Huang [Tue, 10 Jan 2017 04:24:43 +0000 (12:24 +0800)]
Merge tag 'android-6.0.1_r74' into marshmallow-x86

Android 6.0.1 release 74

7 years agoueventd: defer modules loading if explicitly listed
Chih-Wei Huang [Tue, 27 Sep 2016 11:14:12 +0000 (19:14 +0800)]
ueventd: defer modules loading if explicitly listed

The patch extends the syntax of /etc/modules.blacklist.
The modules marked as deferred in this file will be loaded
after all other modules are loaded at coldboot stage.

7 years agoliblog: add __android_log_close()
Mark Salyzyn [Tue, 23 Aug 2016 17:23:36 +0000 (10:23 -0700)]
liblog: add __android_log_close()

Bug: 30963384

(cherry picked from commit df7a4c6bae5f85532d79a93b7d9197a2aab17825)

Change-Id: Ide70df3c04e29301649a1ca234b1b0af687bcbfb
(cherry picked from commit b1b5d507cba4b37221016d308dbf9fdd39019108)

7 years agoliblog: add __android_log_close()
Mark Salyzyn [Tue, 23 Aug 2016 17:23:36 +0000 (10:23 -0700)]
liblog: add __android_log_close()

Bug: 30963384

(cherry picked from commit df7a4c6bae5f85532d79a93b7d9197a2aab17825)

Change-Id: I2255486e84dd55af0f4e7fbbfb616c2deb1765d0
(cherry picked from commit 2d149691552676968b7de337f543463b920578b0)

7 years agoinit: set default value of ro.hardware to the target name
Chih-Wei Huang [Fri, 23 Sep 2016 09:59:47 +0000 (17:59 +0800)]
init: set default value of ro.hardware to the target name

People usually forget to set the value of androidboot.hardware to
the target name in kernel cmdline which results in boot failure.

The change tries to reduce such an error in the future. The target
name is hardcoded to the image. This eliminates the necessity of
androidboot.hardware.

7 years agoMerge tag 'android-6.0.1_r66' into marshmallow-x86 android-x86-6.0-r1
Chih-Wei Huang [Wed, 7 Sep 2016 06:06:47 +0000 (14:06 +0800)]
Merge tag 'android-6.0.1_r66' into marshmallow-x86

Android 6.0.1 release 66

7 years agoRevert "adb: sockets: fix race condition between input_thread and fdevent callback"
Chih-Wei Huang [Wed, 7 Sep 2016 06:06:40 +0000 (14:06 +0800)]
Revert "adb: sockets: fix race condition between input_thread and fdevent callback"

This reverts commit 3e872c4ce7d83fee2673694644559f6fa9bdcbe0.

7 years agoFix vold vulnerability in FrameworkListener
Connor O'Brien [Fri, 12 Aug 2016 18:52:46 +0000 (11:52 -0700)]
Fix vold vulnerability in FrameworkListener

Modify FrameworkListener to ignore commands that exceed the maximum
buffer length and send an error message.

Bug: 29831647
Change-Id: I9e57d1648d55af2ca0191bb47868e375ecc26950
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit baa126dc158a40bc83c17c6d428c760e5b93fb1a)
(cherry picked from commit 470484d2a25ad432190a01d1c763b4b36db33c7e)

7 years agoueventd: load all modules with the matched alias
Chih-Wei Huang [Sun, 14 Aug 2016 04:42:40 +0000 (12:42 +0800)]
ueventd: load all modules with the matched alias

Originally we only load the first module with the matched alias.
It causes some necessary modules are not loaded.

7 years agoinit: enlarge the time to wait coldboot done
Chih-Wei Huang [Sun, 14 Aug 2016 03:23:20 +0000 (11:23 +0800)]
init: enlarge the time to wait coldboot done

We need more time to probe and load all modules.
If 10s is still not enough for you, let me know.

7 years agodebuggerd: fix missed use of ptrace(PTRACE_ATTACH).
Josh Gao [Tue, 9 Aug 2016 22:29:58 +0000 (15:29 -0700)]
debuggerd: fix missed use of ptrace(PTRACE_ATTACH).

Bug: http://b/29555636
Change-Id: Ibd8a2e2b619b74aac667555b7085d6f28e367c07

7 years agoMerge tag 'android-6.0.1_r61' into marshmallow-x86
Chih-Wei Huang [Wed, 3 Aug 2016 07:19:26 +0000 (15:19 +0800)]
Merge tag 'android-6.0.1_r61' into marshmallow-x86

Android 6.0.1 Release 61 (MOB30Z)

7 years agoueventd: refactory module and firmware loading mechanism
Chih-Wei Huang [Fri, 29 Jul 2016 12:54:42 +0000 (20:54 +0800)]
ueventd: refactory module and firmware loading mechanism

Currently each module and firmware loading event is forked to
a child process to handle. It may cause some race conditions.

Now we fork ueventd into two processes. The parent process handles
normal uevents including modules loading, while the child process
only handles firmware loading events. All events are handled
sequentially.

7 years agoinit.rc: symlink /lib to /system/lib
Chih-Wei Huang [Fri, 29 Jul 2016 11:49:58 +0000 (19:49 +0800)]
init.rc: symlink /lib to /system/lib

Currently more linux drivers use request_firmware_nowait() to load
firmwares. It requires the firmwares exist in the standard path.

Create the symlink before ueventd started to ensure firmwares
could be loaded correctly.

7 years agoinit: Fix load_firmware error
Biao Lu [Thu, 28 Jan 2016 08:10:54 +0000 (16:10 +0800)]
init: Fix load_firmware error

In function 'load_firmware', parameter 'buf' passed to 'write'
is wrong. To fix it, use android::base::WriteFully to replace.

Change-Id: I13f79bdc9be9e5eb669f6bd975535b1dce965ef0
Signed-off-by: Biao Lu <biao.lu@intel.com>
7 years agoDO NOT MERGE: debuggerd: verify that traced threads belong to the right process.
Josh Gao [Thu, 14 Jul 2016 23:43:12 +0000 (16:43 -0700)]
DO NOT MERGE: debuggerd: verify that traced threads belong to the right process.

Fix two races in debuggerd's PTRACE_ATTACH logic:
  1. The target thread in a crash dump request could exit between the
     /proc/<pid>/task/<tid> check and the PTRACE_ATTACH.
  2. Sibling threads could exit between listing /proc/<pid>/task and the
     PTRACE_ATTACH.

Backport of NYC change I4dfe1ea30e2c211d2389321bd66e3684dd757591
Bug: http://b/29555636
Change-Id: I6c6efcf82a49bca140d761b2d1de04215ba4d252

7 years agoadb: use asocket's close function when closing.
Josh Gao [Wed, 18 May 2016 17:39:48 +0000 (10:39 -0700)]
adb: use asocket's close function when closing.

close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Bug: http://b/28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
(cherry picked from commit 53eb31d87cb84a4212f4850bf745646e1fb12814)
(cherry picked from commit 014b01706cc64dc9c2ad94a96f62e07c058d0b5d)

7 years agoadb: switch the socket list mutex to a recursive_mutex.
Josh Gao [Wed, 18 May 2016 02:23:39 +0000 (19:23 -0700)]
adb: switch the socket list mutex to a recursive_mutex.

sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.

Bug: http://b/28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
(functionally a cherrypick of 903b749f + 9b587dec, with windows disabled)

7 years agolibutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Sergio Giro [Tue, 28 Jun 2016 17:02:29 +0000 (18:02 +0100)]
libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8

Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

Test: ran libutils_tests
Bug: 29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
(cherry picked from commit c4966a363e46d2e1074d1a365e232af0dcedd6a1)

7 years agoMerge branch 'android-ia' into marshmallow-x86
Chih-Wei Huang [Wed, 20 Jul 2016 09:02:24 +0000 (17:02 +0800)]
Merge branch 'android-ia' into marshmallow-x86

7 years agoFix adb protocol issue when missed a packet
Jean-Christophe PINCE [Tue, 2 Feb 2016 15:12:38 +0000 (16:12 +0100)]
Fix adb protocol issue when missed a packet

When there is an issue, adb re-initializes the connection and if it
misses the first 24 bytes "CNXN" packet, it will read the 8 bytes "host::"
packet instead followed by the first 17 bytes of the "CNXN packet" leading
to a new connection error; it reinitializes then the connection but
reads again the "host::" packet sent by the host etc and infinitely.

The device is then show offline or not shown at all on the host.

Change-Id: I4720c9494c7bede79becd5e916de50ace2115021
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-19456
Signed-off-by: Jean-Christophe PINCE <jean-christophe.pince@intel.com>
Signed-off-by: Clement Calmels <clement.calmels@intel.com>
Reviewed-on: https://android.intel.com:443/468687

7 years agoCreate mixins configuration for app compatibility
jgu21 [Mon, 14 Mar 2016 06:58:53 +0000 (02:58 -0400)]
Create mixins configuration for app compatibility
enhancement feature

This feature is created for some cerner cases of
app compatibility issue. It's disabled by default.
To enable it, please add below lines to mixins.spec.
Currently, it aims to handle below issues:

1. All native libraries are put under assets directory.
Some apps put their libraries under the assets directory
in their APKs, instead of lib directory. It's not a
problem if the ABI of app libs is matched with platform
default ABI. But for apps with other ABIs, this feature
must be enabled to call native bridge for help.

Change-Id: I98ec4d47bee4596bfe0e9efd4cd0b6fe0c90fdf7
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-24196
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/481103

7 years agofs_mgr: fix encryptable=footer support
Chuanxiao Dong [Tue, 8 Mar 2016 09:24:02 +0000 (17:24 +0800)]
fs_mgr: fix encryptable=footer support

If the userdata partition has the encryptable=footer fstab option,
fs_mgr must leave room for the crypt footer.

Upstream: https://android-review.googlesource.com/206992
Change-Id: Id07818c5d93aafc27577f72fb0a780f26db51b16
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-23540
Reviewed-on: https://android.intel.com:443/479471

7 years agohealthd: only kick animation once for charger unplug case
Wu, Hao [Fri, 4 Mar 2016 09:28:01 +0000 (17:28 +0800)]
healthd: only kick animation once for charger unplug case

After animation done for charger unplug case, healthd may still
receive some uevent before the shutdown action. This change will
make sure battery animation will not be kicked for multiple times

Change-Id: I1e419b10b195d6919b5d5a83c87c334306896c2c
Signed-off-by: yangx.d.liu <yangx.d.liu@intel.com>
Signed-off-by: Wu, Hao <hao.wu@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-21840
Reviewed-on: https://android.intel.com:443/477709

7 years agoadb: fix klocwork isssue 'use of free memory possible'
Du, Changbin [Fri, 29 Jan 2016 08:07:07 +0000 (16:07 +0800)]
adb: fix klocwork isssue 'use of free memory possible'

Change-Id: I334076094c8bf9ab6c90bd170e141e190058ed72
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-18056
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/463913

7 years agoadb: sockets: fix race condition between input_thread and fdevent callback
Du, Changbin [Sat, 23 Jan 2016 09:54:30 +0000 (17:54 +0800)]
adb: sockets: fix race condition between input_thread and fdevent callback

The transport's input_thread clean up all of its sockets by
close_all_sockets function before it exit. All sockets's callback is
invoked by local_socket_event_func by fdevent thread(the main thread).

But there is no synchronization between these two thread. Missing
synchronization can cause crash or unexpected behaviour. So far has
observed two crash issue:
1. after close_all_sockets return, still has sockets pending. Then when
   the pending sockets try to access the removed transport cause segment
   fault.
2. calling the socket's close callback(local_socket_close) but a socket
   has been destroied. This will access a freed memory.

Change-Id: I9787b9ca7949946e977e102812518799051b9c67
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/461670

7 years agoadb: fix a spurious fatal condition
Du, Changbin [Wed, 20 Jan 2016 11:27:24 +0000 (19:27 +0800)]
adb: fix a spurious fatal condition

The fde may be removed just after rutern from select in fdevent_process
fucntion. This is not a fatal error but normal. So just igore the event
for this fde.

Change-Id: I08fca0c6e539755fbc15c82d46c6b3f3855a2f41
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/460314

7 years agoadb: fdevent: add synchronization logic to avoid crash
Du, Changbin [Wed, 20 Jan 2016 10:44:21 +0000 (18:44 +0800)]
adb: fdevent: add synchronization logic to avoid crash

The fdevent part didn't implemente any synchronization protection. This
could introduce race condition issues. Espacially when adb is used for
Android stress test, this will be a problem that can cause server side
crash.

Change-Id: I93c311ed62770afc3061ccb8b60a0abd09f7453d
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/460313

7 years agoadb: fix 'adb wait-for-device' thread leak issue
Du, Changbin [Wed, 20 Jan 2016 06:14:35 +0000 (14:14 +0800)]
adb: fix 'adb wait-for-device' thread leak issue

After the "adb wait-for-device" command is killed, the thread created in
adb server doesn't exit and keep it there to monitor device. If keep
doing this(like a automation test tool), hundreds of threads will be
crated and make adb server crash with running out of resource.

Steps to reproduce the problem.
- run "adb -s xxxxx wait-for-device"
- use "pstree -p <pid-of-adb-server>" to check count of threads
- kill it by ctrl+C.
- use pstree check threads info.

Change-Id: I96599c7b43df1f5c92edd7065d562a1bb6bacb19
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12574
Signed-off-by: Du, Changbin <changbin.du@intel.com>
Reviewed-on: https://android.intel.com:443/460212

7 years agoadb host: add device state in "adb wait-for-*"
Leo Sartre [Fri, 27 Nov 2015 17:56:48 +0000 (18:56 +0100)]
adb host: add device state in "adb wait-for-*"

The current implementation of the host commands "adb wait-for-*" allows
to specify only the transport layer (local, usb or any).
This patch allows the specification of the expected device state
(bootloader, recovery, device or sideload), this is usefull for
scripting purposes.

Use case:
$ adb reboot sideload-auto-reboot
$ adb wait-for-usb-sideload && adb sideload package.zip

This is a port of: https://android-review.googlesource.com/#/c/184290

Change-Id: I56a64b2d0f089cf1eb77424956296d660132b629
Signed-off-by: Leo Sartre <leox.sartre@intel.com>
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-15622
Reviewed-on: https://android.intel.com:443/450503

7 years agocore: Enable houdini to Support the apps which put all libs under assets dir.
jgu21 [Thu, 2 Apr 2015 08:24:55 +0000 (04:24 -0400)]
core: Enable houdini to Support the apps which put all libs under assets dir.

1. Many apps in PRC market put all arm native libs under assets/ dir in
   their APK, instead of lib/ dir.
   Since Lollipop, PakcageManager needs clear ABI info during app
   installation.
   If the ABI is not supported, houdini has not chance to involve in.
   For above kind of apps, houdini will not be loaded to help arm libs.
   To support such kind of apps, we have to enable houdini even without
   clear ABI info only for PRC market

2. Fix GTS case failure caused by above modification,
   which enforce to set arm ABI for all pure java

NOTE: Must merged together with https://android.intel.com/449222

Change-Id: I6d8cd263e3463f8e938b30f27e5db414eb2c96e9
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-12442
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Signed-off-by: Zhou,KaiX K <kaix.k.zhou@intel.com>
Reviewed-on: https://android.intel.com:443/449223

7 years agohealthd: Add USB_TYPEC to power-supply type list
Pavan Kumar S [Thu, 21 May 2015 08:55:56 +0000 (14:25 +0530)]
healthd: Add USB_TYPEC to power-supply type list

A new power-supply type is added in power-supply framework to
support USB_TYPEC. healthd needs to be updated to accomodate this type.

Change-Id: Ib69d82c3460433161e2955d50765caf18538bed1
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-6732
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Reviewed-on: https://android.intel.com:443/374693
(cherry picked from commit 601a4014f44e581832cad2e8f49051c9a6b33e75)
Reviewed-on: https://android.intel.com:443/429348

7 years agoPackage Manager : optimization for ZipFileRO->NextEntry
taozha2x [Thu, 22 Oct 2015 01:21:25 +0000 (09:21 +0800)]
Package Manager : optimization for ZipFileRO->NextEntry

In functions like findSurpportedAbi and CopyNativeLibraries, it using
ZipFileRO->NextEntry to get FileName of each file in package, and then find a
best ABI or do CRC checking for native libraries.

But in current implementation, NextEntry will read info from both CentralDirectoryRecord
and LocalFileHeader, to compare the filename, signature and so on to check the integrity.

But on platform that has bad "read" performance like Sofia 3GR, it cost too much
time reading infor from LocalFileHeader in each NextEntry, lead to so much time
scanning one package that contains dozens of binaries.

So add the NextEntryNoIntegrity API for such processing that just need a filename, like
use case mentioned above. But it might not trustable if package damaged or changed
unpredictable.

Together with patch in frameworks/base/

Change-Id: I915b60c4b3cfa9c17929b207149a03b73a197147
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-5845
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Johnson Z Wu <johnson.z.wu@intel.com>
Signed-off-by: taozha2x <taox.z.zhang@intel.com>
Reviewed-on: https://android.intel.com:443/427235

7 years agoproperty_service: log pid,uid and gid of setprop client
William Roberts [Thu, 1 Oct 2015 23:03:47 +0000 (16:03 -0700)]
property_service: log pid,uid and gid of setprop client

When auditing setprop denials, it is often unclear of who the process is
in a multi-process domain. To help identify the invoker, log the pid, uid,
and gid of the caller.

Before:
avc:  denied  { set } for property=wifi.xxx ...

After:
avc:  denied  { set } for property=wifi.xxx pid=30691 uid=123 gid=345 ...

Upstreamed: https://android-review.googlesource.com/174062
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-4996
Change-Id: I5cdcb3d18fbd52e0987b5e1497b9f6620c6c742a
Signed-off-by: William Roberts <william.c.roberts@intel.com>
Reviewed-on: https://android.intel.com:443/423303

7 years agoAllow native bridge to work without a code cache
jgu21 [Thu, 2 Jul 2015 04:02:11 +0000 (12:02 +0800)]
Allow native bridge to work without a code cache

In isolatedProcess, the app_code_cache_dir is not needed
for native bridge. This commit allows native bridge to work
without a code cache in isolatedProcess.

Tracked-On: https://jira01.devtools.intel.com/browse/OAM-1596
Change-Id: I8580268d5ec6ca8d44e4500c3fafe10408e1e0d3
Signed-off-by: jgu21 <jinghui.gu@intel.com>
Reviewed-on: https://android.intel.com:443/406649

7 years agoMerge tag 'android-6.0.1_r52' into marshmallow-x86
Chih-Wei Huang [Fri, 8 Jul 2016 11:18:24 +0000 (19:18 +0800)]
Merge tag 'android-6.0.1_r52' into marshmallow-x86

Android 6.0.1 Release 52 (MOB30R)

7 years agofix build break on x86_64
Ma Jian [Wed, 6 Jul 2016 10:31:55 +0000 (18:31 +0800)]
fix build break on x86_64

When TARGET_ARCH=x86_64, the LOCAL_SRC_FILES will be wrongly set to
codegen.cpp.arm,  but the android make will 'smartly' remove the suffix
".arm" and try to compile the codegen.cpp without the libenc dependency.

NO_REF_TASK
Tested: local build

Change-Id: I25df0692886fd8b7c56d467d3b6f674919b09b56

7 years agoallow user build to disable selinux
Ma Jian [Wed, 25 Nov 2015 06:46:05 +0000 (14:46 +0800)]
allow user build to disable selinux

Allow to disable selinux with kernel command line

Ref: T6517

Tested: local build and run with usbdisk in pc

Change-Id: Id2fb217c6206952850a1bdc6f857e66b8adac11d

7 years agoSupport use local time for RTC
Ma Jian [Sun, 12 Jun 2016 09:34:25 +0000 (17:34 +0800)]
Support use local time for RTC

When default timezone isn't UTC, there will no persist.sys.timezone
under /data/property/, so init won't get the default timezone for
setting time from rtc.

This change adds a fallback to read the property when the persist file
does not exists.

Notice, the default property of persist.sys.timezone should be set in
/default.prop instead of /system/build.prop

NO_REF_TASK
Tested: set default timezone with Asia/Shanghai, make sure bios time
is correct in local time, reboot to android, the local time should
be correct.

Change-Id: Ifbd20cb3710f833ab65852b4e5d51e38cc7c2d79

7 years agoadd a property for controlling perf_event_paranoid
Daniel Micay [Fri, 4 Sep 2015 20:23:01 +0000 (16:23 -0400)]
add a property for controlling perf_event_paranoid

This adds a system property for controlling unprivileged access to
perf_event_paranoid. It depends on adding kernel support for
perf_event_paranoid=3 based on grsecurity's PERF_HARDEN feature to
completely disable unprivileged access to perf. A minimal port of this
feature is used in the vanilla Debian kernel by default.

It hides the non-hardened value as an implementation detail, since while
it is currently 1, it will probably become 2 in the future.

(Cherry picked from commit 2b22a66382db8a2fdf5ed7a685085a6d7d67cf12)

Bug: 29054680

Change-Id: I6e3ae3cf18d8c76df94f879c34fb6fde519b89a9

8 years agoinit: support usbmisc devices
Roman Petrovski [Fri, 10 Jun 2016 19:50:00 +0000 (03:50 +0800)]
init: support usbmisc devices

The patch allows to create usbmisc device nodes like /dev/cdc-wdm0.

8 years agoMerge tag 'android-6.0.1_r46' into marshmallow-x86
Chih-Wei Huang [Tue, 7 Jun 2016 00:13:32 +0000 (08:13 +0800)]
Merge tag 'android-6.0.1_r46' into marshmallow-x86

Android 6.0.1 release 46

8 years agolibsuspend: add a property sleep.earlysuspend
Chih-Wei Huang [Sun, 5 Jun 2016 10:47:29 +0000 (18:47 +0800)]
libsuspend: add a property sleep.earlysuspend

Set the property to 0 to disable earlysuspend.
The default value is 1.

8 years agolibsuspend: make sleep state configurable and add a fallback
Jaap Jan Meijer [Thu, 2 Jun 2016 15:43:24 +0000 (17:43 +0200)]
libsuspend: make sleep state configurable and add a fallback

This patch allows the user to set the sleep state target from
Android properties for both wakeup_count and earlysuspend methods.
It also includes a fallback state if the default state is not
available and the user didn't set the sleep.state property.

Signed-off-by: Jaap Jan Meijer <jjmeijer88@gmail.com>
8 years agolibsuspend: enable earlysuspend for android-x86
Chih-Wei Huang [Tue, 6 Oct 2015 19:08:21 +0000 (03:08 +0800)]
libsuspend: enable earlysuspend for android-x86

8 years agoFix scanf %s in lsof.
Elliott Hughes [Tue, 19 Apr 2016 21:57:09 +0000 (14:57 -0700)]
Fix scanf %s in lsof.

Bug: http://b/28175237
Change-Id: Ief0ba299b09693ad9afc0e3d17a8f664c2fbb8c2

8 years agoMerge tag 'android-6.0.1_r43' into marshmallow-x86
Chih-Wei Huang [Thu, 5 May 2016 17:03:16 +0000 (01:03 +0800)]
Merge tag 'android-6.0.1_r43' into marshmallow-x86

Android 6.0.1 release 43 (MOB30J)

8 years agoFix overflow in path building
Daniel Rosenberg [Tue, 12 Apr 2016 23:30:28 +0000 (16:30 -0700)]
Fix overflow in path building

An incorrect size was causing an unsigned value
to wrap, causing it to write past the end of
the buffer.

Bug: 28085658
Change-Id: Ie9625c729cca024d514ba2880ff97209d435a165

8 years agoinit: expand variables on mount_all command
Chih-Wei Huang [Mon, 23 Nov 2015 09:57:37 +0000 (17:57 +0800)]
init: expand variables on mount_all command

This allows mount_all to handle fstab.${ro.hardware} instead
of hardcoding the file name.

8 years agoandroid_filesystem: enable houdini executables
Chih-Wei Huang [Mon, 28 Sep 2015 02:48:43 +0000 (10:48 +0800)]
android_filesystem: enable houdini executables

8 years agologd: update region lock after entry has passed to reader socket
Mark Salyzyn [Wed, 16 Sep 2015 22:34:00 +0000 (15:34 -0700)]
logd: update region lock after entry has passed to reader socket

- The reader region level indicates the location to protect, but once
  it has been passed to the calling reader, then allow us to go
  one beyond so that a clear or prune thread can remove the entry.

Bug: 23711431
Change-Id: I0f2389858dd8c83366c034360f67d7c363625b56

8 years agolibcutils: refine probe_module
Chih-Wei Huang [Thu, 10 Sep 2015 16:39:13 +0000 (00:39 +0800)]
libcutils: refine probe_module

Make the code be more elegant and fix the realloc bug.

8 years agologd: increase dgram_max_qlen to 600
Mark Salyzyn [Tue, 8 Sep 2015 18:24:07 +0000 (11:24 -0700)]
logd: increase dgram_max_qlen to 600

Seeing liblog messages on system_server runtime restart
(too much system_server spam, 566 messages in 72ms)

Bug: 23788621
Change-Id: I5171f2c19a3538da190fc6c2b40e978d89bf0e20

8 years agoliblog: logprint: printable nul
Mark Salyzyn [Tue, 8 Sep 2015 14:57:27 +0000 (07:57 -0700)]
liblog: logprint: printable nul

Change-Id: I57d1f86ce040ad196c558bb72ac0464af793c214

8 years agoinit: add modprobe to load kernel requested modules
Chih-Wei Huang [Wed, 2 Sep 2015 17:33:26 +0000 (01:33 +0800)]
init: add modprobe to load kernel requested modules

8 years agoSoftware-accelerated Pixel Flinger
Chih-Wei Huang [Mon, 10 Aug 2015 08:31:28 +0000 (16:31 +0800)]
Software-accelerated Pixel Flinger

The typical graphic workloads on VirtualBox are improved 3X.

Supports both x86 and x86_64.

Similar change by HazouPH <jgrharbers@gmail.com>:
http://review.cyanogenmod.org/#/c/70896/

And by Quanganh pham <quanganh2627@gmail.com>:
http://review.cyanogenmod.org/#/c/97125/

8 years agoinit.rc: fix for "add_tid_to_cgroup failed to write" warnings
Chih-Wei Huang [Fri, 3 Apr 2015 12:36:39 +0000 (20:36 +0800)]
init.rc: fix for "add_tid_to_cgroup failed to write" warnings

I still don't understand why only 0660 works.

8 years agoueventd: load modules in a forked process
Chih-Wei Huang [Thu, 14 Feb 2013 14:01:11 +0000 (22:01 +0800)]
ueventd: load modules in a forked process

Loading some modules (e.g., ath3k) will be blocked to wait for
firmware. The forking is necessary, otherwise ueventd has no
chance to load the firmware.

8 years agoallow to load modules from standard module path
Chih-Wei Huang [Wed, 6 Feb 2013 12:52:34 +0000 (20:52 +0800)]
allow to load modules from standard module path

8 years agoMerge branch 'android-ia' into marshmallow-x86
Chih-Wei Huang [Sun, 10 Apr 2016 12:35:11 +0000 (20:35 +0800)]
Merge branch 'android-ia' into marshmallow-x86

8 years agoAllow all to execute su
Chih-Wei Huang [Mon, 3 Nov 2014 15:06:02 +0000 (23:06 +0800)]
Allow all to execute su

The Superuser app can control how su is used.

8 years agoinit.rc: let some services run as root
Chih-Wei Huang [Wed, 29 Oct 2014 15:25:57 +0000 (23:25 +0800)]
init.rc: let some services run as root

The surfaceflinger needs root permission to control vt.

Run the console shell as root to make debugging easier.

8 years agolibutils: fix incorrect calculation in utf8_length() method
Chih-Wei Huang [Fri, 8 Aug 2014 10:17:04 +0000 (18:17 +0800)]
libutils: fix incorrect calculation in utf8_length() method

The first character of utf-8 could be larger than 128. If use signed char
variable to hold it, it would be treated as negative. That may result in
some unexpected errors.

For example, without this patch, suppose the code is 0xE88888, then
first_char is 0xE8 and converted to int32_t type (0xFFFFFFE8) and
masked with (~to_ignore_mask). The result utf32 is FFF08208
which is incorrect.

Change-Id: I72b355f380865bc375251eb287fc225fd585a115

8 years agoSet correct permission for pppd
Chih-Wei Huang [Sun, 29 Apr 2012 07:04:55 +0000 (15:04 +0800)]
Set correct permission for pppd

The pppd needs setuid root to setup ppp interface.

8 years agoinit: avoid virtual console be set blanked
Chih-Wei Huang [Sun, 1 Jan 2012 19:16:41 +0000 (03:16 +0800)]
init: avoid virtual console be set blanked

8 years agoinit: change firmware_dirs for Android-x86
Chih-Wei Huang [Tue, 1 Feb 2011 07:47:03 +0000 (15:47 +0800)]
init: change firmware_dirs for Android-x86

8 years agoueventd.rc: remove redundant definitions
Chih-Wei Huang [Sat, 15 Jan 2011 22:44:37 +0000 (06:44 +0800)]
ueventd.rc: remove redundant definitions

Change-Id: Icb4f051abf941052aca9752ca2949386738d94e5

8 years agoinit.rc: use relative path for symlink
Chih-Wei Huang [Sat, 15 Jan 2011 22:25:37 +0000 (06:25 +0800)]
init.rc: use relative path for symlink

Usually it's better to use relative path for symlink. For example,
to use Android in a chroot environment, the absolute symlink will
fail outside the chroot environment. Using relative path guarantees
the link will work both inside and outside chroot.

Change-Id: I2f654a05189b9a666aed1fc7bdfb5a50357aff78

8 years agoUPSTREAM_PENDING newfs_msdos: Handle alignment failure
Irina Patru [Fri, 22 Aug 2014 12:18:49 +0000 (15:18 +0300)]
UPSTREAM_PENDING newfs_msdos: Handle alignment failure

When trying to create a new FAT32 file system using alignment, the resulted
MBR structure is corrupted, because the total sectors reported does not
correspond to the actual available sectors. This is due to the reserved
sectors field which is updated during the alignment.

When fsck_msdos will try to check this file system, it will fail because it
cannot match the reported sectors with the actual available sectors.
Due to the failed check, the file system cannot be mounted by vold.

I/fsck_msdos( 2180): FAT size too small, 242822 entries won't fit into 1897 sectors
I/fsck_msdos( 2180): fsck_msdos terminated by exit(8)
E/Vold    ( 2180): Filesystem check failed (unknown exit code 8)
E/Vold    ( 2180): /dev/block/vold/179:49 failed FS checks (I/O error)
D/Vold    ( 2180): Volume sdcard1 state changing 3 (Checking) -> 1 (Idle-Unmounted)

In order to fix this issue, we will save the initial bpb structure and restore
it if the alignment fails.

Change-Id: I58d5078551c689b28c9070585bb330c45bab9c62
Signed-off-by: Irina Patru <irina.patru@intel.com>
Reviewed-on: https://android.intel.com/256992
Reviewed-by: Dolca, Robert <robert.dolca@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Popa, Valentin <valentin.popa@intel.com>
8 years agodevices: Increase the uevent socket buffer size
Samuel Ortiz [Thu, 17 Jul 2014 23:35:29 +0000 (01:35 +0200)]
devices: Increase the uevent socket buffer size

Depending on the timing, hald may start while ueventd is not done yet
with its initial coldboot. As hald also independently starts its own
coldboot, ueventd netlink socket buffer could get filled quickly and
thus ueventd could lose some uevents.
This is fixed by increasing the ueventd netlink socket buffer size.

Change-Id: Ie92f77c14099421740b3984f1cc23f813287b78f
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-on: https://android.intel.com/219843
Reviewed-by: Escande, Thierry <thierry.escande@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Ortiz, Samuel <samuel.ortiz@intel.com>
Tested-by: Ortiz, Samuel <samuel.ortiz@intel.com>
Tested-by: cactus <cactus@intel.com>
Reviewed-by: Porlan, Patrick <patrick.porlan@intel.com>
Reviewed-by: Bianti, Sebastien <sebastien.bianti@intel.com>
Reviewed-by: Mahalingam, Ganesh <ganesh.mahalingam@intel.com>
Tested-by: Mahalingam, Ganesh <ganesh.mahalingam@intel.com>
8 years agoinit: Add 'readprops' command
Andrew Boie [Fri, 12 Oct 2012 22:23:40 +0000 (15:23 -0700)]
init: Add 'readprops' command

This reads the contents of a text file and sets system properties
based on its contents.

Change-Id: Ic03de7ee9afb8a12439d0dff343560011e152beb
For: AXIA-102
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
8 years agoadb: reserve a wakelock when clients are connected over socket
Andrew Boie [Thu, 12 Jul 2012 22:39:25 +0000 (15:39 -0700)]
adb: reserve a wakelock when clients are connected over socket

USB OTG connections already have a wakelock reserved, but if a network
socket connection is made, the device can unexpectedly suspend
in the middle of a session. The lock is released when the client
disconnects.

Change-Id: Id5ac01699fab9350955c9814042259542fc6a694
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
8 years agoadd modprobe-like capability and automatic ueventd loading
Jianxun Zhang [Mon, 2 Jul 2012 18:32:30 +0000 (11:32 -0700)]
add modprobe-like capability and automatic ueventd loading

Author: Jianxun Zhang <jianxun.zhang@intel.com>
Author: Daniel Leung <daniel.leung@intel.com>
Author: Andrew Boie <andrew.p.boie@intel.com>

- insmod_by_dep() added to libcutils; loads a module into kernel.
Modules the target module depends on will be loaded first. Loading
will be stopped when an error occurs.

- rmmod_by_dep() added to libcutils; removes a module from kernel.
It also tries to remove other modules the target module depends
on until an error occurs.

- Implement wildcard matching for ueventd rules.
The PCI and USB addresses for devices can change from devices
from devices for a particular class of peripheral, for example,
bluetooth. The ueventd rules created with these addresses are
then device-specific.

This changes the way ueventd rules with wildcard are handled.
Instead of matching just the prefix with a trailing wildcard,
now these rules can have wildcard anywhere in the rule.
The wildcard matching is implemented using fnmatch(), where
its matching is simliar to shell pathname expansion. It suits
this particular usage model well.

For example, instead of creating a rule to match:

  /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/rfkill*

, this would suffice:

  /sys/devices/*/bluetooth/hci0/rfkill*

- Let ueventd auto-load kernel modules. Implements the functionality
for ueventd to auto-load kernel modules when uevents are triggered.
Since /system may not be mounted when uevents are fired,
a deferred loading mechanism is implemented. Once mapping of
module and alias is available, these modules are then loaded.
Modules can also be blacklisted so they will not be loaded
automatically. One example would be the Wifi driver, as
Android's has to control its loading and unloading.

- add 'probemod' builtin command. This command accepts the name of a
kernel module plus a set of command line arguments. The module will
be loaded, along with all its dependencies, using the libcutils
insmod_by_dep() API.

- Drivers in kernel can request modules by launching a program in
user space, the program's path by default is "/sbin/modprobe".
Because Android system has no modprobe and ueventd is the only
program handling the module aliases so far, This patch provides a
cheap approach to handle kernel's requests in ueventd executable.

- Add new builtin init command "coldboot". The main purpose is to
provide an approach in init.*.rc files to fire uevents for devices
under the path which is passed as the the argument. This should be
called after /system is mounted so any queued events that need to
load a module can be fired.

8 years agolibdiskconfig: Enable Mac OS X host build
Andrew P. Boie [Fri, 31 Aug 2012 19:05:55 +0000 (12:05 -0700)]
libdiskconfig: Enable Mac OS X host build

Change-Id: Iacc7d5463364d0cd15ca9fabaa58ad05857d9e78
Signed-off-by: Andrew P. Boie <andrew.p.boie@intel.com>
8 years agodiskconfig: Fix disk_layout.conf size parsing
Andrew Boie [Fri, 11 Nov 2011 01:58:05 +0000 (17:58 -0800)]
diskconfig: Fix disk_layout.conf size parsing

If the user was appending 'K' to their lengths (which is valid
but redundant) it was being treated as megabytes instead of
kilobytes.

Change-Id: I979ec4d01f1342de1f3209b946201ca87bad32a7

8 years agoUse progressive offset in buffer for successive writes
Paul Drews [Mon, 20 Jun 2011 17:01:24 +0000 (10:01 -0700)]
Use progressive offset in buffer for successive writes

The code for copying from one raw file to another looped
back and tried again with a suitably smaller number of bytes
if the entire buffer was not written on the first try.
However, it failed to advance an offset in the buffer past
the bytes that were written.  This could conceivably happen
under rare circumstances, leading to a corrupted disk image.

This fix defines an offset into the buffer, advancing it by
the number of bytes written on each successive retry.

Signed-off-by: Paul Drews <paul.drews@intel.com>
Change-Id: I76b8e0b3c0d3b0c32bd2114d0867ac7489808279

8 years agolibdiskconfig: HACK Don't do space checks on zero-size images
Andrew Boie [Wed, 11 Jul 2012 03:43:29 +0000 (20:43 -0700)]
libdiskconfig: HACK Don't do space checks on zero-size images

If an image file is of zero size, assume we just want to expand it
to fit the available images.

Change-Id: If8f22eb12d3a5179960d4359307bb177e3323e8a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
8 years agoDon't demangle symbol names.
Josh Gao [Wed, 23 Mar 2016 18:42:53 +0000 (11:42 -0700)]
Don't demangle symbol names.

Bug: http://b/27299236
Change-Id: I26ef47f80d4d6048a316ba51e83365ff65d70439

8 years agomerge in mnc-dr1.5-release history after reset to mnc-dr1.5-dev
The Android Automerger [Tue, 22 Mar 2016 22:47:55 +0000 (15:47 -0700)]
merge in mnc-dr1.5-release history after reset to mnc-dr1.5-dev

8 years agomerge in mnc-dr1.5-release history after reset to mnc-dr1.5-dev
The Android Automerger [Fri, 18 Mar 2016 01:36:51 +0000 (18:36 -0700)]
merge in mnc-dr1.5-release history after reset to mnc-dr1.5-dev

8 years agoDon't create tombstone directory.
Josh Gao [Tue, 16 Feb 2016 23:01:43 +0000 (15:01 -0800)]
Don't create tombstone directory.

Partial backport of cf79748.

Bug: http://b/26403620
Change-Id: Ib877ab6cfab6aef079830c5a50ba81141ead35ee

8 years agoDon't create tombstone directory.
Josh Gao [Tue, 16 Feb 2016 23:01:43 +0000 (15:01 -0800)]
Don't create tombstone directory.

Partial backport of cf79748.

Bug: http://b/26403620
Change-Id: Ib877ab6cfab6aef079830c5a50ba81141ead35ee

8 years agoRe-derive permissions after package changes.
Jeff Sharkey [Wed, 16 Dec 2015 20:20:37 +0000 (13:20 -0700)]
Re-derive permissions after package changes.

When packages change, existing package-specific directories may have
gained/lost a UID mapping, so we need to update the permissions for
any in-memory nodes.

This allows an app to deliver data for another package before that
package is installed, which is the typical pattern of how OBB files
are delivered.

Also fix bug by re-deriving permissions when files are moved.

Bug: 25399427
Change-Id: I06f38a24ad7dee5f5099ba81429aef03208e5683
(cherry picked from commit f7aad11c1cc133e352333f83e3abbf323cd41ead)

8 years agoMerge "[DO NOT MERGE] Use FUSE_SHORTCIRCUIT if available" into mnc-dr1.5-dev
Thierry Strudel [Thu, 14 Jan 2016 00:32:01 +0000 (00:32 +0000)]
Merge "[DO NOT MERGE] Use FUSE_SHORTCIRCUIT if available" into mnc-dr1.5-dev

8 years ago[DO NOT MERGE] Use FUSE_SHORTCIRCUIT if available
Thierry Strudel [Wed, 13 Jan 2016 23:11:35 +0000 (15:11 -0800)]
[DO NOT MERGE] Use FUSE_SHORTCIRCUIT if available

Use a non yet maintainer reviewed kernel patch from QCOM that greatly
improves IO speed in case it is available from the device specific
kernel headers.

Bug: 24216004
Change-Id: I4101d80082c9ad9d042dde5c620ddb309d193d52

8 years agoMount debugfs earlier regardless build variant
Ching Tzung Lin [Mon, 11 Jan 2016 22:50:00 +0000 (22:50 +0000)]
Mount debugfs earlier regardless build variant
am: df2d782368

* commit 'df2d78236834f5f6a99e88c8cd629b09d8292bb6':
  Mount debugfs earlier regardless build variant

8 years agoMount debugfs earlier regardless build variant
Ching Tzung Lin [Mon, 11 Jan 2016 21:00:22 +0000 (13:00 -0800)]
Mount debugfs earlier regardless build variant

ag/835596 can be reverted after this CL is merged.

BUG:26455292
Change-Id: I453b0f1d08d822f8cd2d4d33f1c1b21f0d7f543a

8 years agoMerge "Fix logspam from system-background cpuset." into mnc-dr1.5-dev
Tim Murray [Thu, 17 Dec 2015 21:46:29 +0000 (21:46 +0000)]
Merge "Fix logspam from system-background cpuset." into mnc-dr1.5-dev

8 years agoFix logspam from system-background cpuset.
Tim Murray [Thu, 17 Dec 2015 21:11:50 +0000 (13:11 -0800)]
Fix logspam from system-background cpuset.

system-background can't be opened by most processes, since system-bg is
a privileged cpuset. Remove the log message when it can't be
opened. We'll still log a failure to use the fd if we try to use it
after it can't be opened, which is fine.

bug 26249842

Change-Id: I99f185c51645bc81b6a41732848227c27675cdf7

8 years agomerge in mnc-mr1-release history after reset to mnc-dr-dev
The Android Automerger [Thu, 17 Dec 2015 21:08:38 +0000 (13:08 -0800)]
merge in mnc-mr1-release history after reset to mnc-dr-dev

8 years agoRe-derive permissions after package changes.
Jeff Sharkey [Wed, 16 Dec 2015 20:20:37 +0000 (13:20 -0700)]
Re-derive permissions after package changes.

When packages change, existing package-specific directories may have
gained/lost a UID mapping, so we need to update the permissions for
any in-memory nodes.

This allows an app to deliver data for another package before that
package is installed, which is the typical pattern of how OBB files
are delivered.

Also fix bug by re-deriving permissions when files are moved.

Bug: 25399427
Change-Id: I06f38a24ad7dee5f5099ba81429aef03208e5683

8 years agomerge in mnc-mr1-release history after reset to mnc-dr-dev
The Android Automerger [Tue, 15 Dec 2015 20:55:00 +0000 (12:55 -0800)]
merge in mnc-mr1-release history after reset to mnc-dr-dev

8 years agologcatd: up size from 16MB to 256MB
Alain Vongsouvanh [Tue, 15 Dec 2015 17:47:57 +0000 (09:47 -0800)]
logcatd: up size from 16MB to 256MB
am: 2f18b54502

* commit '2f18b5450293c2360f688cd059989e36ba5a988c':
  logcatd: up size from 16MB to 256MB

8 years agoFix incorrect check of descsz value.
Christopher Ferris [Thu, 22 Oct 2015 20:34:48 +0000 (13:34 -0700)]
Fix incorrect check of descsz value.

Bug: 25187394

(cherry picked from commit 1fa55234d6773e09e3bb934419b5b6cc0df981c9)

Change-Id: Idbc9071e8b2b25a062c4e94118808d6e19d443d9

8 years agologcatd: up size from 16MB to 256MB
Alain Vongsouvanh [Fri, 2 Oct 2015 16:49:21 +0000 (09:49 -0700)]
logcatd: up size from 16MB to 256MB

Based on: https://android-review.googlesource.com/#/c/172084

Change-Id: Idaa4177618acef31806b4d8f6a2f5caa859e8992

8 years agoAdd macro to call event logger for errors.
William Luh [Thu, 13 Aug 2015 17:41:58 +0000 (10:41 -0700)]
Add macro to call event logger for errors.

Bug:23180694
Change-Id: I566a290334345f48013029534efef3e08e726e40

8 years agoDO NOT MERGE: add support for new sched tracepoint
Tim Murray [Mon, 30 Nov 2015 18:58:26 +0000 (10:58 -0800)]
DO NOT MERGE: add support for new sched tracepoint

This tracepoint gives systrace the means to display the reason
for uninterruptible sleep.

bug 23350688

Change-Id: Iaf9c929fe1169f8872a7f8135343950aa322b0f5

8 years agoImprove cpuset support for surfaceflinger.
Tim Murray [Tue, 10 Nov 2015 22:31:09 +0000 (14:31 -0800)]
Improve cpuset support for surfaceflinger.

SurfaceFlinger needs some of its threads in the system-background cpuset
and some of its threads (the binder pool) outside of the
system-background cpuset in order to improve UI perf/power
consumption. Remove surfaceflinger from the system-background cpuset in
init.rc and allow a thread to place itself in the system-background
cpuset given enough permissions.

bug 25745866

Change-Id: I85f7e41c5439e6ad7cc2d355e51f5dfb3a0c7088

8 years agologcat: continue where we left off
Mark Salyzyn [Thu, 12 Nov 2015 23:44:18 +0000 (23:44 +0000)]
logcat: continue where we left off
am: 5b0d59dde8

* commit '5b0d59dde85162fa9ef3a32464c0f1b81d7e05cb':
  logcat: continue where we left off

8 years agologcat: continue where we left off
Mark Salyzyn [Tue, 6 Oct 2015 15:59:02 +0000 (08:59 -0700)]
logcat: continue where we left off

Issue introduced as part of new logcatd functionality in
commit f3555d9427425c2cba9600ceffb49305c440aa4a

Faulty logic, add a gTest to confirm.

Bug: 19608716
Change-Id: Ic1b97def25e03e69faae4398a3dff2ff0f88545e