Commit Graph

90572 Commits

Author SHA1 Message Date
TreeHugger Robot
5c1ada4bb3 Merge "RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display" into pi-dev 2020-03-11 04:55:07 +00:00
Linus Tufvesson
bf89805ea3 RESTRICT AUTOMERGE
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

Bug: 141745510
Test: cts-tradefed run cts -m CtsActivityManagerDeviceTestCases -t android.server.am.PresentationTest
Change-Id: I2aaab1903dee54190338f7b6e49888aa51437108
2020-03-04 10:05:55 -08:00
Christopher Tate
a79b6ba5c5 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-02-04 16:59:47 -08:00
Riddle Hsu
0a8a1e9d40 Fix potential double destroy of AssetManager
Assume there is a XmlBlock [X] created by a AssetManager [A]
([A] will have mNumRefs = 2). After [A].close is called
(mNumRefs = 1) and then both [X] and [A] are going to be GCed,
if [A].finalize is called first (nativeDestroy), the later
[X].finalize will invoke [A].xmlBlockGone that triggers the
second nativeDestroy of [A] and leads to crash.

By clearing the mObject in AssetManager.finalize, the
decRefsLocked from other paths won't call nativeDestroy again.

Bug: 136721562
Bug: 144028297
Test: atest AssetManagerTest
Test: Build and install CorePerfTests
      adb shell am instrument -w -r --no-hidden-api-checks -e class \
      android.app.ResourcesPerfTest#getLayoutAndTravese,android.graphics.perftests.RenderNodePerfTest \
      com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner

Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
Merged-In: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
2020-01-17 18:56:15 +00:00
Yohei Yukawa
08391b3da7 DO NOT MERGE back porting for fixing sysui direct reply
Root cause: systemui run as user 0 service to handle all of users'
notifications. And, the users can user the copy/cut/paste
functionality.

Solution: To crate @hide API in TextView let SystemUI to mark the
TextView instance should check if the power of
INTERACT_ACROSS_USER_FULL is needed to be restricted.
e.x. Keyguard password textview/Notificaiton entries

Bug: 123232892
Test: manual test
Reference: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Reference: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
Reference: I975baa748c821538e5a733bb98a33ac609bf40a7

Change-Id: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Merged-In: Ie3daecd1e8fc2f7fdf37baeb5979da9f2e0b3937
2019-11-05 15:43:12 +08:00
Seigo Nonaka
fd1a7e8663 RESTRICT AUTOMERGE
Revive runLimit check logic

The runLimit check logic was accidentally removed by
I7089ed9b711dddd7de2b27c9c2fa0fb4cb53a735

Bug: 142134328
Bug: 140632678
Test: Manually done with reported step
Test: StaticLayoutTest passes
Change-Id: Ib1d5efdcb9adcc18a6a43370dc016ea464f48148
2019-10-16 22:11:25 +00:00
Seigo Nonaka
f582b9bc98 RESTRICT AUTOMERGE
Do not compute outside given range in TextLine

This is second attempt of I646851973b3816bf9ba32dfe26748c0345a5a081
which breaks various layout test on application.
The empty string must be also handled by the TextLine since it
retrieves the default line height from the empty string.

Bug: 140632678
Test: StaticLayoutTest
Test: Manually done
Change-Id: I7089ed9b711dddd7de2b27c9c2fa0fb4cb53a735
2019-09-30 17:32:57 +00:00
Jeff Sharkey
604d91d713 Merge changes from topic "bp-135269143-p" into pi-dev
* changes:
  RESTRICT AUTOMERGE Strict SQLiteQueryBuilder needs to be stricter.
  RESTRICT AUTOMERGE Enable stricter SQLiteQueryBuilder options.
2019-09-12 19:59:29 +00:00
Jeff Sharkey
216bbc2a2e RESTRICT AUTOMERGE
Strict SQLiteQueryBuilder needs to be stricter.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change offers setStrictGrammar() to prevent this by outright
blocking subqueries in WHERE and HAVING clauses, and by requiring
that GROUP BY and ORDER BY clauses be composed only of valid columns.

This change also offers setStrictColumns() to require that all
untrusted column names are valid, such as those in ContentValues.

Relaxes to always allow aggregation operators on returned columns,
since untrusted callers can always calculate these manually.

