vold no longer does MS_MOVE; remove tmpfs.

MS_MOVE was used when staging external storage devices, which no
longer occurs.  In fact, having a writable tmpfs was masking a vold
bug around moving apps to SD cards.

Bug: 11175082
Change-Id: Ib2d7561c3a0b6fde94f651a496cb0c1f12f88d96
Don't return immediately from reboot commands.

The reboot commands return too fast, interfering with testing.
Add a pause(), which will allow the device time to complete the
reboot.

Change-Id: Ie9cc6eea67b7ff662ec71ea2329cbb94f8d55404
Bug: 11369303
utils: Add ProcessCallStack to collect stack traces for all threads in a process

- Also add a Printer class (print lines to logcat, fd, or strings)

Bug: 11324229
Change-Id: I78435ed49aa196a0efb45bf9b2d58b62c41737d3
utils: Fix broken build

Bug: 11324229
Change-Id: I7e4f514c5531e4c0c11bb0ba5d67e4dabbcd5792
utils: Fix broken sdk build on windows

Bug: 11324229
Change-Id: Ia50e79b5e2430faea77b0c98902e8e018fb9ceff
Removed duplicate code that had broken 'run-as'

Change-Id: Id3e5ecccdebb4a7c881c6af3e1f465e0168cc940
audio: Add APIs for supported compress formats

-Add APIs for supported compress capture & compress voip formats.
-Add default bytes per sample as 1.

Change-Id: If63a50f02389475855f2f0729b03b6049d44fb29
Added No Follow symlink option to chown and chmod

Enable symlink to not follow target file if "-h" option is
provided.

CRs-fixed: 545883
Change-Id: Iefd490bdd12cbe4cf9011f4b9b5e217493b2b503
Bluetooth: Enable system processes to set bluetooth properties

ANT and BT is part of the same wcnsss subsystem and hence libbt-vendor
is being used by both ANT and BT stack for hardware initialization.
ANT stack runs in system permission which loads libbt-vendor which in turn
needs write access to bluetooth. properties.

Change-Id: I29a9b74504f1c03b98db3cddb2a53399f4b6115b
Bluetooth: Introduce new property type and permission

Introduce new property type and allow system and bluetooth
processes to set these properties so that transport layer of
AND and BT stack can set these properties for chip initialization
part

Change-Id: I7735d4743d8b43ea935584901d5aa330df965868
CRs-fixed: 580768
system: core: increase the polling time for remount_ro

eMMC4.5 introduces an addition of cache on the device.
We experienced long flush durations in some of the devices,
and therefore the adb reboot resets the target before the flush
completes.

CRs-Fixed: 562350
Change-Id: I3f54901e12ffd232a7696dadfde1edec99ef91c6
system: core: increase the polling time for remount_ro to 3600

eMMC4.5 introduces an addition of cache on the device.
We experienced long flush durations in some of the devices,
and therefore the adb reboot resets the target before the flush
completes.
Latest tests show that increasing it to 2400 wasn't enough thus
it was increased to 3600.

Change-Id: Ifbe7af16aa1861d0d57c808b0240361c0317d5c5
CRs-fixed: 581363
chmod: Fix for recursive file mode change.

Provide correct size to string functions to ensure
file path is not truncated.

Change-Id: Ib6ed7eedf7d7010d748d8811a166c3c626725efe
CRs-Fixed: 589737
fix corruption in Vector<> when malloc falied

1. When alloc or realloc failed in the function SharedBuffer::editResize,
it would return a NULL pointer, then mStorage would update to be 1 by
SharedBuffer::data() if no pointer check here, which is an obviously
wrong address, and would cause corruption when used it e.g. in capacity().

So add the pointer check here for the return value of SharedBuffer::editResize,
if it's NULL do not use it to update mStorage, to avoid the value of mStorage
polluted.

2. when alloc or realloc falied in _grow & _shrink function, mStorage keep
the original value, so mCount should not be updated here.

Otherwise, mStorage might be 0 but mCount>0, so a corruption would happend
when it try to delete items from the Vector since mCount>0.

Change-Id: I7c3814e843c459834ca5eed392e8d63d1cb7d2d8
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 139626
adb: use bash as default shell for adb shell

Change-Id: I24e65f4592aaf23356c13db02c9869076df3b841
we want our own init.rc please!

Change-Id: I8c3b18c2a370207b93d3361a9be3b106376705de
Signed-off-by: Alexander Martinz <eviscerationls@gmail.com>
adb: Check sender's socket id when receiving packets.

handle_packet() in adb.c didn't check that when an A_WRTE packet is
received, the sender's local-id matches the socket's peer id.

This meant that a compromised adbd server could sent packets to
the host adb server, spoofing the identity of another connected
device if it could "guess" the right host socket id.

This patch gets rid of the issue by enforcing even more checks
to ensure that all packets comply with the description in
protocol.txt.

+ Fix a bug where closing a local socket associated with a
  remote one would always send an A_CLSE(0, remote-id, "")
  message, though protocol.txt says that should only happen
  for failed opens.

  The issue was that local_socket_close() called
  remote_socket_close() after clearing the remote socket's
  'peer' field.

  The fix introduces a new asocket optional callback,
  named 'shutdown' that is called before that, and is
  used to send the A_CLSE() message with the right ID
  in remote_socket_shutdown().

  Also add some code in handle_packet() to detect
  invalid close commands.

Change-Id: I9098bc8c6e81f8809334b060e5dca4fc92e6fbc9
unpackbootimg: Add support for dumping ramdisk offset

Change-Id: Ic62b9fe61db4435ecbc52b66db5ffc9b9d79cbb4
unpackbootimg: Add support for second, second_offset and tags_offset.

Change-Id: Ia7ef7f00191dbf2c44736c4e4d980f72afa8c253
adb: configure /system file permission with fs_config

adbd changes the permissions of files uploaded by copying
owner's permission to group and other. This causes kernel
load failure if any changes are made to kernel modules
followed by ``adb push'' or ``adb sync'' because file mode
644 would become 666.

The change uses fs_config to get the target mode of files.

In addition, the SELinux file label is set incorrectly
on synced files. Set the label properly.

Change-Id: I354db848f39adfbf189d7e8d3b028e8d763c772f
Signed-off-by: Liang Cheng <licheng@nvidia.com>
Bug: 12264775