Commit graph

21372 commits

Author SHA1 Message Date
Yabin Cui
b0580d710f healthd: support reading charge status from BatteryMonitor.
recovery needs to know whether the battery is charged.

Bug: 26879394
Change-Id: Ie2a1d06e81878efa3ff432c2015d409a625e473e
(cherry picked from commit aedf6038dc)
2016-02-23 11:01:21 -08:00
Yabin Cui
126f4d65ca Merge "healthd: separate libbatterymonitor for use in recovery." into nyc-dev 2016-02-23 18:55:54 +00:00
James Hawkins
85def183bd Merge "bootstat: Record metrics for factory_reset and time_since_factory_reset." into nyc-dev 2016-02-23 18:52:55 +00:00
Yabin Cui
f6dbc6d4b8 healthd: separate libbatterymonitor for use in recovery.
Bug: 26879394

Change-Id: I97b5b4994c42988ce43f5085b8b4b25e9e80c9fa
(cherry picked from commit e98e177a34)
2016-02-23 10:52:43 -08:00
Yabin Cui
ac3387b71b healthd: init members of BatteryMonitor.
Bug: 26879394
Change-Id: I09a6c78137f91a0c88bf4ba1e8890b4ec31dcf2c
(cherry picked from commit db04a49a6f)
2016-02-23 10:46:38 -08:00
Mark Salyzyn
9dd6510dd0 liblog: event log list logging handler
(cherry pick from commit bd1ad049b2)

Based off an initial request and effort by williamluh@google.com

- Added the following functions:

* Composing and Writing:

android_log_context create_android_logger(uint32_t tag)

int android_log_write_list_begin(android_log_context ctx)
int android_log_write_list_end(android_log_context ctx)

int android_log_write_int32(android_log_context ctx, int32_t value)
int android_log_write_int64(android_log_context ctx, int64_t value)
int android_log_write_string8(android_log_context ctx, const char *value)
int android_log_write_float32(android_log_context ctx, float value)

int android_log_write_list(android_log_context ctx, log_id_t id)

* Reading and Interpreting:

android_log_context create_android_log_parser(const char *msg, size_t len)

android_log_list_element android_log_read_next(android_log_context ctx)
android_log_list_element android_log_peek_next(android_log_context ctx)

* Destroy context used above:

int android_log_destroy(android_log_context *ctx);

- Added unit gTests

We moved implemented android_log_buffer_to_string() to the test since
it is an alternate for already existing logprint functionality.
Please move into liblog should it be of some common use, otherwise
as is it is a good means of stessing the reading and interpreting
handlers.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 19235719
Change-Id: I4aa1927e8e6a75f0a129d15a27c891cf1ccd4f5c
2016-02-23 07:45:49 -08:00
Mark Salyzyn
ac460fc6de Merge "liblog: deal with warning messages" into nyc-dev 2016-02-22 23:47:07 +00:00
Mark Salyzyn
b7a0166b00 liblog: deal with warning messages
(cherry pick from commit b525884edb)

- Fix bug in fake_log_devices when it can not allocate memory
  failing to use the full on-stack buffer as backup.
- remove superfluous code.

Bug: 27265662
Change-Id: I97b6cca5f4ce8ecad9beb3a08353de596d6a4ad1
2016-02-22 15:46:22 -08:00
Sami Tolvanen
0bdad0f231 logd: enforce policy integrity
If a SELinux policy change or a switch to permissive mode is detected
on a user build, restart the device into safe mode, and keep it there
until an OTA is applied or user data is wiped.

This change deprecates the ro.logd.auditd property.

Needs matching changes from
  I781c3059ea8d4fb2f0c923e4488b1932d69678d3
  Ica825cf2af74f5624cf4091544bd24bb5482dbe7
  Id3ca7889ede30b54b7af73dd50653ca1a20d59aa

