Commit graph

14673 commits

Author SHA1 Message Date
Todd Kjos
1fb6e24f19 Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev 2015-06-29 22:29:54 +00:00
Adam Lesinski
1eb38187af Merge "Adds a parameter to the wakeup_callback to report sucessful wakeup or suspend aborts." into mnc-dev 2015-06-27 00:40:28 +00:00
Jeff Sharkey
169944afdf Remove unused methods to fix build.
Change-Id: I6e1f85a7cc3428d558460737da3b3193d035b73e
2015-06-26 09:43:52 -07:00
Jeff Sharkey
f38f29c87d Let's reinvent storage, yet again!
Now that we're treating storage as a runtime permission, we need to
grant read/write access without killing the app.  This is really
tricky, since we had been using GIDs for access control, and they're
set in stone once Zygote drops privileges.

The only thing left that can change dynamically is the filesystem
itself, so let's do that.  This means changing the FUSE daemon to
present itself as three different views:

/mnt/runtime_default/foo - view for apps with no access
/mnt/runtime_read/foo - view for apps with read access
/mnt/runtime_write/foo - view for apps with write access

There is still a single location for all the backing files, and
filesystem permissions are derived the same way for each view, but
the file modes are masked off differently for each mountpoint.

During Zygote fork, it wires up the appropriate storage access into
an isolated mount namespace based on the current app permissions.  When
the app is granted permissions dynamically at runtime, the system
asks vold to jump into the existing mount namespace and bind mount
the newly granted access model into place.

Bug: 21858077
Change-Id: I5a016f0958a92fd390c02b5ae159f8008bd4f4b7
2015-06-25 22:27:04 -07:00
Sasha Levitskiy
7ded5799a9 Fingerprintd: Add post_enroll() API.
Change-Id: Ia50460c4fa7a5b9112f411970ab96af070863f6f
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2015-06-25 15:59:55 -07:00
Todd Kjos
4cdce427f9 Fix janky navbar ripples -- incorrect timerslack values
If a thread is created while the parent thread is "Background",
then the default timerslack value gets set to the current
timerslack value of the parent (40ms). The default value is
used when transitioning to "Foreground" -- so the effect is that
the timerslack value becomes 40ms regardless of foreground/background.

This does occur intermittently for systemui when creating its
render thread (pretty often on hammerhead and has been seen on
shamu). If this occurs, then some systemui animations like navbar
ripples can wait for up to 40ms to draw a frame when they intended
to wait 3ms -- jank.

This fix is to explicitly set the foreground timerslack to 50us.

A consequence of setting timerslack behind the process' back is
that any custom values for timerslack get lost whenever the thread
has transition between fg/bg.

See Bug: 19398120

Change-Id: Idc259717f62fa2255f8bafbbf88b68c0043f29cf
2015-06-25 14:29:07 -07:00
Ruchi Kandoi
d3027d85f3 Adds a parameter to the wakeup_callback to report sucessful wakeup or suspend aborts.
Adds the call to wakeup_callback when the write to the /sys/power/state
fails. This will help userspace account for the suspend aborts.

Bug: 17478088
Bug: 18179405
Change-Id: Icd1194cfbaf61044ca0b2fe63a10a4c52e1535bc
2015-06-25 13:15:22 -07:00
Andres Morales
9a53bb0f80 Merge "[gatekeeperd] fix issue with SW->HW upgrades" into mnc-dev 2015-06-25 15:43:02 +00:00
Mark Salyzyn
e27ee08abb Merge "logd: serialize accesses to stats helpers" into mnc-dev 2015-06-25 15:35:45 +00:00
Mark Salyzyn
5803b79528 logd: serialize accesses to stats helpers
(cherry pick from commit ed777e9eec)

Quick low-risk to resolve possible hash table corruption.
Resolved an unlikely path memory leak.

ToDo: replace lock with nested lock so no lock
      helpers are required.

Bug: 22068332
Change-Id: I303ab06608502c7d61d42f111a9c43366f184d0c
2015-06-25 08:34:06 -07:00
Yusuke Sato
5c8f6f22c5 Merge "Add |optional_suffix| to StartIteration()" into mnc-dev 2015-06-25 15:22:10 +00:00
Andres Morales
7f6dcf6576 [gatekeeperd] fix issue with SW->HW upgrades
If the handle version is 0, there's no hardware_backed flag
meaning hardware backed handles will be attempted against
the soft impl. Ensure we don't try to read from hardware_backed
unless the version is > 0.

