Commit Graph

19251 Commits

Author SHA1 Message Date
Ruchi Kandoi 42a981ddee healthd: Adds fake battery properties for devices with no battery.
Devices which have no battery and are always plugged in will not have
any battery property initialized. This causes the 'stable power' to
never be switched which is required for updating apps.

This change recognizes such a device and manually sets the battery to
100% and charger status to connected to AC mains. It will also fake the
battery temperature.

Bug: 24258855
Change-Id: I98e5ed0dbeb7f2ab6d3802cd7e0f3a269bd8f31f
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-10-12 14:31:58 -07:00
Alex Vakulenko 3da258569e am bd006200: am 5117e413: Merge "Update metrics to use weaved\'s client library"
* commit 'bd006200037bb07e6be3d87ad84a29ce59702b20':
  Update metrics to use weaved's client library
2015-10-12 20:50:57 +00:00
Alex Vakulenko bd00620003 am 5117e413: Merge "Update metrics to use weaved\'s client library"
* commit '5117e41392ca60e416585f04fca453ad51948afe':
  Update metrics to use weaved's client library
2015-10-12 20:44:40 +00:00
Alex Vakulenko 5117e41392 Merge "Update metrics to use weaved's client library" 2015-10-12 20:36:15 +00:00
Sergio Giro 0cb59c0dce system/core: fix iterator for LruCache
Was failing to return the first element

Change-Id: Ic803f5d463a56519212014d0d190407cf4b859cf
2015-10-12 16:13:44 +01:00
Steve Fung aa265b633b crash_reporter: Report the bdk_version
Add the bdk_version to the crash report.

Bug: 24579018
Change-Id: I00ad1079ee3aacc5d0456f80d83f42c4d28045df
2015-10-12 00:42:05 -07:00
Nick Kralevich 0bae55731c am 35439f31: am 545b7c9e: am 2fb90dc8: Merge changes from topic \'userspace-audit\'
* commit '35439f31af4957c929505fb4f62ff83fcf85ffec':
  debuggerd: audit pid, uid and gid on SE Linux denial
  property_service: log pid,uid and gid of setprop client
2015-10-10 20:20:59 +00:00
Nick Kralevich 35439f31af am 545b7c9e: am 2fb90dc8: Merge changes from topic \'userspace-audit\'
* commit '545b7c9e395fcbf4f9747b0a311abd909ad59cc3':
  debuggerd: audit pid, uid and gid on SE Linux denial
  property_service: log pid,uid and gid of setprop client
2015-10-10 20:18:25 +00:00
Nick Kralevich 545b7c9e39 am 2fb90dc8: Merge changes from topic \'userspace-audit\'
* commit '2fb90dc8b2b590e674c5e433e8bf3d3f08a887c8':
  debuggerd: audit pid, uid and gid on SE Linux denial
  property_service: log pid,uid and gid of setprop client
2015-10-10 20:11:08 +00:00
Nick Kralevich 2fb90dc8b2 Merge changes from topic 'userspace-audit'
* changes:
  debuggerd: audit pid, uid and gid on SE Linux denial
  property_service: log pid,uid and gid of setprop client
2015-10-10 20:07:24 +00:00
Steve Fung a5f8db39d2 am 9556c668: am 0a1af8fd: am 4b2d6dd3: Merge "crash_reporter: Use the actual GID of the crashing process"
* commit '9556c6683160d82206684b7812e2c0b3c2e4bfc1':
  crash_reporter: Use the actual GID of the crashing process
2015-10-10 05:47:42 +00:00
Nick Kralevich 09cf06fc74 am 2f63adce: am 28107143: am 9e27cab6: Merge "init.rc: Disable sysrq from the keyboard"
* commit '2f63adcea8e4e4a64d85b59044224f198016e093':
  init.rc: Disable sysrq from the keyboard
2015-10-10 05:47:41 +00:00
Alex Vakulenko c1d467c17a am 7089b88d: am fa993b2b: am a3ae129f: Merge "metricsd: Update weave command APIs"
* commit '7089b88d86303f31bf687a5c0e01f604794bb48e':
  metricsd: Update weave command APIs
