Commit Graph

21906 Commits

Author SHA1 Message Date
Dimitry Ivanov 5539db0b4f Enable namespaces for all target sdk versions
We previously relied on the fact that target sdk version 0
implies system_server, which is not true, target sdk version
may be set to 0 for other apps and it means 1 - the earliest
version of android. This change enables namespaces for
apps targeting all sdk version and for system_server.

Bug: http://b/27702070
Change-Id: I16fbdeb6868c7035aec71132c80c150c08ea2cc3
(cherry picked from commit 213676b880)
2016-04-27 11:44:42 -07:00
Yabin Cui d7f60557b0 Merge "adb: fix adb usb operations on device." into nyc-dev
am: f92838c

* commit 'f92838ca1d5e315943022b7225a6c97c6c1283f4':
  adb: fix adb usb operations on device.

Change-Id: I9db3169f3e8af6db6e28dc9186ba21831179f7ae
2016-04-27 03:43:10 +00:00
Yabin Cui f92838ca1d Merge "adb: fix adb usb operations on device." into nyc-dev 2016-04-27 03:05:40 +00:00
Yabin Cui 54d50bee55 Merge "adb: use a custom thread to poll for usb devices on mac." into nyc-dev
am: f7c31b9

* commit 'f7c31b9552da778ebea5ac3c2bd3c5260b5e7705':
  adb: use a custom thread to poll for usb devices on mac.

Change-Id: I73c0321758f027e7dec32980e37a22dde6662f3a
2016-04-27 00:51:22 +00:00
Yabin Cui 9b53e4c42c adb: fix adb usb operations on device.
Problem: For devices using /dev/usb-ffs/adb, Run
`while true; do adb reconnect device; sleep 1; done`. And the
device soon becomes offline. The adbd log shows that calling
adb_read(h->bulk_out) in usb_ffs_read() gets EOVERFLOW error.

Reason: When kicking a transport using usb-ffs, /dev/usb-ffs/adb/ep0
is not closed, and the device will not notify a usb connection reset
to host. So the host will continue to send unfinished packets even
if a new transport is started on device. The unfinished packets may
not have the same size as what is expected on device, so adbd on
device gets EOVERFLOW error. At the worst case, adbd has to create new
transports for each unfinished packet.

Fixes:
The direct fix is to make the usb connection reset when kicking transports,
as in https://android-review.googlesource.com/#/c/211267/1. And I think
we can make following improvements beside that.
1. Close a file that is used in other threads isn't safe. Because the file
descriptor may be reused to open other files, and other threads may operate
on the wrong file. So use dup2(dummy_fd) to replace close() in kick function,
and really close the file descriptor after the read/write threads exit.

2. Open new usb connection after usb_close() instead of after
usb_kick(). After usb_kick(), the transport may still exist and
reader/writer for the transport may be still running. But after
usb_close(), the previous transport is guaranteed to be destroyed.

Bug: 25935458
Change-Id: I1eff99662d1bf1cba66af7e7142f4c0c4d82c01b
(cherry picked from commit 005bf1e05b)
2016-04-26 17:43:14 -07:00
Yabin Cui f7c31b9552 Merge "adb: use a custom thread to poll for usb devices on mac." into nyc-dev 2016-04-27 00:38:58 +00:00
Yabin Cui 71bddf842d adb: use a custom thread to poll for usb devices on mac.
On mac, if the adb server kicks a transport on some error, mac usb driver
will not report a new usb device. So instead of relying on mac usb driver
to report new usb devices, this CL uses a loop to search for usb devices
not exist before. Note that this is also the behavior on windows and linux
host.
`adb reconnect` can be used to verity this CL.

Bug: 25935458
Change-Id: I890e0eb1fae173f2e7a0c962ededa294d821e015
(cherry picked from commit 48d4c0c42a)
2016-04-26 17:00:49 -07:00
Yabin Cui 4d7a96cf10 Merge "Fix kick_transport test." into nyc-dev
am: 550ad20d

* commit '550ad20d64e3a4cc508fac172c62f16b0d201acd':
  Fix kick_transport test.

Change-Id: I178d5aa37fb77906b5487df2a7aa80cb01ee9f90
2016-04-26 23:29:14 +00:00
Yabin Cui 550ad20d64 Merge "Fix kick_transport test." into nyc-dev 2016-04-26 23:18:20 +00:00
Daniel Rosenberg 0013ab2639 Add support for FUSE_CANONICAL_PATH
am: 2abee9e

* commit '2abee9e063d1549fb006853b27f378c7d22192af':
  Add support for FUSE_CANONICAL_PATH

