199355 Commits

Author SHA1 Message Date
Tadashi G. Takaoka
57454cf15e DO NOT MERGE: Catch all exceptions when parsing IME meta data
am: f71d2cddf1

Change-Id: Iaa5041d4b5fc61860f7ce95ecce60d39bbd5023b
2016-09-18 12:03:59 +00:00
Tadashi G. Takaoka
cd8595cdcf DO NOT MERGE: Catch all exceptions when parsing IME meta data
am: 43f4980e77

Change-Id: Ibbf09fdbcaf00fd41d832e3e2597978e2a0863a9
2016-09-18 12:03:58 +00:00
Tadashi G. Takaoka
3a4431bbb9 Merge "DO NOT MERGE: Catch all exceptions when parsing IME meta data" into mnc-dev 2016-09-18 11:56:25 +00:00
Tadashi G. Takaoka
8fa8da727b Merge "DO NOT MERGE: Catch all exceptions when parsing IME meta data" into lmp-mr1-dev 2016-09-18 11:55:57 +00:00
Tadashi G. Takaoka
5fa097311c Merge "DO NOT MERGE: Catch all exceptions when parsing IME meta data" into lmp-dev 2016-09-18 11:55:34 +00:00
Jeff Sharkey
df42d732f8 Merge commit '0a9d537f623b2c11dce707fb9b91fea016fd0e9f' into manual_merge_0a9d537
Change-Id: Ib1a0bbb34edb61666ac5739f0b0eaadbe4c5fe06
2016-09-16 16:57:55 -06:00
Jeff Sharkey
0a9d537f62 Use "all_downloads" instead of "my_downloads". am: 1547194418 am: f6d7c1ed15
am: 6db572cf00

Change-Id: I687a883d528cc260aad3ee3da5600d3e0542c940
2016-09-16 22:07:27 +00:00
Jeff Sharkey
6db572cf00 Use "all_downloads" instead of "my_downloads". am: 1547194418
am: f6d7c1ed15

Change-Id: Icb352ec7b0e746264a6311b5fba1fc1272b627b0
2016-09-16 21:53:37 +00:00
Jeff Sharkey
f6d7c1ed15 Use "all_downloads" instead of "my_downloads".
am: 1547194418

Change-Id: I6dabba1f82ef1989eb2a52c3c493127a174ff315
2016-09-16 21:48:24 +00:00
Jeff Sharkey
1547194418 Use "all_downloads" instead of "my_downloads".
We can no longer return the "my_downloads" paths: if those Uris were
shared beyond the app that requested the download, access would be
denied.  Instead, we need to switch to using "all_downloads" Uris so
that permission grants can be issued to third-party viewer apps.

Since an app requesting a download doesn't normally have permission
to "all_downloads" paths, DownloadProvider now issues narrow grants
toward the owner of each download, both at device boot and when new
downloads are started.