2015-10-10 05:47:39 +00:00
Elliott Hughes d898725829 am b0855527: am 17ac480d: am 55793400: Merge "init shouldn\'t call DumpState by default."
* commit 'b085552783bcfb529ec1bf4137578c160a49f45e':
  init shouldn't call DumpState by default.
2015-10-10 05:47:38 +00:00
Steve Fung 9556c66831 am 0a1af8fd: am 4b2d6dd3: Merge "crash_reporter: Use the actual GID of the crashing process"
* commit '0a1af8fdbfe3fbcb77db4a44f69283ea8c4d2e64':
  crash_reporter: Use the actual GID of the crashing process
2015-10-10 05:44:30 +00:00
Nick Kralevich 2f63adcea8 am 28107143: am 9e27cab6: Merge "init.rc: Disable sysrq from the keyboard"
* commit '281071435a00e8f8d9cd91f3a12f31e7c64ac878':
  init.rc: Disable sysrq from the keyboard
2015-10-10 05:44:28 +00:00
Alex Vakulenko 7089b88d86 am fa993b2b: am a3ae129f: Merge "metricsd: Update weave command APIs"
* commit 'fa993b2b0ec0e1cdb985720d22a4dd303aa74fa8':
  metricsd: Update weave command APIs
2015-10-10 05:44:27 +00:00
Elliott Hughes b085552783 am 17ac480d: am 55793400: Merge "init shouldn\'t call DumpState by default."
* commit '17ac480df25e2416ac7ea1868dc5e54a93e53b90':
  init shouldn't call DumpState by default.
2015-10-10 05:44:26 +00:00
Steve Fung 0a1af8fdbf am 4b2d6dd3: Merge "crash_reporter: Use the actual GID of the crashing process"
* commit '4b2d6dd346a2c58cf034229afaaf91cc82901d5e':
  crash_reporter: Use the actual GID of the crashing process
2015-10-10 05:37:50 +00:00
Steve Fung 4b2d6dd346 Merge "crash_reporter: Use the actual GID of the crashing process" 2015-10-10 05:33:49 +00:00
Alex Vakulenko 82b02de5aa Update metrics to use weaved's client library
Do not use weave'd D-Bus proxies directly. Use the new client library.

Change-Id: I524d9c5c4c057bd1f82a280ec96848b8a8f4fe29
2015-10-09 20:07:47 -07:00
Nick Kralevich 281071435a am 9e27cab6: Merge "init.rc: Disable sysrq from the keyboard"
* commit '9e27cab695b0e2a4910cf576d306a3379991f1f7':
  init.rc: Disable sysrq from the keyboard
2015-10-10 00:38:18 +00:00
Nick Kralevich 9e27cab695 Merge "init.rc: Disable sysrq from the keyboard" 2015-10-10 00:33:50 +00:00
Steve Fung 773fd3c428 crash_reporter: Use the actual GID of the crashing process
Rather than assuming the UID and GID of crashing processes is
the same, report and use the actual GID that the process was
running as.

Bug: 24678424
Change-Id: I3cfc415be2feb2863a4f4b850bfd4a3267217a44
2015-10-09 17:16:48 -07:00
Nick Kralevich d28a535d9a init.rc: Disable sysrq from the keyboard
Don't allow the accidental triggering of sysrq functionality
from the keyboard. The only expected use of sysrq functionality
is via /proc/sysrq-trigger

Please see https://www.kernel.org/doc/Documentation/sysrq.txt for
additional information on /proc/sys/kernel/sysrq

Bug: 13435961
Change-Id: I60dc92a4b2b4706e8fa34a6cead9abd449f7375f
2015-10-09 17:09:10 -07:00
Alex Vakulenko fa993b2b0e am a3ae129f: Merge "metricsd: Update weave command APIs"
* commit 'a3ae129f220402a00ed241a4c6bc81fbd4d20a5f':
  metricsd: Update weave command APIs
2015-10-09 22:14:13 +00:00
Alex Vakulenko a3ae129f22 Merge "metricsd: Update weave command APIs" 2015-10-09 22:10:56 +00:00
Mark Salyzyn aaad42f47c logd: use coalesce instead of merge (cleanup)
- switch to coalesce instead of merge in naming of functions
  and variables. Confusing since we also to merge-sorts and
  other activities in the logger.
