Commit Graph

65509 Commits

Author SHA1 Message Date
Aart Bik
116a4e883d Revert "Fix vulnerability in MemoryIntArray" am: 29139a8ae5 am: 86699f980f am: 65cf055ad9
am: 278cad4793

Change-Id: I545ba917e74f34716fe773250468e06b1dfd8312
2016-12-08 02:00:56 +00:00
Aart Bik
278cad4793 Revert "Fix vulnerability in MemoryIntArray" am: 29139a8ae5 am: 86699f980f
am: 65cf055ad9

Change-Id: Iae6e4fe6eada607d71a20b8ea588ee8efd56a8e0
2016-12-08 01:52:51 +00:00
Aart Bik
65cf055ad9 Revert "Fix vulnerability in MemoryIntArray" am: 29139a8ae5
am: 86699f980f

Change-Id: I7876874ba0d6815920f21021a47e3fe1b3e1c42f
2016-12-08 01:44:54 +00:00
Aart Bik
86699f980f Revert "Fix vulnerability in MemoryIntArray"
am: 29139a8ae5

Change-Id: I3975cfc51bd03a65855c113dfdb827d24471e0ba
2016-12-08 01:36:50 +00:00
Aart Bik
29139a8ae5 Revert "Fix vulnerability in MemoryIntArray"
This reverts commit 86dfa094de.


BROKE BUILD (as shown in some treehugger builds)

frameworks/base/core/java/android/util/MemoryIntArray.java:84: error: cannot find symbol
        mCloseGuard.open("close");
        ^
        
       
bug:33039926
bug:33042690

Change-Id: Ief875e543ec849fe55c747fb1ed5253f0cd9a122
2016-12-08 01:12:48 +00:00
Svetoslav Ganov
9aed2f6f53 Fix vulnerability in MemoryIntArray am: 86dfa094de am: 367023218e am: e123f41553
am: b317e60014

Change-Id: I550293e05ce1d1039e3f22f72002e69df919f735
2016-12-08 01:04:48 +00:00
Svetoslav Ganov
b317e60014 Fix vulnerability in MemoryIntArray am: 86dfa094de am: 367023218e
am: e123f41553

Change-Id: Id5cd6072d972b5d03512e83dc342a7c78341ffeb
2016-12-08 00:57:21 +00:00
Svetoslav Ganov
e123f41553 Fix vulnerability in MemoryIntArray am: 86dfa094de
am: 367023218e

Change-Id: I38d3f7089b9678210772f79215b44198b262e922
2016-12-08 00:49:48 +00:00
Svetoslav Ganov
367023218e Fix vulnerability in MemoryIntArray
am: 86dfa094de

Change-Id: I664782bea6e2b941ba94e51c65afd7e9b0f95f8d
2016-12-08 00:42:18 +00:00
Adrian Roos
8f250c13d7 Merge "Notifications: Fix bad layout for long texts" into nyc-mr2-dev 2016-12-08 00:30:08 +00:00
Svetoslav Ganov
86dfa094de Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

Further, we now check the memory mapped size against
the size of the underlying ashmem region after we do
the memory mapping (to fix the ahsmem size) and if
an attacker changed the size under us we throw.

Tests: Updated the tests and they pass.

bug:33039926
bug:33042690

Change-Id: Ie267646eb88014034fbd048d7a9bc273420c7eff
2016-12-07 15:19:13 -08:00
Ned Burns
5207e1cff1 DO NOT MERGE Fix android:noHistory for Wear
am: d7a313fb11

Change-Id: I3715b2fb1045b7bfce7f52e9b4982fcc0218d28c
2016-12-07 21:14:51 +00:00
Ned Burns
d7a313fb11 DO NOT MERGE Fix android:noHistory for Wear
Modifies swipe-to-close activities to be opaque by default (instead
of translucent by default). Previously, android:noHistory properties
on most activities in Wear were being ignored because they were
usually transitioning to a swipe-to-close activity that was marked
as translucent. This meant that the noHistory activity was still
technically visible, and so would never be culled from the task
history.