Change-Id: I9268c06c43debd48b10342020f994ac0a989bdd7
2016-04-26 23:01:59 +00:00
Daniel Rosenberg 2abee9e063 Add support for FUSE_CANONICAL_PATH
This allows inotify requests on FUSE to be alerted when any
other stacked filesystem would trigger an inotify for the
same file.

Bug: 23904372
Change-Id: I4289b38230c314432eaf2c0d20d4ccefc058f59e
2016-04-25 20:42:57 -07:00
Yabin Cui a28918cf30 Fix kick_transport test.
Fix broken kick_transport test, and make it not access atransport
internal variables.

Bug: 25935458
Change-Id: I91b4d32a222b2f369f801bbe3903acac9c8ea4f7
(cherry picked from commit 7f27490e7f)
2016-04-25 17:37:08 -07:00
Alex Light 650d283536 Merge "Remove workaround for libart greylist." into nyc-dev
am: 595efd0

* commit '595efd04db3970180d2a2de97524ac5e9a421a25':
  Remove workaround for libart greylist.

Change-Id: I34f2ea67d7fc9823fdacbf8e116a0110a053acf3
2016-04-25 22:18:48 +00:00
TreeHugger Robot 595efd04db Merge "Remove workaround for libart greylist." into nyc-dev 2016-04-25 21:53:31 +00:00
Srinath Sridharan 7ac34d08ef marlin/eas: Fixing foreground/schedtune.boost path.
BUG: 28378389
Change-Id: I613fd5622d3d27deafe6054bbf2a4799d97f9170
2016-04-25 13:09:05 -07:00
Martijn Coenen 91bd529418 Merge "Move gatekeeperd to system-background cpuset." into nyc-dev
am: 0e54903

* commit '0e54903c737aa71590d222828cd31944bd2be4cb':
  Move gatekeeperd to system-background cpuset.

Change-Id: I2af7286befadbe848628440ed1548abc183a18c1
2016-04-25 18:03:20 +00:00
Martijn Coenen 0e54903c73 Merge "Move gatekeeperd to system-background cpuset." into nyc-dev 2016-04-25 17:46:01 +00:00
Christopher Ferris 420734b83c Connect to activity manager as root.
am: 0fc89f3

* commit '0fc89f34b99f20f0ebc0111df74490f4ebd44076':
  Connect to activity manager as root.

Change-Id: If3bbef7e2770483612e85fb4eccc6aedb10843a3
2016-04-20 21:46:30 +00:00
Christopher Ferris 0fc89f34b9 Connect to activity manager as root.
Before dropping root privileges, connect to the activity manager.
Also, only connect to the activity manager if this is a crash.

Bug: 28210681
Change-Id: Ie266031910519fa2aa6835644a95c1fc56e24d8d
2016-04-20 11:30:33 -07:00
Elliott Hughes 008efb756f Fix scanf %s in lsof.
Bug: http://b/28175237
Change-Id: Ief0ba299b09693ad9afc0e3d17a8f664c2fbb8c2
2016-04-19 14:57:09 -07:00
Mark Salyzyn 5f3beff453 Merge "liblog: android_log_isloggable failing apct" into nyc-dev
am: ded0f36

* commit 'ded0f36822864506ca950466fb1de37de78ab51b':
  liblog: android_log_isloggable failing apct

Change-Id: Ieb5b2fc073444ffb675cbbe203866823e75046cb
2016-04-19 17:22:05 +00:00
TreeHugger Robot ded0f36822 Merge "liblog: android_log_isloggable failing apct" into nyc-dev 2016-04-19 17:05:37 +00:00
Paul Lawrence ec2cdb8ad5 Merge "Don\'t start defaultcrypto twice" into nyc-dev
am: fe5d55a

* commit 'fe5d55a68b9dc3a593d3f6ee5be919b8a9de710c':
  Don't start defaultcrypto twice

Change-Id: I78cd54ecf5a21eb9ee42f977664c32f7b6505bee
2016-04-19 14:46:48 +00:00
Paul Lawrence fe5d55a68b Merge "Don't start defaultcrypto twice" into nyc-dev 2016-04-19 14:44:26 +00:00
Mark Salyzyn 504daa654e liblog: android_log_isloggable failing apct
(cherry pick from commit efe8ecc1d9)

- periodic failures in apct, dropped second serial test
  in refresh_cache, trusting check_cache or global.
- The retry loop to see if is_loggable recovers of 1000
  was hiding subsequent tests, drop to 10 retries.
- On the whole, the average performance remains the same.

