Commit graph

6238 commits

Author SHA1 Message Date
Ziv Hendel
a306ced1ac libusbhost: It's no longer assumed that "bus/usb" exists once "bus" was created
On some devices there is a slight delay between the creation of "/dev/bus"
and "/dev/bus/usb". Previously, the code assumed that both are created in the
same time which caused "watch_existing_subdirs" to fail and libusbhost to stop
working until the device is rebooted. The fix will setup an inotify event on the
creation of the "bus/usb" so it will not be missed once it's created.

Change-Id: I17f06dd167e61573307425e48898e12ebc954093
2013-08-20 17:51:13 -07:00
Alex Klyubin
18860c5249 Enable run-as to read packages.list now owned by package_info.
The group ownership of the package database
/data/system/packages.list read by run-as was changed in
977a9f3b1a from "system" to
"package_info". run-as currently changes its effective group to
"system" and is thus unable to read the database.

This CL fixes the issue by making run-as change its effective group
to "package_info" for reading the package database.

Bug: 10411916
Change-Id: Id23059bfb5b43264824917873a31c287f057ce4e
2013-08-20 15:16:31 -07:00
Alex Klyubin
0d872d8bb4 Seed Linux RNG from Hardware RNG at boot during init.
The Linux RNG may have little entropy during boot. As more and more
devices have a Hardware RNG, we mix in 512 bytes from Hardware RNG
(if present) into Linux RNG early during boot (after
wait_for_coldboot_done and before property_service_init actions in
init).

To avoid having to trust the output of Hardware RNG, we do not mix it
into the Linux RNG's primary pool or increase the Linux RNG's entropy
estimates.

Bug: 10362513
Change-Id: I80617f21710400747f5e7533e518d90ea74e2f11
2013-08-19 16:58:28 -07:00
Jeff Brown
c7a4f74dad Merge "Add helpers for audio remote submix devices." into klp-dev 2013-08-19 23:56:44 +00:00
Michael Wright
9f50abdee0 Add basic readlink command
Change-Id: I693c1098e6c6d107a9e97285bf826ab153a1c8f0
2013-08-19 16:31:35 -07:00
Jeff Brown
8ecc7afca4 Add helpers for audio remote submix devices.
Bug: 10265163
Change-Id: Iea7ecab4f2a655b719ff14b04c757d6dbd7a7ef3
2013-08-16 20:21:10 -07:00
Jesse Hall
08380deb24 Merge "Replace sRGB_888 with sRGB_X_8888" into klp-dev 2013-08-16 21:50:21 +00:00
Lorenzo Colitti
3984276ce4 Get rid of an infinite loop in NetlinkEvent.cpp.
Bug: 10358527
Bug: 10263310
Bug: 10232006
Change-Id: I750e4bdf2000040adf214d6a772591d7bd25b350
2013-08-17 04:02:14 +09:00
Jesse Hall
1e26356da1 Replace sRGB_888 with sRGB_X_8888
Bug: 10357459
Change-Id: I23a3eca77acd8b4b40b1a67e7c050a7245b1821a
2013-08-16 08:40:52 -07:00
Lorenzo Colitti
341ed242d4 Merge "Parse IP address changes in NetlinkEvent." into klp-dev 2013-08-16 02:24:12 +00:00
Ken Sumrall
57d4b4ea6f Merge "Fix handle_opendir() in the sdcard daemon" into klp-dev 2013-08-15 03:28:31 +00:00
Ken Sumrall
3a8768804c Fix handle_opendir() in the sdcard daemon
The fuse_open_out structure returned to the kernel by handle_opendir()
was not properly initializing all the fields.  The symptom was recursive
ls (ls -R) failing on the emulated sdcard filesystem, because rewinddir(3)
was failing with ESPIPE.