Now, we convert a swiped activity to translucent as soon as a swipe
begins, and convert it back after the swipe finishes. The previous
version of SDL tries to do this, but fails in the case where the
context is a ContextWrapper.

This approach is hacky and isn't merge-able into master. We leave
it DO NOT MERGE and will do a long-term fix after the holidays.

Test: Built a test app to verify that noHistory is now being
correctly respected. Manually verified that new activities start
out opaque and not translucent. Manually verified that Home
correctly starts/stops when it's revealed from underneath a
partially swiped activity. Tested general swipe behavior on Settings,
Contacts, Flashlight, Fit.

Bug: 33252029

Change-Id: Ib2e7f21ea1e0d52db03e78d25676501e5f73b31f
2016-12-07 15:05:25 -05:00
Sunny Goyal
bde1091f50 Merge "Preventing widgets from exceeding Bitmap memory limit" into nyc-mr2-dev 2016-12-07 19:12:24 +00:00
TreeHugger Robot
ae91d10629 Merge "Fix two StrictMode stack collection bugs." into nyc-mr2-dev 2016-12-07 18:39:04 +00:00
Jeff Sharkey
20db11cfda Fix two StrictMode stack collection bugs.
When Binder calls are nested, we can quickly end up with a snowball
of stacktraces that can cause the original transaction to fail.  This
CL makes two specific changes to alleviate this pressure:

-- Consider a nested Binder call from PID A -> B -> C.  If both B and
C encounter dozens of StrictMode violations, then gatheredViolations
in B will end up with 10 ViolationInfo (5 from B and 5 from C).  This
problem only grows with each successive nested call.  To solve this,
always limit ourselves to only ever write out 3 ViolationInfo from
any given process.

-- CrashInfo already nicely truncates any large stack traces to 20kB,
but readAndHandleBinderCallViolations() blindly appends the entire
local trace, and never considers truncating again.  Similar to the
first problem above, nested calls can quickly cause the stackTrace
value to explode in size.  To solve this, we always re-truncate the
stackTrace value after appending our local stack.

Also fix some NPE bugs when missing crashInfo.

(cherry-picked from commit 58f27b5033)

Test: builds, boots
Bug: 32575987
Change-Id: Ie8373ca277296f920f2b1c564d419c702a8ee0f2
2016-12-07 08:58:38 -08:00
Adrian Roos
62be439d26 Notifications: Fix bad layout for long texts
Fixes a bug where the max lines restriction was not properly
passed to ImageFloatingTextView's layout, causing the TextView
to improperly apply bottom padding.

Change-Id: Ibe07515866a4599047712a0482332ed4430c9056
Test: runtest -x core/tests/coretests/src/com/android/internal/widget/ImageFloatingTextViewTest.java
Fixes: 32658499
Bug: 32658499
2016-12-06 14:17:06 -08:00
Mark Renouf
28f0e5bf48 Revert "Allow power button to close an input method"
This reverts commit d28e907183.
Test: manually tested

BUG: 33038203
Change-Id: I7a4c6e95a69abb2e40df73509b6e67b93eacf6ff
2016-12-06 17:43:28 +00:00
Ned Burns
f9566827f2 Modify SwipeDismissLayout to perform its own exit animation
am: 7d6cb913de

Change-Id: I17d086e1c24d9eb91a984c45b88f529006465d34
2016-12-06 02:33:13 +00:00
Alan Viverette
6ad979a637 Merge "Show popup transitions when there is no anchor set" into nyc-mr2-dev 2016-12-06 01:02:06 +00:00
Ned Burns
7d6cb913de Modify SwipeDismissLayout to perform its own exit animation
Instead of relying on the window animation system, in the special
case of a swipe-dismiss, disable any default window exit animation
and perform a custom animation. This bypasses some bugs in the
window animator codebase and allows us to have a nice "rebound"
animation if the user doesn't swipe far/fast enough to trigger a
dismiss.