Bug: 21090356
Change-Id: I65f009c55538ea3c20eb486b580eb11ce93934fc
2015-06-24 18:40:24 -07:00
Dan Albert
262be42687 Merge "Add missing include. Clang build fix." into mnc-dev 2015-06-24 21:41:13 +00:00
Andres Morales
3c2086dabd [gatekeeperd] clear state and mark on cold boot
required to initialize state by certain HAL impls

Bug: 22011857
Change-Id: Ibb01a799da983e1a930aae946c331b23f571861d
2015-06-24 10:22:45 -07:00
Yusuke Sato
a4a80693d9 Add |optional_suffix| to StartIteration()
so that PackageManagerService can iterate over files with a
specific file extension like ".so".

Bug: 21957428
Change-Id: I76ed9560d4d1e00d297a97d518ec357166be1981
2015-06-23 17:31:16 -07:00
Andres Morales
b2856ddbd3 Merge "[gatekeeperd] invalidate stale password cache" into mnc-dev 2015-06-23 18:41:38 +00:00
Andres Morales
9ea9a06b06 [gatekeeperd] invalidate stale password cache
password may change offline, invalidate the cache if it is
stale

Bug: 22019187
Change-Id: I2aaae978c8bd4629a0f93df3778d8679ae9b53d5
2015-06-23 11:29:57 -07:00
Paul Crowley
749af8c08f Set up user directory crypto in init.
(cherry-picked from commit b94032b79c)

Bug: 19704432
Change-Id: Ife4928ffbee39c8ae69e6ba66d9ce5ef5a0beb76
2015-06-23 15:21:51 +00:00
Sasha Levitskiy
fbf61b1f76 Merge "Fingerprint: Safeguard against empty paths." into mnc-dev 2015-06-23 00:20:42 +00:00
Pavlin Radoslavov
4caa9f39bb Merge "Fix the file permissions of /data/misc/bluedroid/bt_config.conf" into mnc-dev 2015-06-22 22:03:20 +00:00
Tim Murray
98c6de6926 Merge "Don't set cgroup policy when updating cpusets." into mnc-dev 2015-06-22 21:31:14 +00:00
Tim Murray
999102664c Don't set cgroup policy when updating cpusets.
bug 21782794

Change-Id: I3b2cf8ae4f3ed0c14f206584ae7fa2b1a1d11ad0
2015-06-22 14:00:56 -07:00
Sasha Levitskiy
99115b9148 Fingerprint: Safeguard against empty paths.
Bug 21930029

Change-Id: I116f4ec333d25406ba811fec7331cbf9ff1a4027
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2015-06-22 13:16:51 -07:00
Andres Morales
835d96eae5 [gatekeeperd] handle upgrades from software version to HAL
Certain devices, like Shamu, are currently running an interim
software-only gatekeeper. When the HAL for those devices is merged,
we need to handle upgrading to the HAL smoothly.

Bug: 21090356
Change-Id: I5352bc547a43671a08249eae532e8b3ce6b90087
2015-06-22 13:12:41 -07:00
Andres Morales
c7ab1e8177 [gatekeeperd] add fast path for SW password verification
Bug: 21445004
Change-Id: I5e36ddbefaf1fa8de8623858fd785ac8fb651a4f
2015-06-22 12:05:57 -07:00
Pavlin Radoslavov
8175bb2352 Fix the file permissions of /data/misc/bluedroid/bt_config.conf
Fix the file access permissions and group ownership of
"/data/misc/bluedroid/bt_config.conf" so the file can be reused when
switching users on the device.
For that purpose, we need to do the following:

1. Set the set-group-ID (bit 02000) flag for directory "/data/misc/bluedroid"
   so the files created in that directory will have group-id of
   "net_bt_stack" .

2. Change the file's permissions of file "/data/misc/bluedroid/bt_config.conf"
   to Read/Write by User and Group.

