Commit Graph

77582 Commits

Author SHA1 Message Date
Dmitry Dementyev
0992000ace Check that Account Parcel has name and type.
Bug: 129287265
Test: manual
Change-Id: I8431eb27cc4c6dfd3048b28ff635474f14433308
(cherry picked from commit 32e8579638)
2020-11-06 00:37:40 +00:00
Tyler Gunn
e57c25a451 Backport sendBroadcastAsUserMultiplePermissions to oc-dev
Bug: 159373687
Test: Verify Settings still works correctly.

Change-Id: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
Merged-In: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
2020-09-29 03:18:18 +00:00
TreeHugger Robot
00ec7767a9 Merge "Accept repeated locale as an input of LocaleList construction." into oc-dev 2020-09-10 00:02:01 +00:00
Julia Reynolds
db023fcd73 DO NOT MERGE Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-08 15:50:36 +00:00
Seigo Nonaka
2cb650f9d0 Accept repeated locale as an input of LocaleList construction.
Repeated locale has not been accepted and IllegalArgumentException
is thrown. Instead of throwing exception, dropping repeated locale
instead.

Bug: 152410253
Test: atest LocaleListTest
Change-Id: I80f243678ac3024eaeb0349f770cff897df7f332
2020-09-04 02:14:08 +00:00
Linus Tufvesson
78fe3b0aa2 RESTRICT AUTOMERGE
This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20ai

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

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

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations
Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: cts-tradefed run cts -m CtsDisplayTestCases -t android.display.cts.VirtualDisplayTest
Test: Manually verfied that presentations are blocked on main display

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
2020-05-05 18:48:20 +01:00
Linus Tufvesson
59ba151854 RESTRICT AUTOMERGE
This reverts commit 0bb93d4b1c.

Reason for revert: Breaks apps using Presentation in combination with private virtual displays