Bug: 33041168
Change-Id: Ied45700d35a59950bacef1ba0650eaa5bc60fadb
2016-12-05 19:38:14 -05:00
Michael Kwan
9120012566 Disable swipe-to-dismiss for not cancelable dialogs.
am: f7964be938

Change-Id: I4a6cad65f91368393272cd8f7d6012d131ec56ff
2016-12-05 18:09:07 +00:00
Alan Viverette
61edf5bbff Show popup transitions when there is no anchor set
Allow anchorRoot to be null when starting exit transition. Pushes
epicenter callback creation into startExitTransition. Adds nullability
annotations.

Bug: 33035511
Test: PopupWindowTest#testEnterExitTransition
Change-Id: Ie752a0d6b29d5eb11c160771d8a78fa6234de5bb
2016-12-05 10:56:18 -05:00
Michael Kwan
f7964be938 Disable swipe-to-dismiss for not cancelable dialogs.
Bug: 33249829
Change-Id: Ib3d2c9982ece22d1b080b821eaf306f6b686d099
2016-12-02 17:33:56 -08:00
Jakub Pawlowski
c977c776c2 Merge changes from topic 'ble_oob_sc_mr2' into nyc-mr2-dev
* changes:
  BLE OOB Pairing - parse address type (5/5)
  Fix Bluetooth OOB pairing not working for unseen devices
  Add LE Secure Connection data parsing (1/4)
2016-12-02 20:14:03 +00:00
Jeff Sharkey
d8ee1d0fcd DO NOT MERGE: Check provider access for content changes. am: c813f5dae2
am: 2b7584f5b1

Change-Id: I762e09539e99d1cb8b6fd810992b27255774060d
2016-12-02 18:36:38 +00:00
Jeff Sharkey
bdfb26ac3b DO NOT MERGE: Check provider access for content changes.
am: 11e3e52bd9

Change-Id: Ice374d398888e2898f571cee7df73f5e47921655
2016-12-02 18:19:51 +00:00
Jeff Sharkey
2b7584f5b1 DO NOT MERGE: Check provider access for content changes.
am: c813f5dae2

Change-Id: I939bca8887198e2578916356d49b0f2f0a2bf3d2
2016-12-02 18:19:46 +00:00
Jeff Sharkey
fdef2cd87d Merge "DO NOT MERGE: Check provider access for content changes." into nyc-dev 2016-12-02 18:10:10 +00:00
Jeff Sharkey
5ec25934ce Merge "DO NOT MERGE: Check provider access for content changes." into nyc-mr1-dev 2016-12-02 18:10:03 +00:00
Michal Karpinski
3db0a14ab0 Merge "DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService" into nyc-mr2-dev 2016-12-02 09:26:31 +00:00
Jeff Sharkey
bc7aae3610 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
am: 17010dc0d2

Change-Id: I7c6d507411864912937c9dbacc985cb834760cfe
2016-12-02 02:05:34 +00:00
Jeff Sharkey
ede3a78432 DO NOT MERGE. Retain DownloadManager Uri grants when clearing. am: 6eee8e37fd
am: 6795459a80

Change-Id: I5ca304b89c30c3c7d0bddb701c60c81c87d8870c
2016-12-02 02:03:58 +00:00
Jeff Sharkey
6795459a80 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
am: 6eee8e37fd

Change-Id: I431b334bbf3580f51fc8e31da28c9c9d6f5944ee
2016-12-02 01:52:12 +00:00
Jeff Sharkey
17010dc0d2 DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads.  However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health.  Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
(cherry picked from commit 23ec811266)
2016-12-02 00:05:40 +00:00
Jeff Sharkey
6eee8e37fd DO NOT MERGE. Retain DownloadManager Uri grants when clearing.
As part of fixing a recent security issue, DownloadManager now needs
to issue Uri permission grants for all downloads.  However, if an app
that requested a download is upgraded or otherwise force-stopped,
the required permission grants are removed.