- define maxPrune rather than using a number in the code path.

Bug: 24511000
2015-10-09 15:00:44 -07:00
Elliott Hughes 17ac480df2 am 55793400: Merge "init shouldn\'t call DumpState by default."
* commit '55793400f20e5160eaab6c85e5df621f48373ec2':
  init shouldn't call DumpState by default.
2015-10-09 21:30:35 +00:00
Elliott Hughes 55793400f2 Merge "init shouldn't call DumpState by default." 2015-10-09 21:23:22 +00:00
Elliott Hughes 1946d3bca8 init shouldn't call DumpState by default.
The cost of generating and throwing away a bunch of stuff that no one
normally sees is high enough to be worth avoiding.

Here's AOSP ToT on N9...

 init: (Parsing /system/etc/init/atrace.rc took 0.0112s.)
 init: (Parsing /system/etc/init/bootanim.rc took 0.0094s.)
 init: (Parsing /system/etc/init/crash_reporter.rc took 0.0103s.)
 init: (Parsing /system/etc/init/debuggerd.rc took 0.0090s.)
 init: (Parsing /system/etc/init/debuggerd64.rc took 0.0085s.)
 init: (Parsing /system/etc/init/drmserver.rc took 0.0078s.)
 init: (Parsing /system/etc/init/dumpstate.rc took 0.0073s.)
 init: (Parsing /system/etc/init/gatekeeperd.rc took 0.0063s.)
 init: (Parsing /system/etc/init/installd.rc took 0.0067s.)
 init: (Parsing /system/etc/init/keystore.rc took 0.0060s.)
 init: (Parsing /system/etc/init/lmkd.rc took 0.0060s.)
 init: (Parsing /system/etc/init/logcatd.rc took 0.0059s.)
 init: (Parsing /system/etc/init/logd.rc took 0.0068s.)
 init: (Parsing /system/etc/init/mdnsd.rc took 0.0057s.)
 init: (Parsing /system/etc/init/mediaserver.rc took 0.0064s.)
 init: (Parsing /system/etc/init/metrics_daemon.rc took 0.0063s.)
 init: (Parsing /system/etc/init/mtpd.rc took 0.0055s.)
 init: (Parsing /system/etc/init/netd.rc took 0.0066s.)
 init: (Parsing /system/etc/init/perfprofd.rc took 0.0057s.)
 init: (Parsing /system/etc/init/racoon.rc took 0.0054s.)
 init: (Parsing /system/etc/init/rild.rc took 0.0061s.)
 init: (Parsing /system/etc/init/servicemanager.rc took 0.0063s.)
 init: (Parsing /system/etc/init/surfaceflinger.rc took 0.0061s.)
 init: (Parsing /system/etc/init/uncrypt.rc took 0.0068s.)
 init: (Parsing /system/etc/init/vdc.rc took 0.0065s.)
 init: (Parsing /system/etc/init/vold.rc took 0.0063s.)

0.0112+0.0094+0.0103+0.0090+0.0085+0.0078+0.0073+0.0063+0.0067+0.0060+
0.0060+0.0059+0.0068+0.0057+0.0064+0.0063+0.0055+0.0066+0.0057+0.0054+
0.0061+0.0063+0.0061+0.0068+0.0065+0.0063 = 0.1809

