246346 Commits

Author SHA1 Message Date
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
Narayan Kamath
9802fcfa2b Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54 am: f7b9f84f87
am: 9a409265fc  -s ours

Change-Id: Idf4dcc5ab7e8b0510848cbd2f220fe7a8e4b3e04
2016-09-07 20:01:56 +00:00
Narayan Kamath
a1252ccbdb Backport changes to whitelist sockets opened by the zygote.
This is the backport of the following commits :

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

(cherry picked from commit c5f27a7cb2ec816f483a65255034a1b57a8aa221)

Fix clang build breakage (-Werror -Wformat).

Use %zd for size_t. Note that this will break only on (-plus-)aosp because
clang is disabled on the N development branches.

bug: 30963384

(cherry picked from commit b334c33d65894f5ca9833fa55c3a1cf75e01c497)

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

(cherry picked from commit 3764a260f0c90dcb323caeda14baf903cc108759)

fd_utils: Remove whitelist for "/dev/pmsg0".

We're now calling __android_log_close prior to a fork, so this file
shouldn't need to be open.

bug: 31243313
bug: 30963384

(cherry picked from commit 8dee0541904e4f792cdebdee4f23f768561cb276)

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

(cherry picked from commit 0b76d6a28e6978151bf245a775329cdae5e574d5)

add dri device to zygote whitelisted FDs

The driver can be used just like /dev/ion for graphic buffers.

(cherry picked from commit 8977e424ee2d6d85fec419532ae510131aa88c45)
2016-09-07 20:54:17 +01:00
TreeHugger Robot
4dc743ac67 Merge "docs: Added note about CustomTabsIntent.setAlwaysUseBrowserUI" into nyc-dev 2016-09-07 19:02:37 +00:00
Narayan Kamath
9a409265fc Backport changes to whitelist sockets opened by the zygote. am: 7ec85f9d54
am: f7b9f84f87

Change-Id: I317cecff389f30c5d47e4adee1afafbde8d9d23d
2016-09-07 18:58:41 +00:00
Narayan Kamath
f7b9f84f87 Backport changes to whitelist sockets opened by the zygote.
am: 7ec85f9d54

Change-Id: I6db56b5b06636201382f6d908297644183253c0b
2016-09-07 18:53:40 +00:00
Andrew Solovay
5bf2ea6670 docs: Fixing redirect file
Devsite handles "redirect this directory tree" differently than DAC
did; as a result, a bunch of redirects were broken. (On Devsite, a
redirect ending in a slash redirects *only* paths that match it;
to redirect that directory and all its contents, end with /...)

Also deleted one redirect that wouldn't work (trying to redirect
foo.html#bar , which wouldn't work--the anchors are ignored on
devsite and there was a separate redirect for just foo.html).

When a redirect pointed *to* a path ending in slash -- but was clearly
meant to point to the directory itself (i.e. the /index.html file) --
I removed the trailing slash.

Redirects staged to https://android-dot-devsite.googleplex.com , so
they should all work there.

bug: 30748799
Change-Id: I6d090de5e6efa6ddb2bbe3e99fdbfb0ae02b88d5
2016-09-07 11:51:19 -07:00
Narayan Kamath
41ca1bce01 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:
-----------------------------------------------
- add /dev/__properties__ to the whitelist.

Change-Id: I709a7f4913e807a8fec8a58c81e98fe5b5222820
2016-09-07 19:06:04 +01:00
Narayan Kamath
0f6a0e1560 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:
-----------------------------------------------
- add /dev/__properties__ to the whitelist.

Change-Id: Ic512be6362c3c5d84767e933884872b7e995dfea
2016-09-07 18:52:50 +01:00
Narayan Kamath
7ec85f9d54 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++).

Change-Id: I694ff66d5f227239b0190ffc2287882b16e336fa
2016-09-07 18:48:48 +01:00
Sreevani Sreejith
d2273e433c Merge "docs: Added functional and UI quality criteria for Wear 2.0 apps. Bug:30951238" into nyc-dev 2016-09-06 21:24:34 +00:00
Cheryl Potter
9af802df0f docs: Define card data for GPU Debugger
b/31318053

Change-Id: Iaedeaa8f39d1adb7dd556d26f6cf176a0a6b4003
2016-09-06 14:13:52 -07:00
sreevanis
1e4bc15f31 docs: Added functional and UI quality criteria for Wear 2.0 apps.
Bug:30951238