Bug: 7168594
Change-Id: I56ddfd3453e6aac34fe6e001e88c4c46fb2eb271
2013-08-14 20:02:13 -07:00
Jeff Sharkey
7e64c1436b Merge "Add legacy layout support to FUSE, enforce write." into klp-dev 2013-08-14 20:08:34 +00:00
Jeff Sharkey
977a9f3b1a Add legacy layout support to FUSE, enforce write.
The legacy internal layout places users at the top-level of the
filesystem, so handle with new PERM_LEGACY_PRE_ROOT when requested.

Mirror single OBB directory between all users without requiring fancy
bind mounts by letting a nodes graft in another part of the
underlying tree.

Move to everything having "sdcard_r" GID by default, and verify that
calling apps hold "sdcard_rw" when performing mutations. Determines
app group membership from new packages.list column.

Flag to optionally enable sdcard_pics/sdcard_av permissions
splitting. Flag to supply a default GID for all files. Ignore
attempts to access security sensitive files. Fix run-as to check for
new "package_info" GID.

Change-Id: Id5f3680779109141c65fb8fa1daf56597f49ea0d
2013-08-14 12:01:38 -07:00
Lorenzo Colitti
a4b4e9ad8e Parse IP address changes in NetlinkEvent.
This adds support for parsing RTM_NEWADDR and RTM_DELADDR
netlink messages received on netd's netlink socket and
formatting them them so NetlinkHandler can process them.

Address changes are notified in subsystem "address". Interface
changes, which used to be notified in subsystem "net", are now
notified in subsystem "interface" to avoid confusion.

Bug: 10232006
Change-Id: I93a50e8de17014e118a42f5cc0eb90a0cbfa73cc
2013-08-14 19:50:22 +09:00
Todd Poynor
f5d3012d2c healthd: Move power_supply attribute paths to healthd_config
Allow health HAL to select specific paths to be used, overriding
default search for arbitrary power supplies with the named paths.

Change-Id: I5f724739f58ef56087ab592b7403fc083db8f173
2013-08-14 02:27:54 +00:00
Todd Poynor
d65104ca31 healthd: switch to HAL static libraries
Change-Id: I5a802f9b9a8ad4782c4d0c6376a068aef32a70cb
2013-08-13 16:09:12 -07:00
Todd Poynor
a41611f638 healthd: fix botched logging call
Change-Id: Ibf5e28c657e0d9d193b266acd7b2912bebc3e71f
2013-08-12 12:18:36 -07:00
Todd Poynor
57fd0989cb healthd: preserve uA and uAh units for current_now and charge_counter
Change-Id: I20b3f47c541c4321b0593e504090ad6573b9cb01
2013-08-09 21:52:25 +00:00
Jeff Sharkey
dfe0cbab3f Richer SD card permissions through FUSE.
Changes the FUSE daemon to synthesize an Android-specific set of
filesystem permissions, even when the underlying media storage is
permissionless.  This is designed to support several features:

First, apps can access their own files in /Android/data/com.example/
without requiring any external storage permissions.  This is enabled
by allowing o+x on parent directories, and assigning the UID owner
based on the directory name (package name).  The mapping from package
to appId is parsed from packages.list, which is updated when apps are
added/removed.  Changes are observed through inotify.  It creates
missing package name directories when requested and valid.

Second, support for separate permissions for photos and audio/video
content on the device through new GIDs which are assigned based on
top-level directory names.

Finally, support for multi-user separation on the same physical media
through new /Android/user/ directory, which will be bind-mounted
into place.  It recursively applies the above rules to each secondary
user.

rwxrwx--x root:sdcard_rw     /
rwxrwx--- root:sdcard_pics   /Pictures
rwxrwx--- root:sdcard_av     /Music

rwxrwx--x root:sdcard_rw     /Android
rwxrwx--x root:sdcard_rw     /Android/data
rwxrwx--- u0_a12:sdcard_rw   /Android/data/com.example
rwxrwx--x root:sdcard_rw     /Android/obb/
rwxrwx--- u0_a12:sdcard_rw   /Android/obb/com.example

rwxrwx--- root:sdcard_all    /Android/user
rwxrwx--x root:sdcard_rw     /Android/user/10
rwxrwx--- u10_a12:sdcard_rw  /Android/user/10/Android/data/com.example