Bug: 21493919
Change-Id: Ie00ab4695198ef2aa299b484ef9d4f17bd41b98a
2015-06-22 10:19:30 -07:00
Elliott Hughes
1cddc2092f Ignore ro.adb.secure in user builds.
Require authorization by default, and remove the ability to override
that in user builds. (userdebug and eng are still free to do whatever
they want.)

Bug: http://b/21862859
Change-Id: Ibf8af375be5bf1141c1ad481eee7a59fb10a7adb
(cherry picked from commit 5cba504215)
2015-06-19 13:26:02 -07:00
Mike Lockwood
6ee7ff4268 Merge "libusbhost: Fix problem reading USB string descriptors on some quirky devices" into mnc-dev 2015-06-18 22:24:42 +00:00
Mike Lockwood
0dd1aab7b5 libusbhost: Fix problem reading USB string descriptors on some quirky devices
Some devices fail to send USB string descriptors if you attempt to read more
than 255 bytes

Bug: 21871761
Change-Id: Id5b8865179f80523f0ad5b6028d49dd99db2b36b
2015-06-18 13:38:31 -07:00
Erik Kline
60adb5fac8 Merge "Qualify IPv6 link-local DNS servers with an interface name" into mnc-dev 2015-06-18 08:35:30 +00:00
The Android Automerger
bd5cb99723 merge in mnc-release history after reset to mnc-dev 2015-06-18 01:03:53 -07:00
Erik Kline
ba48ff7a59 Qualify IPv6 link-local DNS servers with an interface name
Bug: 21562630
Bug: 21764392
Change-Id: I7d271ae0f3fd92f70049017d38ccc15e3c1dda83
2015-06-18 15:44:41 +09:00
Elliott Hughes
e79d0d556f init support for cgroups.
This adds the "writepid" option that instructs init to write the child's
pid to the given filenames (such as /dev/cpuctl/bg_non_interactive/cgroup.procs
and/or /dev/cpuset/foreground/cgroup.procs).

Bug: http://b/21163745
Change-Id: I121bb22aa208bc99c4fb334eb552fdd5bcc47c1a
(cherry picked from commit d62f0608d9)
2015-06-17 15:21:52 -07:00
The Android Automerger
9e28ac08b3 merge in mnc-release history after reset to mnc-dev 2015-06-17 01:05:44 -07:00
Yusuke Sato
d50393057a processgroup: change the polling interval for killProcessGroup()
to make the function faster on average. Since killing a process
takes about 40-60ms on a recent device, the previous logic tends
to sleep too long. This CL does not significantly change the total
timeout (old code: 204ms, new code: 200ms).

Bug: 21813611
Change-Id: Ica44b2437ccccaebadcf585d7a09d993ce71a499
2015-06-16 13:59:32 -07:00
The Android Automerger
a3feda2cc1 merge in mnc-release history after reset to mnc-dev 2015-06-16 01:06:18 -07:00
Mark Salyzyn
d5600fd40f logd: missing klogd content
(cherry pick from commit ee49c6a670)

- regression in log_strtok_r (part deux) In commit
      'logd: fix kernel logline stutter'
  2c3b300fd8 we introduced log_strtok_r.
  as a replacement for strtok_r that dealt with a problem with
  some kernel log messages. Fix is to refine definition of
  is_timestamp to not match on patterns like [0], requiring
  a single period. Another fix is to refine definition of
  is_prio to properly escape non-digit content.
- Missing content because SYSLOG_ACTION_SIZE_BUFFER with added logging
  is too short for full read of SYSLOG_ACTION_READ_ALL dropping
  initial content. Add a margin for additional 1024 bytes.
- Absolute _first_ log entry has sequence number of 1, which is
  specifically dropped, start sequence count at 1 rather than 0.
- Remove trailing space for efficiency.
- If tag exists but no content, trick into kernel logging.

Bug: 21851884
Change-Id: I0867a555a3bca09bbf18d18e75e41dffffe57a23
2015-06-15 14:22:02 -07:00
The Android Automerger
add94701c7 merge in mnc-release history after reset to mnc-dev 2015-06-15 11:58:50 -07:00
Mark Salyzyn
bd1ef90448 logd: filter on __android_log_is_loggable
(cherry pick from commit e59c469fa8)