Bug: 25792367
Change-Id: I4110440ef46671d7a1c128689bde623808bed04f
2016-04-19 07:23:17 -07:00
Josh Gao fad1cd0edd Merge changes Ia4a2ff77,I970806e3,I47daa338 into nyc-dev
am: a9e818f463

* commit 'a9e818f4632eca67a5ffd1fb680d15550591ecd9':
  adb: increase the FD table size on Win32.
  adb: bump the server version to 36.
  adb: add reconnect command.

Change-Id: Ice1518eba0fdd0430ce191ca2afc6bc553ebe4b8
2016-04-19 00:55:58 +00:00
TreeHugger Robot a9e818f463 Merge changes Ia4a2ff77,I970806e3,I47daa338 into nyc-dev
* changes:
  adb: increase the FD table size on Win32.
  adb: bump the server version to 36.
  adb: add reconnect command.
2016-04-19 00:51:22 +00:00
Josh Gao d1e2300a71 adb: increase the FD table size on Win32.
128 maximum FDs is a pretty low limit, which can easily be exhausted by
port forwarding. Bump the maximum up to 2048, and add a test that checks
whether we can actually use a few hundred sockets.

Bug: https://code.google.com/p/android/issues/detail?id=12141
Bug: http://b/28246942
Change-Id: Ia4a2ff776e8e58ec13378756f19d80392679ece9
(cherry picked from commit b31e17107c)
2016-04-18 15:46:25 -07:00
Josh Gao 988e9bc1f8 adb: bump the server version to 36.
The recent `adb root` changes are incompatible with older versions of
the server. Bump the version number to force the server to restart.

Bug: http://b/28194507
Change-Id: I970806e3b68c1f8e3273a4b1f0ecc4aca5086be9
(cherry picked from commit 057095d207)
2016-04-18 15:46:25 -07:00
Yabin Cui 03468c8c50 adb: add reconnect command.
Add reconnect command for debugging. `reconnect` kicks a transport
from the host side, `reconnect device` kicks a transport from
the device side. They can be used to produce transport errors.

Bug: 25935458

Change-Id: I47daa338796b561941e7aba44a51a6dd117d1e98
(cherry picked from commit 1f4ec19e49)
2016-04-18 15:46:25 -07:00
Paul Lawrence 1f99218612 Don't start defaultcrypto twice
The old way (using triggers) starts defaultcrypto twice because
queue_property_triggers_action retriggers the action.

Bug: 27452459
Change-Id: I48c844836f551673d0dbfed6c33bd8ee1e035f40
2016-04-18 15:37:31 -07:00
Jeff Sharkey 2a9974a968 Merge "Create legacy /data/system/user directory." into nyc-dev
am: e4f870a

* commit 'e4f870a0bb260f351208b9fe3cf7334e58c16a14':
  Create legacy /data/system/user directory.

Change-Id: Idd0b668f5e88afc928b74d9d45110a932dd0713d
2016-04-18 19:59:34 +00:00
Jeff Sharkey e4f870a0bb Merge "Create legacy /data/system/user directory." into nyc-dev 2016-04-18 19:43:18 +00:00
Alex Light 3150fa2514 Remove workaround for libart greylist.
Bug: 27775991

Change-Id: I77f03b95f70957df58e666b011a07cfc2a33b480
2016-04-15 12:42:44 -07:00
Jeff Sharkey c9b84a362a Create legacy /data/system/user directory.
We create per-user directories under this location, so it should
only be created once by init, similar to all the other user-specific
directories.

Bug: 27896918
Change-Id: I9ec55e4fd763c0eda6c6e50483694a6377344586
2016-04-15 13:42:29 -06:00
Mark Salyzyn 3c535de75e logcat: apct test failures
(cherry pick from 3842b1a5f6)

Change-Id: I100a5071c059fe9fa85bbdc33db552b16d7bdf60
2016-04-15 16:38:42 +00:00
Martijn Coenen 0fd19760a1 Move gatekeeperd to system-background cpuset.
Bug: 24949295
Change-Id: I3c68bf1c604f0e8eb8155a4615802847a9a8604d
2016-04-15 14:29:40 +02:00
Yabin Cui 578bc039dc libbacktrace: only build libbacktrace_offline static library.
As device may not have libbacktrace_offline shared library, simpleperf
no longer rely on it. So there is no reason to keep libbacktrace_offline
shared library.

Bug: 28152982
Change-Id: If8e31b1434646dbbfed60264eb25f034bc5d6946
(cherry picked from commit 51e607056d)
2016-04-14 14:37:37 -07:00
Daniel Rosenberg f80d64f9d1 Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087 am: ad431d2 am: 20bf84e am: 0b35da7 am: 945228b am: aa7db31 am: cebac70 am: 5e7d964
am: 251e360