And here it is again with the logging disabled:

 init: (Parsing /system/etc/init/atrace.rc took 0.0021s.)
 init: (Parsing /system/etc/init/bootanim.rc took 0.0006s.)
 init: (Parsing /system/etc/init/crash_reporter.rc took 0.0007s.)
 init: (Parsing /system/etc/init/debuggerd.rc took 0.0004s.)
 init: (Parsing /system/etc/init/debuggerd64.rc took 0.0005s.)
 init: (Parsing /system/etc/init/drmserver.rc took 0.0005s.)
 init: (Parsing /system/etc/init/dumpstate.rc took 0.0005s.)
 init: (Parsing /system/etc/init/gatekeeperd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/installd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/keystore.rc took 0.0013s.)
 init: (Parsing /system/etc/init/lmkd.rc took 0.0006s.)
 init: (Parsing /system/etc/init/logcatd.rc took 0.0013s.)
 init: (Parsing /system/etc/init/logd.rc took 0.0007s.)
 init: (Parsing /system/etc/init/mdnsd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/mediaserver.rc took 0.0009s.)
 init: (Parsing /system/etc/init/metrics_daemon.rc took 0.0008s.)
 init: (Parsing /system/etc/init/mtpd.rc took 0.0011s.)
 init: (Parsing /system/etc/init/netd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/perfprofd.rc took 0.0005s.)
 init: (Parsing /system/etc/init/racoon.rc took 0.0005s.)
 init: (Parsing /system/etc/init/rild.rc took 0.0005s.)
 init: (Parsing /system/etc/init/servicemanager.rc took 0.0005s.)
 init: (Parsing /system/etc/init/surfaceflinger.rc took 0.0005s.)
 init: (Parsing /system/etc/init/uncrypt.rc took 0.0005s.)
 init: (Parsing /system/etc/init/vdc.rc took 0.0005s.)
 init: (Parsing /system/etc/init/vold.rc took 0.0006s.)

0.0021+0.0006+0.0007+0.0004+0.0005+0.0005+0.0005+0.0005+0.0005+0.0013+
0.0006+0.0013+0.0007+0.0005+0.0009+0.0008+0.0011+0.0005+0.0005+0.0005+
0.0005+0.0005+0.0005+0.0005+0.0005+0.0006 = 0.0181

It's less than a second, but one problem is that the cost of the current
dumping is proportional to the number of init.rc files, so the more
cleanly you factor things, the more it would cost.

Change-Id: Id96f59e7d0b082d8cfdba4bdbff43a922ba4eeee
2015-10-09 14:03:14 -07:00
Ruchi Kandoi f18ec9f227 healthd: Adds fake battery properties for devices with no battery.
Devices which have no battery and are always plugged in will not have
any battery property initialized. This causes the 'stable power' to
never be switched which is required for updating apps.

This change recognizes such a device and manually sets the battery to
100% and charger status to connected to AC mains. It will also fake the
battery temperature.

Bug: 24258855
Change-Id: I98e5ed0dbeb7f2ab6d3802cd7e0f3a269bd8f31f
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-10-09 13:18:09 -07:00
Elliott Hughes 246c18caf5 Switch fs_mgr_verity.c to C++.
This is the minimal change just to keep it building, and doesn't
attempt to clean up any of the code.

Change-Id: I975710322ae33d8946497df25bf85b2fe28976a4
2015-10-09 11:52:00 -07:00
Alex Vakulenko 35f8963825 metricsd: Update weave command APIs
Weave has changed some of D-Bus APIs and metrics needs to be updated
accrdingly. Command::Done is replaced with Complete(), Command::Abort
now takes error code and error messages, Command::category is removed
and Command::status is renamed to Command::state

Change-Id: Ifbfd6d852f4a328168e28484d1152a24b8c8b42b
2015-10-09 08:18:35 -07:00
Steve Fung e29d5ef889 am a669ad54: am 6ab739d7: am 23fe7be8: Merge "crash_reporter: Support crashes from arbitrary users"
* commit 'a669ad5441470d19113d1dc43d8dec1b08872f7f':
  crash_reporter: Support crashes from arbitrary users
2015-10-08 22:29:49 +00:00
Steve Fung a669ad5441 am 6ab739d7: am 23fe7be8: Merge "crash_reporter: Support crashes from arbitrary users"
* commit '6ab739d75dad6c3616509b7eeda30d338f4a066a':
  crash_reporter: Support crashes from arbitrary users
2015-10-08 22:25:48 +00:00
Steve Fung 6ab739d75d am 23fe7be8: Merge "crash_reporter: Support crashes from arbitrary users"
* commit '23fe7be8d6fbf8272936c2feb677d4255e8c1220':
  crash_reporter: Support crashes from arbitrary users