- Default level when not specified is ANDROID_LOG_VERBOSE
  which is inert.

Bug: 20416721
Bug: 19544788
Bug: 17760225
Change-Id: Icc098e53dc47ceaaeb24ec42eb6f61d6430ec2f6
2015-06-15 07:41:03 -07:00
Mark Salyzyn
e9c9106fbb liblog: __android_log_is_loggable support global properties
(cherry pick from commit c158456f50)

- Add support for "log.tag" and "persist.log.tag" global
  logging properties, effectively a runtime default minimum
  logging level.
- Add a thread-safe single level cache plus selective logic for the
  four properties being checked to help speed up logging decision
  on subsequent identical calls.
- Using new __system_property_area_serial() to make for
  efficient (<100ns) handling of cache misses. Despite adding
  two new properties, we are 8 times faster on subsequent calls
  even if the properties do not exist.
- A NULL or blank tag is no longer directed to return default,
  it will check the pair of global logging properties first.
- Add liblog.is_loggable gTest
- Fixup liblog.android_logger_get_, allow no content in crash buffer
- Fixup liblog.max_payload, lowered logd priority increases latency

Bug: 19544788
Bug: 21696721
Change-Id: Ideb887755aa3f1fd14a2603bda1fe23cba49642c
2015-06-15 07:34:07 -07:00
The Android Automerger
a0cfb99d64 merge in mnc-release history after reset to mnc-dev 2015-06-13 01:08:04 -07:00
Christopher Ferris
5c57518b6f Remove PtraceRead error message.
This error message has no meaning and makes it look like an unwinding
failure occurred. These messages are showing up more often now
that a lot more of debuggerd is using the ReadWord and Read calls.

If a higher level function wants to indicate there is an error, then
it can add a more meaningful error.

Bug: 21818730
(cherry picked from commit 35c8136d96)

Change-Id: Ie6e20fbc18702fde935f2cf8cbf1b297fda43282
2015-06-12 23:32:20 -07:00
Tim Murray
e5b0c83785 Merge "add cpuset support to libcutils" into mnc-dev 2015-06-12 18:38:36 +00:00
Spencer Low
d62bce8040 adb: win32: fix key files reading/writing
The issue is that adb uses fopen() with "e" (presumably to open the file
with O_CLOEXEC), but that flag causes MSVCRT.DLL to return an error. So
when adb_auth_host.cpp goes to read or write the adbkey files, it fails.

The quick fix is to not use the "e" option on adb host code since it
isn't necessary there, compared to adbd.

An alternative fix would be to have a fopen() wrapper on Windows that
filters out the "e" option.

Bug: http://b/21806456
Bug: https://code.google.com/p/android/issues/detail?id=175077
Change-Id: I7d8ba2847dab0ed558ffe156e79093251eb253c9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
(cherry picked from commit 9b9603148b)
2015-06-12 11:02:37 -07:00
Tim Murray
b769c8d24f add cpuset support to libcutils
bug 21782794

Change-Id: I249531754fb29442dc3c7434d77dbb103f4220a7
2015-06-11 18:35:46 -07:00
The Android Automerger
f753c984bd merge in mnc-release history after reset to mnc-dev 2015-06-11 01:03:46 -07:00
Dan Albert
8f7f0f88a3 Add missing include. Clang build fix.
Change-Id: I74bed4f27e34c6bbf904058c14e124d8f5d35d82
2015-06-10 17:34:58 -07:00
Sasha Levitskiy
350926ef2f Merge "Fingerprint: Use integral types for remove()" into mnc-dev 2015-06-10 21:35:25 +00:00
Sasha Levitskiy
53afac018d Fingerprint: Use integral types for remove()
Bug 21282699

Change-Id: I8fdb2112f3f930f080571da6a6b908f5f0581bdd
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2015-06-10 14:29:17 -07:00
Oleksiy Vyalov
a08d313bb8 Extend run-as with optional --user argument.
1. Calculate AID for spawned process as (100000 * $user) + uid_from_packages.list
2. Use /data/user/$user/$packageDir as a root of a new process if $user != 0.

Change-Id: I761dfb481114bd51e5a950307fcaf403e96eef10
(cherry picked from commit da31778f3b)
2015-06-10 12:09:10 -07:00