We could tell DownloadManager about the app being stopped, but that
would be racy (due to background broadcast), and waking it up would
degrade system health.  Instead, as a special case we now only
consider clearing DownloadManager permission grants when app data
is being cleared.

Bug: 32172542, 30537115
Test: builds, boots, app upgrade doesn't clear grants
Change-Id: I7e3d4546fd12bfe5f81b9fb9857ece58d574a6b9
(cherry picked from commit 23ec811266)
2016-12-01 17:04:32 -07:00
Mark Renouf
fed8c7dc73 Allow power button to close an input method
am: d28e907183

Change-Id: I26176ab20b90ca2c5d286b3f34bfacc6527018b5
2016-12-01 01:29:31 +00:00
Mark Renouf
33d498b946 Merge "Allow power button to close an input method" into cw-f-dev 2016-12-01 01:16:59 +00:00
vinodkrishnan
60d4248fdc Revert "DO NOT MERGE Wear Fwk: Disable Animations for A11y"
am: 7b62df8556

Change-Id: Iec37684da3fa447d55498e6c8302fb229fa28373
2016-11-30 21:52:05 +00:00
TreeHugger Robot
a0d9383f71 Merge "Revert "DO NOT MERGE Wear Fwk: Disable Animations for A11y"" into cw-f-dev 2016-11-30 21:43:38 +00:00
Mark Renouf
d28e907183 Allow power button to close an input method
BUG: 33038203
Change-Id: I5c44dc49db6b960b4e3e42545bfbbab62f357f08
2016-11-30 16:01:42 -05:00
vinodkrishnan
7b62df8556 Revert "DO NOT MERGE Wear Fwk: Disable Animations for A11y"
This reverts commit 8500f26d51.

Change-Id: I6408fa3f307d7611443e26b24d3876c1a1f92fdc
2016-11-30 20:09:59 +00:00
Phil Weaver
d1b7d3262b Merge "Don't invalidate list data during layout." into nyc-mr2-dev 2016-11-30 17:51:42 +00:00
Michal Karpinski
7f9014bb9d DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService
The service will be extended to include listening for connect events as well.

Test: this is just a renaming change

Bug: 29748723
Change-Id: I073187e354fc987222ec0108d7f0d3a422397d5e
2016-11-24 17:05:02 +00:00
Nancy Zheng
a2193c0b76 Fix createConfirmDeviceCredentialIntent for wear for CTS.
am: 43f166dfb4

Change-Id: Icda6d5182ff20c4db150ae3f0351e559682184de
2016-11-21 18:19:48 +00:00
Nancy Zheng
43f166dfb4 Fix createConfirmDeviceCredentialIntent for wear for CTS.
Bug: 33000237
Change-Id: I1fdb5a518c41ab005f12d3142763e374b38d7553
2016-11-18 18:15:09 -08:00
Jeff Sharkey
c813f5dae2 DO NOT MERGE: Check provider access for content changes.
For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
2016-11-17 21:02:31 +00:00
Jeff Sharkey
11e3e52bd9 DO NOT MERGE: Check provider access for content changes.
For an app to either send or receive content change notifications,
require that they have some level of access to the underlying
provider.

Without these checks, a malicious app could sniff sensitive user data
from the notifications of otherwise private providers.

Test: builds, boots, PoC app now fails
Bug: 32555637
Change-Id: If2dcd45cb0a9f1fb3b93e39fc7b8ae9c34c2fdef
2016-11-17 21:01:43 +00:00
Selim Gurun
83fbb94e18 Merge "Fix WebViewDatabase javadoc." into nyc-mr2-dev 2016-11-15 19:57:42 +00:00
Sunny Goyal
4f05d8d76b Preventing widgets from exceeding Bitmap memory limit
> Moving the size check to a comman place so that it is executed in
all related code
> Fixing size calculation when views are merged as a result of partial
update

Test: Manually tested with a dummy app
Bug: 31790171
Change-Id: Id0ea776796f156455d2cba31c8392d4875116949
(cherry picked from commit 349b412b4b)
2016-11-15 05:22:04 +00:00