Bug: 141745510
Change-Id: I6673946137d6b12fa725e6df1c936068dedc3787
2020-04-01 13:31:51 +00:00
Linus Tufvesson
0bb93d4b1c 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: manual test via test app
Change-Id: I2aaab1903dee54190338f7b6e49888aa51437108
2020-03-09 20:57:08 +00:00
Ryan Mitchell
93320661ca 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: 144028297
Test: atest android.security.cts.AssetManagerTest

Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
Merged-In: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
2020-01-16 20:48:57 +00:00
Yohei Yukawa
08aae90860 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
Merged-In: I6d11e4d6a84570bc2991a8552349e8b216b0d139
2019-11-12 02:40:42 +00:00
Seigo Nonaka
b730f1984f 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:12:04 +00:00
Seigo Nonaka
4ce901e405 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:33:07 +00:00
Jeff Sharkey
f8a2d069b4 Merge "RESTRICT AUTOMERGE Enable stricter SQLiteQueryBuilder options." into oc-dev 2019-09-12 16:33:21 +00:00
Jeff Sharkey
7633a081ab Merge "RESTRICT AUTOMERGE Strict SQLiteQueryBuilder needs to be stricter." into oc-dev 2019-09-12 16:33:13 +00:00
Jeff Sharkey
f683c688d5 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, 135269143
Test: cts-tradefed run cts -m CtsAppTestCases -t android.app.cts.DownloadManagerTest
Change-Id: Iec1e8ce18dc4a9564318e0473d9d3863c8c2988a
2019-09-11 23:52:37 +00:00
Jeff Sharkey
92e5e5e45c 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, 135269143
Test: cts-tradefed run cts -m CtsDatabaseTestCases -t android.database.sqlite.cts.SQLiteQueryBuilderTest
Change-Id: I6290afd19c966a8bdca71c377c88210d921a9f25
2019-09-10 18:08:57 +00: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
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
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
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
Abodunrinwa Toki
7c8a46e0dd DO NOT MERGE No smart text assist for unprovisioned device.
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
bit FrameworksCoreTests:android.widget.TextViewActivityTest
bit FrameworksCoreTests:android.widget.TextViewActivityMoutseTest
Bug: 120866126
Bug: 62745625
Merged-In: I360250a5c2a92d09c8d8f559b51c74f490f70c2c
Change-Id: I360250a5c2a92d09c8d8f559b51c74f490f70c2c
2019-02-04 21:26:48 +00:00
Tony Mak
d9e75a497e RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: runtest -x cts/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
Change-Id: Ib2ee544b5783234fba8ee2f93adf0b36b039520f
Merged-In: Ib2ee544b5783234fba8ee2f93adf0b36b039520f
2019-01-03 17:10:46 +00:00
Android Build Merger (Role)
3823545fee [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306 am: 363e47e676 am: efb165f557 am: b2b98a008b
Change-Id: I29c3f97af12987c8a1dd8a69529641d32d2dd172
2019-01-03 14:07:59 +00:00
Android Build Merger (Role)
b2b98a008b [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306 am: 363e47e676 am: efb165f557
Change-Id: Ibc588da08fbb6069989c7c97110e4cecea0b0ce5
2019-01-03 14:07:52 +00:00
Android Build Merger (Role)
efb165f557 [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306 am: 363e47e676
Change-Id: I828e0c99ab41935d20033c970b5131f2fcbf9085
2019-01-03 14:07:43 +00:00
Android Build Merger (Role)
363e47e676 [automerger] RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters. am: 73f398d306
Change-Id: I423ddd8df74bee8dbf7cd96009bbdffebf81b93a
2019-01-03 14:07:33 +00:00
Tony Mak
73f398d306 RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: runtest -x cts/tests/tests/text/src/android/text/util/cts/LinkifyTest.java

Change-Id: Id271cab8aef6b9b13ef17f1a8654c7616f75cf13
2019-01-03 14:07:30 +00:00
Jakub Pawlowski
f843ccbf9e Bluetooth: Check descriptors size in BluetoothHidDeviceAppSdpSettings
Bug: 119819889
Test: compilation
Change-Id: If51d0e2af74d99758f79a603d40cc2f5c84e4dde
Merged-In: If51d0e2af74d99758f79a603d40cc2f5c84e4dde
2018-11-30 07:22:04 +00:00
Varun Shah
ad02e59ac2 RESTRICT AUTOMERGE: Added an app id security check in isAppForeground.
ActivityManagerService#isAppForeground now checks if the caller has the
permission to view if an app is in the foreground.

Bug: 115384617
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.ActivityManagerTest#testIsAppInForegroundNormal
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.ActivityManagerTest#testIsAppInForegroundMalicious
Change-Id: I9602c89b2d40036e525c38960a08326dc74c6682
2018-11-07 23:37:18 +00:00
Steve Elliott
77c1f60801 DO NOT MERGE: Add configurable default setting for assistant componentname
By requiring an explicit default setting, it eliminates all ambiguous
states where a disambiguation would normally be shown. With this
change in place, at no point should a disambiguation be shown.

Test: manual
Bug: 111603898
Change-Id: Ib32dafbd3c6fcbe11186dc8ecab6b09c9b734067
Merged-In: Id39fdf700ed4ef08ebbc333b5452223430ac2e48
2018-10-19 20:11:08 +00:00
Jeff Sharkey
a1ec7b115c RESTRICT AUTOMERGE: Recover shady content:// paths.
The path-permission element offers prefix or regex style matching of
paths, but most providers internally use UriMatcher to decide what
to do with an incoming Uri.

This causes trouble because UriMatcher uses Uri.getPathSegments(),
which quietly ignores "empty" paths.  Consider this example:

    <path-permission android:pathPrefix="/private" ... />

    uriMatcher.addURI("com.example", "/private", CODE_PRIVATE);

    content://com.example//private

The Uri above will pass the security check, since it's not
technically a prefix match.  But the UriMatcher will then match it
as CODE_PRIVATE, since it ignores the "//" zero-length path.

Since we can't safely change the behavior of either path-permission
or UriMatcher, we're left with recovering these shady paths by
trimming away zero-length paths.

Bug: 112555574
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
Change-Id: Ibadbfa4fc904ec54780c8102958735b03293fb9a
2018-10-05 20:39:03 +00:00
Android Build Merger (Role)
50e06f25ac [automerger] RESTRICT AUTOMERGE: Recover shady content:// paths. am: 301d17e4dd am: 010585fe3c am: 6ef77aedac am: ae30765665
Change-Id: I0cd990dcdfb899fa419cf1b28934d4118c225937
2018-10-05 00:19:37 +00:00
Android Build Merger (Role)
ae30765665 [automerger] RESTRICT AUTOMERGE: Recover shady content:// paths. am: 301d17e4dd am: 010585fe3c am: 6ef77aedac
Change-Id: Id59316f6628fcabc71962bd9ca8ab15cbbfb8b6d
2018-10-05 00:19:27 +00:00
Android Build Merger (Role)
6ef77aedac [automerger] RESTRICT AUTOMERGE: Recover shady content:// paths. am: 301d17e4dd am: 010585fe3c
Change-Id: I5f8b88ca54c22bb978fc6c468259fec9e0e9898a
2018-10-05 00:19:19 +00:00
Android Build Merger (Role)
010585fe3c [automerger] RESTRICT AUTOMERGE: Recover shady content:// paths. am: 301d17e4dd
Change-Id: I80ac911a166e12eedf77518436808d4f3ede872c
2018-10-05 00:19:12 +00:00
Jeff Sharkey
301d17e4dd RESTRICT AUTOMERGE: Recover shady content:// paths.
The path-permission element offers prefix or regex style matching of
paths, but most providers internally use UriMatcher to decide what
to do with an incoming Uri.

This causes trouble because UriMatcher uses Uri.getPathSegments(),
which quietly ignores "empty" paths.  Consider this example:

    <path-permission android:pathPrefix="/private" ... />

    uriMatcher.addURI("com.example", "/private", CODE_PRIVATE);

    content://com.example//private

The Uri above will pass the security check, since it's not
technically a prefix match.  But the UriMatcher will then match it
as CODE_PRIVATE, since it ignores the "//" zero-length path.

Since we can't safely change the behavior of either path-permission
or UriMatcher, we're left with recovering these shady paths by
trimming away zero-length paths.

Bug: 112555574
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
Change-Id: Ibadbfa4fc904ec54780c8102958735b03293fb9a
2018-10-05 00:19:08 +00:00