Change-Id: I5cbfac60716415d87f049ae2313fed7bfa214e28
2016-09-06 10:37:04 -07:00
Amanda Kassay
b5887e68c3 Update #jd-content to #body-content for DevSite layout changes.
Change-Id: I57c43a9b05a2bd072c54bf53e8428015edf0a90e
2016-09-06 13:33:09 -04:00
Dirk Dougherty
9ac575abc3 Doc change: remove useUpdatedTemplates script and sections using old templates.
Change-Id: I7c4e8f36125ad120699d5b2c66bea29433fecf59
2016-09-02 21:03:38 -07:00
smain@google.com
7dd9749246 remove 'useUpdatedTemplates' flag that's no longer supported. Fix build.
Change-Id: Ic1778b6e3044c80e602f5ce9d4f825c8578c1a0a
2016-09-02 18:10:29 -07:00
Dirk Dougherty
460b9c08e6 Merge "Remove obsolete collections and extras metadata files. Authors should use jd_extras_<lang> instead..." into nyc-dev 2016-09-02 22:27:02 +00:00
Scott Main
915b566ef0 Merge "switch all API builds to use template-sdk instead of (soon to be deleted) templates-sdk-dev. also update all non-DAC builds to use the "referenceonly" flag for a cleaner output and faster build." into nyc-dev 2016-09-02 21:27:22 +00:00
smain@google.com
534bfe1a4a switch all API builds to use template-sdk instead of (soon to be deleted) templates-sdk-dev.
also update all non-DAC builds to use the "referenceonly" flag for a cleaner output and faster build.

Change-Id: Iebd9791305479c5dc406ba3b81eaf076855bc632
2016-09-01 19:57:42 -07:00
Dirk Dougherty
355f33a1d9 Exclude sdk files from metadata.
Change-Id: I16f89a3bfae32a0fa54037e328fc784133e5d9b0
Bug-Id: 31244539
2016-09-01 21:20:02 +00:00
Andrew Solovay
0b423e5eae docs: Typo fix in multi-window docs
Referred to the "android:resizableActivity" property; should
have been "android:resizeableactivity". English prose, however,
consistently uses the (preferred) spelling "resizable".

See first comment for stage location.

bug: 30566808
Change-Id: I2570ff9269b4d2dc8b11f1c98817e50726be78fc
2016-08-31 19:37:25 -07:00
Andrew Solovay
9499478c80 Merge "docs: Fixing formatting problem" into nyc-dev 2016-09-01 02:21:49 +00:00
Cheryl Potter
780395fd85 docs: fixing gpu debugger redirect
b/31227713

Change-Id: Ia0e7e4d26940dc98ab735df3068dc2dda22b1f58
2016-08-31 17:43:37 -07:00
Cheryl Potter
3f2d7d8e22 docs: Add redirects for new help buttons (Create Java Class, GPU Debugger, more)
b/31158856
b/31157097
b/31158502

Change-Id: Id3178127e0267936c58f47cd7da7348202051fa3
2016-08-31 16:00:42 -07:00
Svetoslav Ganov
84763eb770 Merge "Properly close fd backing a MemoryIntArray" into nyc-dev 2016-08-31 17:25:30 +00:00
Svetoslav Ganov
e257d6e167 Properly close fd backing a MemoryIntArray
Use ParcelFileDescriptor only as an IPC transport
to make sure MemoryIntArray manges its backing fd.

Bug:30310689

Change-Id: Ib3cc13ef4ae2a744e5f7a96099570e0431847bce
(cherry picked from commit fe2462f3a60b34ee6b7d8764d92ae58fc0cd7dfd)
2016-08-31 16:45:17 +00:00
Scott Main
a06f40bd05 Merge "replace the N Preview landing page with the redirect to the package index also update version metadata (no longer preview, now 7.0)" into nyc-dev 2016-08-31 03:06:10 +00:00
Mark Lu
e8691d19cb docs: fix grammar mistake in TextureView
Bug: 6441115
2016-08-30 17:38:42 -07:00
Adam Seaton
e245037327 Revert "Bump up the uncrypt timeout to 30 min." Creates Null Build to test OTA failure fix. This reverts commit 8abcfed8a42a1ca517ee3c8d0448fda669ff9ded.
am: b57e6560d0

Change-Id: Idaafcb7c835aa7b7b83bb7382900ef3d18fa551f
2016-08-30 23:15:49 +00:00
TreeHugger Robot
a845535045 Merge "Backup system QS tiles DO NOT MERGE" into nyc-dev 2016-08-30 22:30:16 +00:00
Adam Seaton
b57e6560d0 Revert "Bump up the uncrypt timeout to 30 min."
Creates Null Build to test OTA failure fix.
This reverts commit 8abcfed8a42a1ca517ee3c8d0448fda669ff9ded.

Change-Id: I64474dad467ce8d8e379e0e2c47814d76ac0ee0d
2016-08-30 22:14:47 +00:00
smain@google.com
dde8deb950 replace the N Preview landing page with the redirect to the package index
also update version metadata (no longer preview, now 7.0)

Change-Id: I84af003daa9bae3bc932c8b87921ed82f813e1cf
2016-08-30 20:42:12 +00:00
Jason Monk
37bd2be160 Backup system QS tiles DO NOT MERGE
Add QS tiles to the backup list.  Non-system tiles will get removed
since they won't be installed when restore happens.