Bug: 26902605
Change-Id: Idcdc5bff133f13c1267f0ec0a75cc8cf1ddbda0d
(cherry picked from commit d122ee65b6)
2016-02-22 14:00:43 -08:00
James Hawkins
35349148e1 bootstat: Record metrics for factory_reset and time_since_factory_reset.
Bug: 25448351
Change-Id: I9b3a557317bc256a078f76e2b65d16bc071e4a6a
(cherry picked from commit 500d71566a)
2016-02-22 13:30:11 -08:00
Calin Juravle
aed972dead Merge "Create profiles folders" into nyc-dev 2016-02-22 11:42:02 +00:00
Pablo Ceballos
f411123ea0 Merge "Add the setAutoRefresh interface in ANativeWindow" into nyc-dev 2016-02-20 18:22:29 +00:00
Jeff Sharkey
a9061ece05 Merge "Temporary fix for bugreport symlink." into nyc-dev 2016-02-19 22:52:47 +00:00
Jeff Sharkey
002aecf6e8 Temporary fix for bugreport symlink.
Bug: 27262109
Change-Id: I011da38f8ad1eeaf717dc03a0fb6f9fdc5654c4c
2016-02-19 15:51:42 -07:00
Mohamad Ayyash
527cc0b7a4 Revert "Update make_ext4fs_internal param-list to match new implementation"
This reverts commit 6d94dfee45.

Change-Id: Iec0832740e321e31a78a31d5358542d2ed4455fa
2016-02-19 21:16:38 +00:00
Mohamad Ayyash
6d94dfee45 Update make_ext4fs_internal param-list to match new implementation
BUG: 26839493
Change-Id: I4cd316ebc91457e2ec31c0e8b116798d9f94a223
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-02-19 18:34:59 +00:00
Calin Juravle
807f23aff2 Create profiles folders
Current profiles (the ones which have not been used for
compilation) are stored in /data/misc/profiles/cur/0/pkgname/.

Reference profiles (the merged of all user profiles, used for
compilation) are stored in /data/misc/profiles/ref/pkgname/.

Add a method to get the shared app gid from an uid or appid.

Bug: 26719109
Bug: 26563023
Change-Id: I89601d7dbeb3041df882c141a9127dac200a645e
2016-02-19 13:42:37 +00:00
Dimitry Ivanov
dab56737ca Limit libart.so visibility to apps targeting <= M
Add libart.so to the list of public libraries only for
apps targeting android M and below.

Bug: http://b/27210062
Bug: http://b/26436837
Change-Id: I1ed3b0335a343044a76273741ea8770dcce12ebe
2016-02-17 17:22:20 -08:00
David Pursell
7bbb4a0c49 Merge changes Ib17f0a55,Ia5bbae6b,I339d42fc into nyc-dev
* changes:
  fastboot: fix TCP protocol version check.
  fastboot: add UDP protocol.
  fastboot: add Socket timeout detection.
2016-02-17 22:02:19 +00:00
David Pursell
022d8f5885 fastboot: fix TCP protocol version check.
Currently the TCP handshake fails if the device TCP protocol version
doesn't match the host exactly, but the protocol is supposed to allow
for forwards compatibility by accepting any protocol version >= itself.
That way the other side can potentially lower its protocol to match and
keep going.

This CL fixes the protocol version check and adds corresponding unit
tests.

Bug: http://b/27220700

(cherry picked from commit aad72a533f)

Change-Id: Ib17f0a55eb910105a27609bc94bf76a30442e92e
2016-02-17 13:22:40 -08:00
David Pursell
5a0ec81e97 fastboot: add UDP protocol.
Implements a UDP protocol for fastboot, documented in
fastboot_protocol.txt.

This version of the protocol does not include multi-packet windowing,
which will likely be needed to achieve reasonable speeds over WiFi.
Since we don't have any WiFi use cases yet, we'd like to get this in
now and update the protocol later if it becomes necessary.

Usage:
  fastboot -s udp:<hostname>[:port] <command>

Bug: http://b/26154914

(cherry picked from commit 4601c978ca)

Change-Id: Ia5bbae6bcd6405671f594d7120b3994746d234d3
2016-02-17 13:22:30 -08:00
David Pursell
8bcce68f10 fastboot: add Socket timeout detection.
UDP fastboot will require re-transmission in the case of datagrams
getting lost. This CL adds Socket functionality to easily distinguish
between a normal timeout and a socket failure.

I also found some Windows docs that indicate sockets may become
invalid after a call to recv() times out. This has never occurred in
my testing, but to be safe this switches the timeout implementation
to use select() instead of SO_RCVTIMEO.

Bug: http://b/26154914

(cherry picked from commit c742a7f174)