Bug: 30537115, 30945409
Change-Id: I533125b36444877f54373d88922f2acc777e250b
2016-09-16 12:04:05 -06:00
Tadashi G. Takaoka
7bb4c82558 DO NOT MERGE: Catch all exceptions when parsing IME meta data
Bug: 30568284
Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
(manually cherry picked from 9b2997d22e6ce2a15065d8e7608dd77b316c2065)
2016-09-16 06:03:42 +00:00
Tadashi G. Takaoka
43f4980e77 DO NOT MERGE: Catch all exceptions when parsing IME meta data
Bug: 30568284
Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
(manually cherry picked from 9b2997d22e6ce2a15065d8e7608dd77b316c2065)
2016-09-16 06:02:18 +00:00
Tadashi G. Takaoka
c6fc6c3b55 DO NOT MERGE: Catch all exceptions when parsing IME meta data
Bug: 30568284
Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
(manually cherry picked from 9b2997d22e6ce2a15065d8e7608dd77b316c2065)
2016-09-16 13:57:05 +09:00
Tadashi G. Takaoka
f71d2cddf1 DO NOT MERGE: Catch all exceptions when parsing IME meta data
Bug: 30568284
Change-Id: I0b613f8ce0f014320c5ac1bf445699ea2702a0a2
(manually cherry picked from 9b2997d22e6ce2a15065d8e7608dd77b316c2065)
2016-09-16 13:51:43 +09:00
Sudheer Shanka
dce4be63bb DO NOT MERGE: Fix deadlock in AcitivityManagerService.
Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I1fddd06f5e35b67fea041741f5746c57a39208ba
2016-09-15 19:00:43 -07:00
Sudheer Shanka
b59e73613b DO NOT MERGE: Fix deadlock in AcitivityManagerService.
Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I421962cbfd7c466662edcef805c3e27321dc5a98
2016-09-15 18:01:44 -07:00
Sudheer Shanka
e8340a9ed5 DO NOT MERGE: Fix deadlock in AcitivityManagerService.
Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I421962cbfd7c466662edcef805c3e27321dc5a98
2016-09-15 18:00:51 -07:00
Sudheer Shanka
2d608378f4 DO NOT MERGE: Fix deadlock in AcitivityManagerService.
Don't hold mPidsSelfLocked lock when calling
cleanUpApplicationRecordLocked.

Bug: 31463143
Change-Id: I421962cbfd7c466662edcef805c3e27321dc5a98
2016-09-15 17:59:52 -07:00
Ajay Panicker
85bc33a8f4 [DO NOT MERGE] Prevent FDs from being leaked when accepted sockets are closed
Bug: 28672558
Change-Id: I4bc14bd7f098e34012c2ae1eeba2d439145901f0
2016-09-14 19:17:49 +00:00
Ajay Panicker
786e2694b1 [DO NOT MERGE] Prevent FDs from being leaked when accepted sockets are closed
Bug: 28672558
Change-Id: I4bc14bd7f098e34012c2ae1eeba2d439145901f0
2016-09-13 21:09:44 +00:00
John Reck
aa394dd42c Ensure munmap matches mmap
Bug: 31350622
Change-Id: I6d3f9faec32d54360caa6706d17405e20b50966c
2016-09-12 17:53:14 +00:00
Sungsoo
deeb0e5246 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953 am: b336cce830 am: d07324fe85 -s ours am: f495cf6944 -s ours am: 9f37a8900e am: 40d3c1a7f0
am: 2ddc2956fd  -s ours

Change-Id: Ie0a7dad2ed06124a537077f8fb85c95bc1d49781
2016-09-09 23:50:46 +00:00
Sungsoo
2ddc2956fd DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953 am: b336cce830 am: d07324fe85 -s ours am: f495cf6944 -s ours am: 9f37a8900e
am: 40d3c1a7f0

Change-Id: I491d585b91c7d7b130bbfbcdd62aaddf57718c56
2016-09-09 23:46:07 +00:00
Sungsoo
40d3c1a7f0 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953 am: b336cce830 am: d07324fe85 -s ours am: f495cf6944 -s ours
am: 9f37a8900e

Change-Id: Ied9ac7711abaee4d1f534d35f7882f0a93c425bf
2016-09-09 23:37:52 +00:00
Sungsoo
14bc23be74 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours am: 3af57850a0 am: c17e29076e
am: ca88e604e4  -s ours

Change-Id: Iae1ea19a96fbf9421a24b5682c4b769af95b2660
2016-09-09 23:27:21 +00:00
Sungsoo
9f37a8900e DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953 am: b336cce830 am: d07324fe85 -s ours
am: f495cf6944  -s ours

Change-Id: If47c5a777ad3c7e4cca070ca633ec01442444c8e
2016-09-09 23:08:29 +00:00
Sungsoo
ca88e604e4 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours am: 3af57850a0
am: c17e29076e

Change-Id: If6e85c284a811287a9751eb501e50dabe2dfe8b1
2016-09-09 23:08:29 +00:00
Sungsoo
aa1d75f5e7 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 659275dc30 am: 8d3e6bd3ef
am: dde94fc477  -s ours