Bug: 135270103
Bug: 135269143
Test: atest android.database.sqlite.cts.SQLiteQueryBuilderTest
Test: atest FrameworksCoreTests:android.database.sqlite.SQLiteTokenizerTest
Exempt-From-Owner-Approval: already approved in downstream branch
Change-Id: I6290afd19c966a8bdca71c377c88210d921a9f25
2019-09-12 19:59:17 +00:00
Jonathan Scott
a6ce09aaec [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613 am: c1ec4d6e8e am: 80e1c4fd36 am: 7b6a04fceb am: 743846742d am: 0b1d526f50 am: e4ddc22035
am: 5f619835ed

Change-Id: Ie2c9fb05e3245f3045f3c9a4919760e70285fa37
2019-09-09 12:50:26 -07:00
Jonathan Scott
5f619835ed [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613 am: c1ec4d6e8e am: 80e1c4fd36 am: 7b6a04fceb am: 743846742d am: 0b1d526f50
am: e4ddc22035

Change-Id: I4084d344b3c92b5a4459852837e323f44d2b0b72
2019-09-09 12:35:53 -07:00
Jonathan Scott
e4ddc22035 [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613 am: c1ec4d6e8e am: 80e1c4fd36 am: 7b6a04fceb am: 743846742d
am: 0b1d526f50

Change-Id: Ie3f10bbed4bdb2bb7e141d7bb8d34e0b818c3f30
2019-09-09 12:20:54 -07:00
Android Build Merger (Role)
0b1d526f50 [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613 am: c1ec4d6e8e am: 80e1c4fd36 am: 7b6a04fceb am: 743846742d
Change-Id: Ia84a02b1b3ff3e9f4849554c6b2f0e904daadd05
2019-09-09 16:55:54 +00:00
Android Build Merger (Role)
743846742d [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613 am: c1ec4d6e8e am: 80e1c4fd36 am: 7b6a04fceb
Change-Id: I8914a6337a6e6c905b42cc498f34db5142db7a1a
2019-09-09 16:55:50 +00:00
Android Build Merger (Role)
7b6a04fceb [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613 am: c1ec4d6e8e am: 80e1c4fd36
Change-Id: I6ef1648f805c48ef37c8921ddfa1d147a8e5e032
2019-09-09 16:55:45 +00:00
Android Build Merger (Role)
80e1c4fd36 [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613 am: c1ec4d6e8e
Change-Id: I641d14a61338365b5da7f6c55ead2baff29e811c
2019-09-09 16:55:42 +00:00
Android Build Merger (Role)
c1ec4d6e8e [automerger] Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc). am: 20e5d92613
Change-Id: I6b5ad877382a352cb5b4bcdd05a2d19da502945a
2019-09-09 16:55:35 +00:00
Jeff Sharkey
382d5c0c19 RESTRICT AUTOMERGE
Enable stricter SQLiteQueryBuilder options.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change starts using setStrictColumns() and setStrictGrammar()
on SQLiteQueryBuilder to block this class of attacks.  This means we
now need to define the projection mapping of valid columns, which
consists of both the columns defined in the public API and columns
read internally by DownloadInfo.Reader.

We're okay growing sAppReadableColumnsSet like this, since we're
relying on our trusted WHERE clause to filter away any rows that
don't belong to the calling UID.

Remove the legacy Lexer code, since we're now internally relying on
the robust and well-tested SQLiteTokenizer logic.

Bug: 135270103
Bug: 135269143
Test: atest DownloadProviderTests
Test: atest CtsAppTestCases:android.app.cts.DownloadManagerTest
Change-Id: Iec1e8ce18dc4a9564318e0473d9d3863c8c2988a
2019-09-06 15:31:01 -07:00
Pinyao Ting
46368e4f5c fixes a security vulnerability in slice provider
Bug: 138441555
Test: Manual
Change-Id: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
Merged-In: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
(cherry picked from commit 2b415a4c44)
2019-08-17 00:49:29 +00:00
Jonathan Scott
20e5d92613 Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc).
Test: Just adding a constant
Bug: 132261064
Change-Id: I1527be03a10fa1a2fde09e3e41d6b7e83a986fc0
Merged-In: I2bce277ff8f2de4614e19d5385fe6712b076f9c9
2019-08-02 13:16:36 +00:00
Mihai Popa
09bfff78dd [automerger] Fix Layout.primaryIsTrailingPreviousAllLineOffsets am: 2778b1e49d am: 77b7393e7d am: 126189263d
am: 29534f6c57

Change-Id: Id615c055975d251f45ec995c389e4acbe1274cd8
2019-07-10 14:56:38 -07:00
Bryan Ferris
a94d8aed24 Merge "Fix Layout.primaryIsTrailingPreviousAllLineOffsets" into pi-dev 2019-07-10 21:10:18 +00:00
Android Build Merger (Role)
5ad1deb51c [automerger] Fix Layout.primaryIsTrailingPreviousAllLineOffsets am: 7d6c02de04
Change-Id: I7fcc292a58dc297d2725ae3df99d637bbd1a8479
2019-07-10 18:02:40 +00:00
Android Build Merger (Role)
29534f6c57 [automerger] Fix Layout.primaryIsTrailingPreviousAllLineOffsets am: 2778b1e49d am: 77b7393e7d am: 126189263d
Change-Id: If52ab20b7cd84d02518bdfcd46987e329b654e2d
2019-07-10 18:02:37 +00:00
Mihai Popa
7d6c02de04 Fix Layout.primaryIsTrailingPreviousAllLineOffsets
The CL fixes a crash in Layout.primaryIsTrailingPreviousAllLineOffsets.
The crash was happening when the method was called for a line beginning
with an empty bidi run. This could happen, for example, for empty text -
I was unable to find any other case. The CL improves the existing test
for the method with this case, which was previously crashing.

The CL also fixes a potential crash in getLineHorizontals. However, this
bug could never happen as in the current code path clamped is always
false (and kept as parameter for parity with getHorizontal).

Bug: 135444178
Bug: 78464361
Test: atest FrameworksCoreTests:android.text.LayoutTest\#testPrimaryIsTrailingPrevious
Change-Id: I47157abe1d74675884734e3810628a566e40c1b4
(cherry picked from commit 7ad499d007)
2019-07-10 18:02:36 +00:00
Android Build Merger (Role)
126189263d [automerger] Fix Layout.primaryIsTrailingPreviousAllLineOffsets am: 2778b1e49d am: 77b7393e7d
Change-Id: I2a5373fa2ea348adde8e5592a5a9fa489c7fe12b
2019-07-10 18:02:32 +00:00
Android Build Merger (Role)
77b7393e7d [automerger] Fix Layout.primaryIsTrailingPreviousAllLineOffsets am: 2778b1e49d
Change-Id: I0c15ebaddd8d8edb9ff630ffbe4d855219b06907
2019-07-10 18:02:29 +00:00
Mihai Popa
2778b1e49d Fix Layout.primaryIsTrailingPreviousAllLineOffsets
The CL fixes a crash in Layout.primaryIsTrailingPreviousAllLineOffsets.
The crash was happening when the method was called for a line beginning
with an empty bidi run. This could happen, for example, for empty text -
I was unable to find any other case. The CL improves the existing test
for the method with this case, which was previously crashing.

The CL also fixes a potential crash in getLineHorizontals. However, this
bug could never happen as in the current code path clamped is always
false (and kept as parameter for parity with getHorizontal).

Bug: 135444178
Bug: 78464361
Test: atest FrameworksCoreTests:android.text.LayoutTest\#testPrimaryIsTrailingPrevious
Change-Id: I47157abe1d74675884734e3810628a566e40c1b4
(cherry picked from commit 7ad499d007)
2019-07-10 18:02:25 +00:00
Mihai Popa
9109ce6b0a Fix Layout.primaryIsTrailingPreviousAllLineOffsets
The CL fixes a crash in Layout.primaryIsTrailingPreviousAllLineOffsets.
The crash was happening when the method was called for a line beginning
with an empty bidi run. This could happen, for example, for empty text -
I was unable to find any other case. The CL improves the existing test
for the method with this case, which was previously crashing.

The CL also fixes a potential crash in getLineHorizontals. However, this
bug could never happen as in the current code path clamped is always
false (and kept as parameter for parity with getHorizontal).

Bug: 135444178
Bug: 78464361
Test: atest FrameworksCoreTests:android.text.LayoutTest\#testPrimaryIsTrailingPrevious
Change-Id: I47157abe1d74675884734e3810628a566e40c1b4
(cherry picked from commit 7ad499d007)
2019-07-10 18:02:01 +00:00
Mihai Popa
42a6af7a11 Fix Layout.primaryIsTrailingPreviousAllLineOffsets
The CL fixes a crash in Layout.primaryIsTrailingPreviousAllLineOffsets.
The crash was happening when the method was called for a line beginning
with an empty bidi run. This could happen, for example, for empty text -
I was unable to find any other case. The CL improves the existing test
for the method with this case, which was previously crashing.

The CL also fixes a potential crash in getLineHorizontals. However, this
bug could never happen as in the current code path clamped is always
false (and kept as parameter for parity with getHorizontal).

Bug: 135444178
Bug: 78464361
Test: atest FrameworksCoreTests:android.text.LayoutTest\#testPrimaryIsTrailingPrevious
Change-Id: I47157abe1d74675884734e3810628a566e40c1b4
(cherry picked from commit 7ad499d007)
2019-07-10 18:01:49 +00:00
Dmitry Dementyev
c0e4ee7332 Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"
This reverts commit 8094880025.

Reason for revert: changed services order
Test: manual
Bug: 136261465

Change-Id: I2f78f0dbbace212309b87f779efad020cf255196
Merged-In: I2f78f0dbbace212309b87f779efad020cf255196
2019-07-01 20:11:36 +00:00
Michael Wachenschwanz
57f6c0deb2 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618 am: 2ca66d4d10 am: 1c8a632ad2
am: 7eec0a8448

Change-Id: Ic2cc203ee994927ec0b7f355917a15010f6e2a7c
2019-06-05 20:05:28 -07:00
Michael Wachenschwanz
7eec0a8448 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618 am: 2ca66d4d10
am: 1c8a632ad2

Change-Id: I6cc244c8e40d66d639faef43ec8d3a23bfc11df7
2019-06-05 17:38:43 -07:00
Michael Wachenschwanz
1c8a632ad2 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618
am: 2ca66d4d10

Change-Id: I452bc18a9cebc417e7c4499c2bebf8fd3cc0f1ce
2019-06-05 17:07:58 -07:00
Android Build Merger (Role)
2ca66d4d10 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df am: 31737b4618
Change-Id: I780fc62bcad56b4f1518a9a84ff7a77914f5c722
2019-06-05 17:32:04 +00:00
Android Build Merger (Role)
31737b4618 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f am: d944d907df
Change-Id: Ia92e1831963623df7931de17b029a92bab7f9374
2019-06-05 17:32:01 +00:00
Android Build Merger (Role)
d944d907df [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251 am: 6d72c0681f
Change-Id: I38fbeaf20d21dd174e2b022196446631c20b2367
2019-06-05 17:31:57 +00:00
Android Build Merger (Role)
6d72c0681f [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21 am: 86c9bdd251
Change-Id: I16e96c2b33f18459189bfff359ae85483667a202
2019-06-05 17:31:54 +00:00
Android Build Merger (Role)
86c9bdd251 [automerger] Clear the Parcel before writing an exception during a transaction am: f8ef5bcf21
Change-Id: I416ed302e6c680fd006bd9b38565ebfc8b132084
2019-06-05 17:31:48 +00:00
Michael Wachenschwanz
f8ef5bcf21 Clear the Parcel before writing an exception during a transaction
This prevents any object data from being accidentally overwritten by the
exception, which could cause unexpected malformed objects to be sent
across the transaction.

Test: atest CtsOsTestCases:ParcelTest#testExceptionOverwritesObject
Bug: 34175893
Change-Id: Iaf80a0ad711762992b8ae60f76d861c97a403013
Merged-In: Iaf80a0ad711762992b8ae60f76d861c97a403013
2019-06-05 17:31:43 +00:00
Daichi Hirono
9799956531 Stop invoke initAppOps in Camera default constructor.
Camera default constructor does not create the underlying native camera
object. Thus calling _enableShutterSound after the default constuctor
causes application crash.

Bug: 132362603
Bug: 80498247
Test: ARC++ Eve/Kevin:
        Manually modify the code to return MODE_IGNORED for
        AppOpsService#checkAudioOperation() and to return false for
        CameraManager#supportsCamera2ApiLocked. Then start voice call in
        Hangouts.
      cf_x86_phone with camera HALv1 enabled:
        New CTS test
Change-Id: Ia232dd71da15fda31c4dbe5568ba5083cbfaed9b
Merged-In: Id738c4d46a8e3625bc3b1142b11acac9cfb0b603
2019-05-09 13:39:25 -07:00
Robert Carr
dc49e0088a [RESTRICT AUTOMERGE]: Exclude secure layers from most screenshots taken by the system server.
In pre-P versions of Android, it was allowed to screenshot secure layers if the
buffer queue producer which was the target of the screenshot was owned by
the system (in this case SurfaceFlinger). This really was a synonym for:
The screen rotation animation was allowed to capture secure layers, but the other
code paths weren't. In O we mistakenly changed this check to always allow the system server
to capture secure layers via the captureScreen path (the captureLayers path used for
TaskSnapshots was unaffected). This can result in data leakage in cases where the
system server takes screenshots on behalf of other parts of the system (e.g. for
the assistant). To mitigate this we provide an explicit switch for the system server
to specify whether it wishes to capture Secure layers. While this is dangerous, I think
it is less dangerous than the previous implicit switch of capturing secure layers based on which
type of BufferQueue was passed in. The flag defaults to not capturing secure layers
and we set it to true in the one place we need it (for the screen rotation animation).
Non privileged clients can still not capture secure layers at all directly.

Test: TransactionTest.cpp#SetFlagsSecureEUidSystem
Bug: 120610669
Change-Id: I9d32c5ac2b005059be9f464859a415167d9ddbd4
2019-05-02 18:50:09 -07:00
Yin-Chia Yeh
5b09928b22 Merge "Camera: add QCIF resolution exception" into pi-dev 2019-04-02 19:07:19 +00:00
Yin-Chia Yeh
428256d258 Camera: add QCIF resolution exception
Also fix a typo.

Test: checkbuild
Bug: 120158047
Bug: 122461651
Change-Id: I61eab3f526e307b04a71c8382e9fa76aee7871e1
2019-04-01 12:40:51 -07:00
Rich Cannings
820b2504f3 DO NOT MERGE Refactor passwords/pins/patterns to byte[]
Relating to frameworks/base

Bug: 120484642
Test: manual - test setting and unlocking passwords/pins/patterns.
      automated - atest services/tests/servicestests/src/com/android/server/locksettings/

Change-Id: I57aa530ca2db1a026c56b66f5b4c91172f2667f6
(cherry picked from commit f64ec63a02)
2019-03-19 11:13:18 -07:00
TreeHugger Robot
a24113f030 Merge "Remove ConnectivityManager and its usages from NetworkStatsService." into pi-dev 2019-03-19 02:00:38 +00:00
Shimi Zhang
ce222afda7 onPageFinished javadoc cleanup
PictureListener was deprecated, we need to replace its mentioning in
onPageFinished() javadoc with postVisualStateCallback().

Bug: 125939241
Test: make ds-docs
Change-Id: I7c1641c86632bb6c8214fd701e052096952deeec
2019-03-11 19:30:58 +00:00
Varun Anand
47a6760c76 Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

This change also is cherry-picking cleanup made to NSS in
http://aosp/628368.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: Ia687845888434c8ddd24bdf44b4c70dfe80e03f5
Merged-In: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6
2019-03-01 03:32:23 +00:00
Qasid Ahmad Sadiq
4d70022b88 Revert "Fix a11y cache correctness bug"
This fix introduced a painful crash that ends up disabling accessibility
services for certain users.
This happens when a client of AccessibilityCache tries to add a node, with the same id as a node previously in the cache, but fewer children, where the removed child is not in the cache.
This is because, when children are removed, and a the node is updated, the cache tries to clear the child trees. But if the child is not in the cache, the cache clears the whole tree. Every node is recycled.
Then the original node being replaced is attempted to be recycled again, and voila crash.

The fix also didn't fix the original issue based on the discussion in
b/114133438.

The risk for this is pretty low, since nothing was built on top of this.

This reverts commit 2f69c16c3d.
Bug: 124676705
Test: Tested to see if above usecase still happens.

Change-Id: I8a39698c4532a1613ba47e1c6ca70201cd496212
2019-02-21 21:07:12 -08:00
TreeHugger Robot
bec9d394d3 Merge "Clarify WebResourceResponse's stream handling." into pi-dev 2019-02-21 04:32:58 +00:00