Change-Id: I339d42fc40d853ee48d1b457d06b67faf5799d91
2016-02-17 13:22:17 -08:00
Mohamad Ayyash
14ae3f2b50 Add CASIO to approved vendor IDs am: 6c48349dee
am: 1dec743e01  -s ours

* commit '1dec743e01498fc8e6cd01cf71d12aa2b1431018':
  Add CASIO to approved vendor IDs
2016-02-17 17:34:55 +00:00
Mohamad Ayyash
1dec743e01 Add CASIO to approved vendor IDs
am: 6c48349dee

* commit '6c48349deec6d7b6e654067416790fe16c69c28e':
  Add CASIO to approved vendor IDs
2016-02-17 07:01:15 +00:00
Mohamad Ayyash
6c48349dee Add CASIO to approved vendor IDs
BUG: 27021418
Change-Id: I083447d3555891db4fced2171a0a747882c4435a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-02-16 20:14:01 -08:00
Lorenzo Colitti
8bb06b6493 Merge "Tolerate RTM_DELADDR messages from deleted interfaces." into nyc-dev 2016-02-17 03:06:57 +00:00
James Hawkins
def841933f Merge "bootstat: Add a few more bootreasons and rebase the index against index 1." into nyc-dev 2016-02-17 00:01:48 +00:00
Lorenzo Colitti
ef6454d3d3 Tolerate RTM_DELADDR messages from deleted interfaces.
When an interface is deleted (which can happen, for example, to
the tun interfaces used for VPN and 464xlat), the kernel sends
RTM_DELADDR messages for all its IP addresses.

Currently we ignore these because we cannot fetch the interface
name. Instead, pass them up with an empty interface name so that
NetlinkHandler can do something useful for them, such as destroy
connections on the IP addresses that are being deleted.

Bug: 26976388
Change-Id: I2ced7e389228f9d665d0a87d97bd3452c8c0c98b
2016-02-16 23:12:26 +09:00
Jeff Sharkey
7916cc9e40 Re-derive permissions after package changes. am: a44febd19b am: 36a6835aa5
am: 77a3c8fccd

* commit '77a3c8fccd17d0091776aeac38bda86e43d67979':
  Re-derive permissions after package changes.
2016-02-14 22:50:44 +00:00
Jeff Sharkey
77a3c8fccd Re-derive permissions after package changes. am: a44febd19b
am: 36a6835aa5

* commit '36a6835aa5c40c5a83400c2fb162bd6fd5c5f878':
  Re-derive permissions after package changes.
2016-02-14 22:39:02 +00:00
Jeff Sharkey
36a6835aa5 Re-derive permissions after package changes.
am: a44febd19b

* commit 'a44febd19b4efd17fe31d75c964ec47f85832a2a':
  Re-derive permissions after package changes.
2016-02-14 22:28:35 +00:00
James Hawkins
ee79e73373 bootstat: Add a few more bootreasons and rebase the index against index 1.
This is necessary to match the mapping in the internal infrastructure.

Bug: 21724738
Change-Id: I292166ff5c0dea7f3d771627120f16af4c56073b
(cherry picked from commit 6f74c0b843)
2016-02-13 14:02:25 -08:00
Jeff Sharkey
a44febd19b 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 f7aad11c1c)
2016-02-12 20:37:05 +00:00
James Hawkins
5022909765 Merge "bootstat: Add support for logging the boot_reason metric." into nyc-dev 2016-02-11 19:14:28 +00:00
James Hawkins
10f54be6d0 bootstat: Add support for logging the boot_reason metric.
This value is read from the ro.boot.bootreason system property.

Bug: 21724738
Change-Id: I43bef3d85ba9c8d87669a91da1aa675d9a86e348
(cherry picked from commit a4a1a4ac85)
2016-02-11 10:37:33 -08:00
Dimitry Ivanov
d68c8e9f84 Preload public native libraries
Preload libraries needed by the public namespace
at the earlier stage. This saves time on
InitPublicNamespace and saves memory because
the libraries are linked before zygote fork.

Bug: http://b/26409579
Change-Id: I59153a4180b930f31b542d8d2cb17b5d63c36774
2016-02-11 10:22:38 -08:00
Pablo Ceballos
3daa57490e Add the setAutoRefresh interface in ANativeWindow
Bug 24940410