Change-Id: I301706cbdc5fd2ca56eb671891e55fd31dfa469a
2016-09-09 23:01:41 +00:00
Sungsoo
f495cf6944 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953 am: b336cce830
am: d07324fe85  -s ours

Change-Id: Ie3049cea7663d06632b0e3139f30f01e7dba5df0
2016-09-09 23:00:35 +00:00
Sungsoo
c17e29076e DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: aebe2347a7 -s ours
am: 3af57850a0

Change-Id: I70f6b639cab68d401d3927c67192d3b89e08eee3
2016-09-09 23:00:21 +00:00
Sungsoo
3af57850a0 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
am: aebe2347a7  -s ours

Change-Id: I58dd093cb10fd89e44d59867f5a4c1a378a61661
2016-09-09 22:54:32 +00:00
Sungsoo
dde94fc477 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 659275dc30
am: 8d3e6bd3ef

Change-Id: I83f7733039ee73407aa5d7f3848ad1074e9dfb03
2016-09-09 22:54:28 +00:00
Sungsoo
d07324fe85 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change am: 1bdd10a953
am: b336cce830

Change-Id: Ib90b72ce9abefc6a7ceab1070555ded45dc8567d
2016-09-09 22:54:12 +00:00
Sungsoo
8d3e6bd3ef DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
am: 659275dc30

Change-Id: I385c86e9753f1c99201a4f32b3c8b840da51376e
2016-09-09 22:46:44 +00:00
Sungsoo
b336cce830 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
am: 1bdd10a953

Change-Id: I644f8187ed6f5957fc273b98c10ed0c602ed1879
2016-09-09 22:46:23 +00:00
Sungsoo Lim
987472290c Merge "DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change" into mnc-dev 2016-09-09 22:39:08 +00:00
Narayan Kamath
e59073096e Merge "Backport changes to whitelist sockets opened by the zygote." into lmp-mr1-ub-dev
am: 00e808b06b

Change-Id: I14939b5bf04ba47229e663b2ffc50543c5c6bc9a
2016-09-09 10:18:19 +00:00
Narayan Kamath
646ee94421 Backport changes to whitelist sockets opened by the zygote.
am: 82c6e6267e  -s ours

Change-Id: Ib35b2567f19aff39d285794951cf9b8cb8d74ef1
2016-09-09 10:15:11 +00:00
Narayan Kamath
00e808b06b Merge "Backport changes to whitelist sockets opened by the zygote." into lmp-mr1-ub-dev 2016-09-09 10:05:46 +00:00
Ajay Panicker
27b3d578b9 [DO NOT MERGE] Prevent FDs from being leaked when accepted sockets are closed
Bug: 28672558
Change-Id: I4bc14bd7f098e34012c2ae1eeba2d439145901f0
2016-09-08 13:23:02 -07:00
Marie Janssen
93326cfd9f Fix setPairingConfirmation permissions issue (2/2)
setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: I887de32d156e672ec44aa0b286cd7ea7f9f8ad55
2016-09-08 18:15:26 +00:00
Ajay Panicker
0ea21bc70e [DO NOT MERGE] Fix setPairingConfirmation permissions issue (2/2)
setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: Iddc935f0b02f5ff56e930914b4b664377e786184
2016-09-08 18:03:58 +00:00
Ajay Panicker
edae39d59a [DO NOT MERGE] Fix setPairingConfirmation permissions issue (2/2)
setPairingConfirmation was set to only require BLUETOOTH_ADMIN
permission which shouldn't be able to set the confirmation itself.

This is restricted to BLUETOOTH_PRIVILEGED permission.

Bug: 29043989
Change-Id: Iddc935f0b02f5ff56e930914b4b664377e786184
2016-09-08 11:01:29 -07:00
Narayan Kamath
014016cf32 Merge "Backport changes to whitelist sockets opened by the zygote." into mnc-dev 2016-09-08 08:12:20 +00:00
Sungsoo
2ee53c82cc DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.