These derived permissions are disabled by default.  Switched option
parsing to getopt().

Change-Id: I21bf5d79d13f0f07a6a116122b16395f4f97505b
2013-08-08 17:26:41 -07:00
Todd Poynor
9face5cad5 healthd: create healthd_board_init()
Subsume healthd_board_poll_intervals, make clear the call is for init-time
actions.

Change-Id: I9267e4ce7c62b78d2997a43822f20bfa13b54cd8
2013-08-08 12:26:36 -07:00
Todd Poynor
10b235e743 healthd: add health HAL support
Adds board-specific battery monitoring capabilities:

* processing of battery property values and additional charging logic.
* adjusted (or removed) polling intervals.
* replaced (or removed) battery status heartbeat in kernel log.

Change-Id: Ia77bca8dc92c6c2a51afa65d516cacca08da73ac
2013-08-07 18:57:37 -07:00
Todd Poynor
b45f1f5bd0 healthd: add optional current_now and charge_counter to tracked state
uA and uAh units are converted to mA and mAh.

If current_now is present, add it to the heartbeat log (c=nnn).

Change-Id: I2b5fe7b4505c98ca2d11c3f94564c1c38493c8b9
2013-08-07 18:34:34 +00:00
Geremy Condra
d893e39d4f Merge "Add basic verity support to fs_mgr." 2013-08-07 18:20:33 +00:00
Geremy Condra
3ad3d1c4b5 Add basic verity support to fs_mgr.
This change adds a "verify" fs_mgr flag specifying that
the device in question should be verified.

Devices marked with this flag are expected to have a
footer immediately after their data containing all
the information needed to set up a verity instance.

Change-Id: I10101f2c3240228ee0932e3767fe35e673d2e720
2013-08-06 22:15:58 -07:00
Glenn Kasten
9de3fd115a Merge "Add audio_input_flags_t" 2013-08-05 19:11:34 +00:00
Alex Ray
d98e07fdf9 move libs/utils to libutils
Change-Id: I6cf4268599460791414882f91eeb88a992fbd29d
2013-08-02 14:40:08 -07:00
Dmitry Shmidt
be06210c50 libnetutils: Get mtu together with dhcp session results
Change-Id: I517fd1f62d451b07466a21a2b770d9ce389dac19
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-08-02 14:09:09 -07:00
Glenn Kasten
c051ffd7c2 Add audio_input_flags_t
Change-Id: Ie65398cc67218cc63be4baa8a2a61d0ea591a2a3
2013-08-02 10:30:42 -07:00
Eino-Ville Talvala
b4802413a7 Merge "Window: Add query for consumer usage bits." 2013-08-02 00:23:02 +00:00
Mathias Agopian
ddff623049 minor tweaks to FlattenableUtils
Change-Id: Ibfceec36434baac92c8815a18d902375d3fa1a6d
2013-08-01 12:47:58 -07:00
Dianne Hackborn
0f10d0abf3 Add a new utf8-to-utf16 conversion function.
Change-Id: I957c22fb219596ca4239db7a169473d3894b09eb
2013-07-31 16:04:39 -07:00
Alex Ray
d43eae5e39 Merge remote-tracking branch 'goog/libutils-import' into HEAD 2013-07-31 13:47:17 -07:00
Brian Carlstrom
5189f9a263 Fix BlobCache_test
Change-Id: I5b20aeb4dcff80f1e18e1165b8461d20034dc1ac
2013-07-31 13:41:50 -07:00
Mathias Agopian
6d611a891d Make Flattenable not virtual (libutils)
Making an object Flattenable doesn't force it to
become virtual anymore. For instance, Fence and GraphicBuffer
are now non-virtual classes.

Also change Flatennable protocol a bit so that it updates
its parameters (pointers, sizes) to make it easier
to implement a flattenable in terms of other flattenables.