* commit '251e3609a485950de59d3aef08959f24a81f9e65':
  Fix overflow in path building

Change-Id: Icd03d8477acf5cd30fd034ed50deba6f1ee7a361
2016-04-14 20:01:24 +00:00
Daniel Rosenberg 251e3609a4 Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087 am: ad431d2 am: 20bf84e am: 0b35da7 am: 945228b am: aa7db31 am: cebac70
am: 5e7d964

* commit '5e7d964871fe7217bc9042adc181232a4e3c1f38':
  Fix overflow in path building

Change-Id: I2318464de6db3c058022f042c57840124f72a5e8
2016-04-14 19:58:14 +00:00
Daniel Rosenberg 5e7d964871 Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087 am: ad431d2 am: 20bf84e am: 0b35da7 am: 945228b am: aa7db31
am: cebac70

* commit 'cebac700aa133744b2b0b586d71d38d7de64f45a':
  Fix overflow in path building

Change-Id: I4d15a213045eb9293638ed1bafcb3137c7994fce
2016-04-14 19:54:47 +00:00
Daniel Rosenberg cebac700aa Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087 am: ad431d2 am: 20bf84e am: 0b35da7 am: 945228b
am: aa7db31

* commit 'aa7db31fbd39d90e387b71c41e87a0d37b98882c':
  Fix overflow in path building

Change-Id: Id971b55ed73ad4f6b7160f4e9c014e5007d92262
2016-04-14 19:51:41 +00:00
Daniel Rosenberg aa7db31fbd Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087 am: ad431d2 am: 20bf84e am: 0b35da7
am: 945228b

* commit '945228bdde777ad3aa814d480d37513db24699fb':
  Fix overflow in path building

Change-Id: I6bf39ad97ffeaf70c347fad4166ba239f93f5449
2016-04-14 19:48:22 +00:00
Daniel Rosenberg 945228bdde Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087 am: ad431d2 am: 20bf84e
am: 0b35da7

* commit '0b35da7165e9b78a5e35200bac3df4b2c6bc7c36':
  Fix overflow in path building

Change-Id: I07a7bb64ae3174fb8f36cfa1d3651473e5b2f6bf
2016-04-14 19:44:46 +00:00
Daniel Rosenberg 0b35da7165 Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087 am: ad431d2
am: 20bf84e

* commit '20bf84eca094e813fa445b60d22bcf0c27148cd4':
  Fix overflow in path building

Change-Id: Ia4639f0a0dbcb848a6d9c59319c12cd9bd952c8f
2016-04-14 19:41:32 +00:00
Daniel Rosenberg 20bf84eca0 Fix overflow in path building am: 6ea6c04 am: 9c44027 am: 4830087
am: ad431d2

* commit 'ad431d2e2e15cc47b78fa62e4ab362bfdaa77070':
  Fix overflow in path building

Change-Id: Ifa2970afd2862bef780904f2b91a307c16f7a7b8
2016-04-14 19:37:48 +00:00
Daniel Rosenberg ad431d2e2e Fix overflow in path building am: 6ea6c04 am: 9c44027
am: 4830087

* commit '4830087b3755b4c3498880369ccbe918aa136cd0':
  Fix overflow in path building

Change-Id: Ie2044be5b1c31b1fe128c90eda1c5df169dc0a3d
2016-04-14 19:34:33 +00:00
Daniel Rosenberg 4830087b37 Fix overflow in path building am: 6ea6c04
am: 9c44027

* commit '9c440272192d600c72659da5bfbe0c2e0a133cfe':
  Fix overflow in path building

Change-Id: Idb39dfc88adb854ffbc3bd40be0d28409248fc85
2016-04-14 19:31:17 +00:00
Daniel Rosenberg 9c44027219 Fix overflow in path building
am: 6ea6c04

* commit '6ea6c04ca695e0f0b6bcf3ea4529b9fd74fee8e4':
  Fix overflow in path building

Change-Id: Ia4388b694ddb12083e0d5a67a3a5f3f5bba2fb12
2016-04-14 19:27:58 +00:00
Josh Gao 9ea7795d38 adb: after `adb root`, wait for the device in any state.
Otherwise, `adb root` while the device is in recovery will hang.

Bug: http://b/28168212
Change-Id: Ibc8038b1745139fb505e466c74c605b9df474c8c
(cherry picked from commit 48a348183f)
2016-04-13 13:13:20 -07:00