Change-Id: Iccf6e773384c45bd4d1f10c21aa8af356b3920d2
Bug: 28782938
2016-08-30 15:48:15 -04:00
Andrew Solovay
7cfe9f83ac docs: Added note about CustomTabsIntent.setAlwaysUseBrowserUI
See first comment for doc stage location.

bug: 31181353
Change-Id: Ibdd8c32be4b182241a4b2d3b4f430dbca18c53fb
2016-08-30 12:45:06 -07:00
Mark Goldstein
36f4638fe7 Merge "docs: Fix broken camera example" into nyc-dev 2016-08-30 18:34:24 +00:00
Scott Main
4d1f3047e3 Merge "add a notice that Work profiles are not compatible with Instant Run Also includes the redirect for links from the Studio UI bug: 31098748" into nyc-dev 2016-08-30 18:09:06 +00:00
Raph Levien
5d628b1e45 Merge "Enforce consistent sizes for arrays in SpannableStringInternal" into nyc-dev 2016-08-30 17:25:58 +00:00
TreeHugger Robot
b9d4f91630 Merge "Sanity check ICMP6 router advertisement packets" into nyc-dev 2016-08-30 05:20:12 +00:00
Paul Jensen
a36213867a Sanity check ICMP6 router advertisement packets
There is a chance a packet can slip by before we install the filter
on our socket listening for RAs, so add some basic sanity checking
to make sure we've recieved an RA.

Change-Id: I14cf84a0814896a41e00f50af376dfc4988d36cb
Fixes: 29586253
2016-08-30 10:57:30 +09:00
TreeHugger Robot
689c92db9d Merge "update shared libraries for system apps" into nyc-dev 2016-08-30 01:44:31 +00:00
John Reck
8eaa65b867 Merge "Cherry pick TextureView fixes" into nyc-dev 2016-08-29 23:33:57 +00:00
Mark Goldstein
3f97bc25d4 docs: Fix broken camera example
Removed bad out of date instructions and link to better
training pages instead.

Bug: 15562334
Change-Id: I77fe558e665de509eb11a2c668ba7bdcdbab3c6f
2016-08-29 15:55:31 -07:00
Todd Kennedy
85a91def5c update shared libraries for system apps
After removing updates for a system package, we weren't updating its
shared libraries when we should have. Make it so.

NOTE: This didn't affect device boot because we update all of the
shared libraries for all system applications after scanning packages.

Bug: 30266503
Change-Id: I8edf4344228fb3e793e7648ea70a041cb5db6af6
(cherry picked from commit 6058df65e645a81bdc7285dcd9f8b12b9f5b534f)
2016-08-29 22:50:49 +00:00
TreeHugger Robot
b7efddfc41 Merge "Make sure IME focus is synced to View focus" into nyc-dev 2016-08-29 22:35:23 +00:00
Chet Haase
59fb472858 Merge "ChooserActivity: Cannot start app that the icon overflows the layout" into nyc-dev 2016-08-29 22:13:12 +00:00
Chet Haase
22e006214c Merge "Set up view state before attaching, jump drawables if needed" into nyc-dev 2016-08-29 22:12:09 +00:00
Chet Haase
a1bbb76806 Merge "Force AlertDialogLayout to have gravity start|top" into nyc-dev 2016-08-29 22:11:27 +00:00
Chet Haase
c80a4d7ae3 Merge "FloatingActionMode: Fix screen coordinates." into nyc-dev 2016-08-29 22:11:09 +00:00
TreeHugger Robot
2bbfe98062 Merge "Eliminate next-alarm-clock broadcast flapping" into nyc-dev 2016-08-29 21:47:04 +00:00
Chris Craik
2e8a8a2432 Cherry pick TextureView fixes
The following changes are in this commit:

Avoid destroying TextureView surfaces for onStop

bug:30238922

TextureViews will hold onto their backing surfaces, which will allow
them to resume gracefully when the app's surfaces are saved.

Now only resources that are destroyed for onStop are DisplayLists.

(cherry picked from commit 391d560402c2902e0fd701f99eabd91025154201)

TextureView: destroy layer on destroyHardwareResources event

bug:30468770

(cherry picked from commit 1c16c37d8646ed25e844af8472eede988ad0c2f0)

Fix NPE in TextureView

Bug: 30651595

(cherry picked from commit 3c2587f26eed32a8723488131d1d8940dc147ee1)

Fix NPE in TextureView

Bug: 30779663

(cherry picked from commit 7e237189c292cdb886733eb95c6069b7ac002527)

Fix maps resume being blank

Bug: 30889568

Fixes an issue where mLayer didn't have
the mSurface set on it in certain resume
scenarios.

(cherry picked from commit 03df0834e63b587dbfb8fdcd0086e3e1e72b9f9d)
2016-08-29 14:22:13 -07:00