Bug: 30936376
Change-Id: I915f56b00ec9422b53591ac5534e070a1d6798e6
2016-09-08 07:57:56 +00:00
Sungsoo
659275dc30 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.

Bug: 30936376
Change-Id: I915f56b00ec9422b53591ac5534e070a1d6798e6
2016-09-08 07:11:04 +00:00
Sungsoo
aebe2347a7 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.

Bug: 30936376
Change-Id: I915f56b00ec9422b53591ac5534e070a1d6798e6
2016-09-08 07:10:26 +00:00
Sungsoo
1bdd10a953 DO NOT MERGE) ExifInterface: Make saveAttributes throw an exception before change
ExifInterface object can be created with a unsupported file format.
If saveAttribute is called with an unsupported file format, ExifInterface
makes the file corrupted. This CL prevents those cases by throwing
an exception before making any change on the file.

Bug: 30936376
Change-Id: I915f56b00ec9422b53591ac5534e070a1d6798e6
2016-09-08 16:04:44 +09:00
Narayan Kamath
82c6e6267e Backport changes to whitelist sockets opened by the zygote.
This is the backport of the following commits :

Commit c5f27a7cb2ec816f483a65255034a1b57a8aa22:
-----------------------------------------------

Reopen whitelisted zygote file descriptors after a fork.

We don't want these descriptors to be shared post-fork, so we'll
have to close and reopen them when the zygote forks. The set of
open descriptors is checked against a whitelist and it is a fatal
error if a non whitelisted FD is opened. It is also a fatal error
if anything other than a regular file / character device or socket
is opened at the time of forking.

This work is done in two stages :
- An initial list of FDs is constructed and cached prior to the
  first zygote fork.

- On each subsequent fork, we check whether the list of open FDs
  has changed. We are currently tolerant of changes, but in the
  longer term, it should be a fatal error if the set of open file
  descriptors in the zygote changes.

- Post fork, we traverse the list of open descriptors and reopen
  them if necessary.

bug: 30963384

Commit 3764a260f0c90dcb323caeda14baf903cc108759:
-----------------------------------------------

Add a whitelist of sockets on fork.

Maintain a whitelist of AF_UNIX sockets that are permitted
to exist at the time of forking. If an open socket does not belong
to the whitelist (or is not AF_UNIX), the process will abort. If an
open socket is whitelisted, it will be redirected to /dev/null after
a sucessful fork. This allows us to unify our handling of the special
zygote sockets (/dev/socket/zygote[_secondary]) with the existing
whitelist of non socket file descriptors.

This change also removes non-fatal ALOGW messages since they have the
side effect of reopening the logging socket.

bug: 30963384

Commit 0b76d6a28e6978151bf245a775329cdae5e574d5:
-----------------------------------------------
fd_utils: Fix broken usage of iterators.

There were two separate issues here :
- RestatInternal was using an iterator after a call to erase(). This
  will not work because it will be invalidated.
- The "standard" for loop idiom for iterating over a map while making
  structural changes to it is broken. Switch to a while loop and treat
  cases where elements are erased differently from cases where they
  aren't.

bug: 31092930
bug: 30963384

Plus additional changes:
-----------------------------------------------
- change std::unordered_map to std::tr1::unordered_map.
- add /dev/alarm and /dev/__properties__ to the whitelist.
- map.erase(iterator) returns void prior to C++11, so need the kludge
  of calling erase(it++).

(cherry picked from commit 7ec85f9d549971af59f047d5eafd7a829e1541c7)

Change-Id: If44dc64275d753553233b78a05d41df9d5bfdc36
2016-09-07 21:22:59 +01:00
Narayan Kamath
2acf9f7e3c Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54 am: f7b9f84f87 am: 9a409265fc -s ours
am: 9802fcfa2b

Change-Id: Iabeefa7d07d78002c124ce62dc210111b83a99b7
2016-09-07 20:07:58 +00:00