2015-10-08 22:17:36 +00:00
Steve Fung 23fe7be8d6 Merge "crash_reporter: Support crashes from arbitrary users" 2015-10-08 22:11:13 +00:00
Bill Yi 3f4c4b9a6b am 1b55196c: am 27bdd9a7: Merge commit \'2b88845e4d7ae862d9735eec3c03d633d4f1d58d\' into HEAD
* commit '1b55196c725e026a62f82b915f063fa6862bbc6c':
2015-10-08 21:38:21 +00:00
Bill Yi 1b55196c72 am 27bdd9a7: Merge commit \'2b88845e4d7ae862d9735eec3c03d633d4f1d58d\' into HEAD
* commit '27bdd9a71c1e1f78ebbe832d224fdc4ff856e9d1':
2015-10-08 21:33:04 +00:00
Bill Yi 27bdd9a71c Merge commit '2b88845e4d7ae862d9735eec3c03d633d4f1d58d' into HEAD 2015-10-08 10:37:51 -07:00
Mark Salyzyn d004cdea1c am ad13ffaf: am df345a8a: Merge changes Icc984f40,Ie4c46bc9,I0f238985,I63a729d2,I2b5900a2
* commit 'ad13ffaf68f00d2fb9c154b820674d4c37654d6e':
  logd: clearAll by UID speedup
  logd: clear return and deal with busy if readers locked
  logd: update region lock after entry has passed to reader socket
  logcat: do not exit buffer loop on error
  logd: clientHasLogCredentials false negatives
2015-10-08 14:36:30 +00:00
Mark Salyzyn ad13ffaf68 am df345a8a: Merge changes Icc984f40,Ie4c46bc9,I0f238985,I63a729d2,I2b5900a2
* commit 'df345a8aacdb08891b225e8543d7fb0fdd3c9821':
  logd: clearAll by UID speedup
  logd: clear return and deal with busy if readers locked
  logd: update region lock after entry has passed to reader socket
  logcat: do not exit buffer loop on error
  logd: clientHasLogCredentials false negatives
2015-10-08 14:31:47 +00:00
Mark Salyzyn df345a8aac Merge changes Icc984f40,Ie4c46bc9,I0f238985,I63a729d2,I2b5900a2
* changes:
  logd: clearAll by UID speedup
  logd: clear return and deal with busy if readers locked
  logd: update region lock after entry has passed to reader socket
  logcat: do not exit buffer loop on error
  logd: clientHasLogCredentials false negatives
2015-10-08 14:22:03 +00:00
Steve Fung 6db7cd7836 crash_reporter: Support crashes from arbitrary users
In order to read the /proc/<pid> files from non-root users without
using CAP_SYS_PTRACE and CAP_DAC_OVERRIDE, use setresuid(..) and
setresgid(..) to switch to the process's user to copy off necessary
files for generating the breakpad minidump.

Bug: 24678424
Change-Id: I4a43583033587441394483ce678c40c4161808b9
2015-10-07 18:16:53 -07:00
Nick Kralevich ba295a6343 am 2b88845e: am b3fbdf55: Merge "fs_config.c: remove setuid from procrank"
* commit '2b88845e4d7ae862d9735eec3c03d633d4f1d58d':
  fs_config.c: remove setuid from procrank
2015-10-08 00:24:06 +00:00
Nick Kralevich 2b88845e4d am b3fbdf55: Merge "fs_config.c: remove setuid from procrank"
* commit 'b3fbdf558383742484c1b43c6df94afee87f8000':
  fs_config.c: remove setuid from procrank
2015-10-08 00:19:51 +00:00
Elliott Hughes c335ea5480 am ebe9ffc4: am 21f99c08: Merge "Use const auto&/auto&& in adb."
* commit 'ebe9ffc48e8c6343510b5702cb892073b288dca7':
  Use const auto&/auto&& in adb.
2015-10-08 00:10:44 +00:00
Nick Kralevich b3fbdf5583 Merge "fs_config.c: remove setuid from procrank" 2015-10-08 00:08:58 +00:00
Elliott Hughes ebe9ffc48e am 21f99c08: Merge "Use const auto&/auto&& in adb."
* commit '21f99c089e2691f308cb5f24ca3db5eef4aa59ae':
  Use const auto&/auto&& in adb.
2015-10-08 00:04:02 +00:00