Change-Id: Ie81dc7637180b3c2cfcbaf644f8987ca804eb891
2013-07-31 13:41:41 -07:00
Eino-Ville Talvala
f88a5b4f88 Window: Add query for consumer usage bits.
Bug: 9592202
Change-Id: Ied2fdb985dc59dd9c0f26c515353abdc37f0eb77
2013-07-30 21:38:13 +00:00
Alex Ray
0d8f3d6c45 libutils: give BasicHashtableImpl a virtual destructor
Change-Id: I4ec590b060d732af5fe525670becbe778684247b
2013-07-30 13:57:01 -07:00
Colin Cross
946003ae64 add static dependency on liblog
Change-Id: Ibf8733142d52e4ffac2e3b26932d7196fb79c5a7
2013-07-30 13:57:01 -07:00
Alex Ray
567ea471ff utils: move thread enums to system/core
Change-Id: Ia97963cc9acf8661d01355786f5e7e7bf54581c2
2013-07-30 13:57:01 -07:00
Michael Wright
d614ee4557 Added bitwise-or and bitwise-and to BitSet
Change-Id: I9bbf41f9d2d4a2593b0e6d7d8be7e283f985bade
2013-07-30 13:57:01 -07:00
Tim Murray
214c701ec6 Make trace macros slightly more robust
Change-Id: I9544eb7b27fc1a971cabadd8d5b4b4b80678febf
2013-07-30 13:57:01 -07:00
Nick Kralevich
e45a9acd63 Remove unnecessary header file.
In b2cac4ff37ed2a3521efb307b807b12f649634b8, the last
reference to property_get was removed, but the include
file remained. Remove it.

This is causing me unrelated problems.

Change-Id: I87bbfbfa5871f6da4a1b00037a225f67bbd75881
2013-07-30 13:57:01 -07:00
Mathias Agopian
8db925f777 remove unused declarations and reformat
Change-Id: I4e168fb62c275e02621c4b6e0c6000d0f006c327
2013-07-30 13:57:01 -07:00
Mathias Agopian
d3d3fceb7c remove reserved virtual slots
these consume small amount of space (plt) in every library that
links against libutils.

Change-Id: I1b6b3dd9098aa5a051243f7a5dbf91cd7dcb8b2c
2013-07-30 13:57:01 -07:00
Mathias Agopian
4485d0d966 new String8, String16 ctors to initialize empty static strings with static linkage
when libutils is statically linked, the ordering of the static
initializer is not guaranteed and therefore it's unsafe to use
empty static strings: e.g.:

static String8 sThisStaticStringIsNotSafe;

instead, this new constructor can be used:

static String8 sThisStaticStringIsSafe(kEmptyString);

Change-Id: Ia3daf1cab1c97d021c0ee9c2b394b5e27e8d6c0d
2013-07-30 13:57:01 -07:00
Mathias Agopian
9eb2a3b1c0 libutils clean-up
Change-Id: I6ff4cfc736751de2912c697f954e45e275f2d386
2013-07-30 13:57:01 -07:00
Dianne Hackborn
19159f9002 Add new Looper API to check whether the looper is idle.
This is just to support the watchdog to give it a faster
way to determine if a thread is deadlocked without having
to post a message to it.

Change-Id: I068dc8b9387caf94fe5811fb4aeb0f9b57b1a080
2013-07-30 13:57:01 -07:00
Todd Poynor
d9ad7d8d73 String8: ensure static init done prior to empty string reference
Avoid NULL deref on static initialization of empty String8 objects prior
to libutils static init.

Change-Id: I3d420041ba62b97ed8c2dfd2532a2dcd72b84ff1
2013-07-30 13:57:01 -07:00
Bjorn Bringert
00c14b4be4 Build a static device libutils
This is needed to make tools such as aapt more compatible when
built for the device.

Change-Id: I1261d47b6e24595f1be547b9202892863f66a1de
2013-07-30 13:57:01 -07:00
Mathias Agopian
d34a8cad1e improved CallStack a bit
- added a ctor that updates and dumps the stack immediately
- added a "logtag" parameter to dump()

Change-Id: Ie51c256071d282591752243bdb4f68cf9ff8829d
2013-07-30 13:57:01 -07:00