Change-Id: I6c0d149c63236f169897c64b21563630fb034338
2016-02-09 17:17:21 -08:00
Lajos Molnar
9136922045 Expand HAL_DATASPACE to include range, standard and transfer bitfields
Bug: 25975353
Change-Id: Id2668508b523130e5fa3496440d9423682b31632
2016-02-10 00:21:37 +00:00
Paul Crowley
c31f1f3f6e Check for breadcrumbs only where relevant
Don't look for breadcrumb files like convert_fde unless the fstab
flags indicate we actually care whether they are present or absent.

Bug: 26989796
Change-Id: I3cde9896b22fc6f5a4b63dc3f97ac4e3588b5568
2016-02-09 21:05:01 +00:00
Elliott Hughes
b71e897003 Fix generation of event labels for getevent.
The recent uapi header update moved all the interesting constants
out into another file. Track that, and add the missing makefile
dependency.

Bug: http://b/27073568

(cherry picked from commit bd02a47b22)

Change-Id: I9323a995511b12905949cba22c59cc28623068f3
2016-02-09 11:24:42 -08:00
Martijn Coenen
5badce35f0 Merge "lmkd: subscribe to low mempressure events." into nyc-dev 2016-02-09 10:27:48 +00:00
Martijn Coenen
9010a2398e lmkd: subscribe to low mempressure events.
This will make sure we get invoked in time,
and combined with a kernel change to increase
the window size (and thus rate-limit the
notifications) based on the amount of memory
on the device, this should provide a nice
balance between receiving too many notifications
vs getting notified too late.

Change-Id: I2f5e92390b94e582aaa06d88763a232e39673496
2016-02-09 11:25:18 +01:00
Martijn Coenen
623b56af5d Fix libprocessgroup SELinux denials.
libprocessgroup checks whether it can use memory
cgroups for keeping track of forked processes by
seeing whether /dev/memcg/apps is writable. However,
on systems with memory cgroups disabled, SELinux
(correctly) no longer classifies this directory as a cgroup,
and starts denying zygote access. To fix this,
first check whether /dev/memcg/apps/tasks exists to
see if the cgroup is mounted; only then check whether
we can write to the directory.

Bug: 27046965
Change-Id: I6e44cd62d8c396e20ceb162c50606b3e86f2cb3e
2016-02-08 11:45:27 +01:00
Jeff Sharkey
23419e3926 Merge "Follow migration of Shell app to DE storage." 2016-02-07 03:57:31 +00:00
Jeff Sharkey
c457610e78 Follow migration of Shell app to DE storage.
The Shell app that stores bugreports now lives under DE storage for
all devices, both FBE and non-FBE.

Bug: 26668510
Change-Id: Iead1dcb98181a5caccf4d0c1e86de62abc6dc990
2016-02-06 20:15:24 -07:00
Christopher Ferris
b3625f50b2 Merge "Fix use of uninitialized memory." am: 45c8586dad
am: 50443ed1ad

* commit '50443ed1ad7a0765030eefb557f9252a46e274db':
  Fix use of uninitialized memory.
2016-02-06 03:51:50 +00:00
Christopher Ferris
50443ed1ad Merge "Fix use of uninitialized memory."
am: 45c8586dad

* commit '45c8586dad4796fa227b60745ba2d0dbae44b062':
  Fix use of uninitialized memory.
2016-02-06 03:49:36 +00:00
Christopher Ferris
45c8586dad Merge "Fix use of uninitialized memory." 2016-02-06 03:46:28 +00:00
Christopher Ferris
d4c884330c Fix use of uninitialized memory.
When creating an UnwindMapLocal fails in the Build() function call,
the destructor for UnwindMap is called. Unfortunately, the map_cursor_
member variable has not been initialized, so the call to destroy it
winds up operating on garbage data.

Part of this is a result of a bad class hierarchy, so this refactors
the classes slightly, and properly initializes the map_cursor_ member
variable in the base class.

Bug: 26931578
Change-Id: I885596bf65e4ef63559cee2c56cd41576d5ecc1b
2016-02-05 15:22:34 -08:00
Jeff Sharkey
c895f11cf1 Merge "User 0 directories are created by vold now." 2016-02-05 21:01:21 +00:00