Commit Graph

15650 Commits

Author SHA1 Message Date
Alex Johnston
d5146f80cc Stop managed profile owner granting READ_SMS
Reason: There is only one telephony stack shared
between the personal and work profile.

Bug: 194382185
Bug: 189942529
Test: build
Change-Id: If0d27a317a7c0ee46af371b30208327e5636c7cf
2021-10-05 11:44:37 +00:00
Bernardo Rufino
14c1c7b4a7 Fix background bypass via notifications
This is a CP of ag/14736230 to qt-dev.

Apps were able to bypass BAL and BG-FGS restrictions by retrieving their
own notifications and firing their PI since those were allowlisted for
those operations.

Now we strip the token that granted them that ability
from notifications returned via NM.getActiveNotifications(), which
returns the notifications of the caller.

Notifications returned via notification listener APIs still contain such
token, as they should.

Bug: 185388103
Bug: 169821287
Test: Manually tested
Change-Id: I2ede0d639a560f6acacec3864a0a7d23af152ba5
Merged-In: I2ede0d639a560f6acacec3864a0a7d23af152ba5
(cherry picked from commit 5fbeff59df)
2021-06-24 18:15:04 +00:00
Christopher Tate
88380a00d5 DO NOT MERGE - Disallow deletion of channels with FGS notifications
Bug: 156090809
Test: atest CtsAppTestCases:NotificationManagerTest
Test: atest CtsAppTestCases:android.app.cts.ServiceTest
Change-Id: I1c2bb78d86f194585d273661cecf3419f51965df
Merged-In: I1c2bb78d86f194585d273661cecf3419f51965df
2021-03-19 04:24:45 +00:00
Pinyao Ting
149bb7e038 Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 19:06:32 +00:00
TreeHugger Robot
06adb3f55c Merge "Sanitize more of the notification text fields" into pi-dev am: c0ec138c47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12512485

Change-Id: Ie8e9b9a1273f5fd48a038f16749a7ecdd85078cf
2020-09-09 23:57:36 +00:00
Julia Reynolds
7857da6431 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-03 19:38:08 +00:00
Linus Tufvesson
d663d274ea 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: atest CtsWindowManagerDeviceTestCases:android.server.wm.PresentationTest CtsDisplayTestCases:android.display.cts.VirtualDisplayTest

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
2020-05-05 11:13:51 +01:00
Linus Tufvesson
7faec2493b RESTRICT AUTOMERGE
This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20a

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: atest CtsWindowManagerDeviceTestCases:android.server.wm.PresentationTest CtsDisplayTestCases:android.display.cts.VirtualDisplayTest

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
2020-05-01 18:34:59 +01:00
Linus Tufvesson
0b23243935 Merge "RESTRICT AUTOMERGE" into pi-dev 2020-04-02 13:31:56 +00:00
Linus Tufvesson
04897a9bbd Merge "RESTRICT AUTOMERGE" into qt-dev 2020-04-02 13:31:13 +00:00
Linus Tufvesson
a9211d687d RESTRICT AUTOMERGE
Revert submission 10383599-type-presentation-q

Reason for revert: Breaks apps using Presentation in combination with private virtual displays
Reverted Changes:
I2aaab1903:RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows...
Ib5a24f8be:RESTRICT AUTOMERGE Add test for Presentation

Bug: 141745510

Change-Id: I0b3a332c286900952b65ece12435f981e324cb5b
2020-03-31 17:39:41 +00:00
Linus Tufvesson
b235ee8617 RESTRICT AUTOMERGE
Revert submission 10446362-type-presentation-p

Reason for revert: Breaks apps using Presentation in combination with private virtual displays
Reverted Changes:
Ib5a24f8be:RESTRICT AUTOMERGE Add test for Presentation
I2aaab1903:RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows...

Bug: 141745510

Change-Id: I9e8a02d5162cd5f8fb0f1860c4d4f099c718a946
2020-03-31 17:37:45 +00:00
TreeHugger Robot
3d4cf34685 Merge "RESTRICT AUTOMERGE Block TYPE_PRESENTATION windows on default display" into qt-dev 2020-03-11 19:25:05 +00:00
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
Linus Tufvesson
60a6583adf 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 CtsWindowManagerDeviceTestCases -t android.server.wm.PresentationTest
Change-Id: I2aaab1903dee54190338f7b6e49888aa51437108
2020-03-04 10:01:09 -08:00
Christopher Tate
38567a6051 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-02-05 12:32:21 -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
TreeHugger Robot
99fd132c3a Merge "DO NOT MERGE: Adds artificial package handler latency" into qt-dev 2020-01-27 20:08:14 +00:00
Kevin Hufnagle
08a4e470b8 docs: Fix typo in IMPORTANCE_SERVICE description
Test: make ds-docs -j32

Bug: 140783404

Change-Id: Ife86109eebefe9c87f7c9ed4a0587676e3392d90
Exempt-From-Owner-Approval: Docs-only change
2020-01-03 20:05:31 +00:00
Patrick Baumann
de626c28d7 DO NOT MERGE: Adds artificial package handler latency
This change introduces a means of introducing an artificial long task to
the package handler to help reproduce timing issues related to it.

Bug: 141413692
Test: atest PackageManagerTest
Change-Id: I61ddee1fe8b94f5803d981a77babb4bb19e31662
2019-12-18 20:15:26 +00:00
Kevin Hufnagle
1ec7235ebe Merge "docs: Updated desc. of lockNow() method and its overload" into qt-dev 2019-11-18 21:47:10 +00:00
Kevin Hufnagle
496c0bae14 docs: Updated desc. of lockNow() method and its overload
Explains in more complete detail who should call lockNow(), when to call the method,
and what happens when there's no lock set on a device.

Test: make ds-docs -j32

Bug: 28831838
Change-Id: I5acc0cbfa63dffe8676e8b60476b584fd43b5bde
2019-11-15 19:44:11 +00:00
Philip P. Moltmann
f3ff750f29 [DO NOT MERGE] Split access-media-storage from read-external-storage
And also pre-grant it to all apps that currently get any storage
permission pre-granted

Test: atest SplitPermissionTest
      m -j gts && gts-tradefed run commandAndExit gts-dev -m GtsPermissionTestCases --test=com.google.android.permission.gts.DefaultPermissionGrantPolicyTest#testDefaultGrantsWithRemoteExceptions
      Manual testing:
         All combinations of
           - App targetSdk = 28 and 29 (and 22 for extra credit)
           - App having the <uses-permission> tag for
             ACCESS_MEDIA_LOCATION or not
           - Upgrade from P->Q-QPR and from vanilla Q->Q-QPR
         Further upgrade of targetSdk from 28->29 while on Q-QPR
         ==> All permission behavior should make sense. Sometimes there
             are weird, but expected behaviors. Hence we need to
             collect the results and then look at the unexpected ones.
             See SplitPermissionTest for some tests I added for the
             location-background permission which was split from
             the fine/coarse-location permissions
Fixes: 141048840,140961754
Change-Id: Ib9f50d25c002036f13cf2d42fc4d1b214f20920c
(cherry picked from commit ac7b10c135)
2019-10-24 16:02:01 +00:00
Kevin Hufnagle
2a082b1e9e Merge "docs: List BIOMETRIC_WEAK in setPasswordQuality()" into qt-dev 2019-09-23 22:45:45 +00:00
Kevin Hufnagle
6e159aa9b9 docs: List BIOMETRIC_WEAK in setPasswordQuality()
Also converted curly quotes to straight in one of the notes.

Test: make ds-docs -j32

Bug: 135089189
Change-Id: I146fb7eec5da48496467a1bc7706f9d87dc339f7
2019-09-11 20:06:00 +00:00
Jeff Sharkey
13f49c4259 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-10 11:07:32 -07: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
a6364d92ed fixes a security vulnerability in slice provider
Bug: 138441555
Test: Manual
Change-Id: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
Merged-In: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
(cherry picked from commit 2b415a4c44)
2019-08-28 23:45:04 +00: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
Prabir Pradhan
03dde38efc apply empty transaction in startActivitySync
Force SurfaceFlinger to update synchronously by applying an empty
transaction. Without this, SurfaceFlinger will only update after the
next vsync, which may only happen after the instrumentation already
starts.

Since InputFlinger will only have the proper InputWindowInfo after
SurfaceFlinger updates, waiting for the vsync caused some
instruemntation tests to be flaky.

Bug: 138263890
Test: atest android.view.cts.HoverTest
Change-Id: I5457ab67ac574530dc1aa84549ca11e7e3f0d714
2019-08-07 12:59:01 -07:00
Kevin Hufnagle
4fbcec13a0 docs: Clarified when onRestoreInstanceState() executes
This method executes only after onDestroy() is called.

Change-Id: I4880cc98ea08945f30b16baa7ae400a5bbe3e439
Test: make ds-docs
Bug: 136241777
2019-08-02 15:43:33 +00:00
TreeHugger Robot
2ac934280c Merge "AM: make isHighEndGfx TestApi" into qt-dev 2019-07-16 16:11:19 +00:00
Adrian Roos
5af40871ea AM: make isHighEndGfx TestApi
Bug: 136784434
Test: n/a
Change-Id: Ie26de8dcf64a02b7757d4f705485cdcb7470f511
2019-07-15 12:05:54 +02:00
TreeHugger Robot
261a2d62e2 Merge "Update docs for UID_STATE" into qt-dev 2019-07-09 17:25:49 +00:00
Svet Ganov
6f672a3835 Specify the duration time base
Test: N/A

Bug: 128316830

Change-Id: Idd8f1aaf1a8e0013c01fdf4d668f9d5e81101559
2019-07-08 16:40:45 -07:00
Svet Ganov
05fcd228b5 Update docs for UID_STATE
Test: N/A

Bug: 128919932

Change-Id: Ibac690db3b58293082f762800bbbff0f832a16b2
2019-07-08 16:30:48 -07:00
Louis Chang
ea203cdbdf Avoid making post state to RESUMED for a PAUSING activity
Make sure the client post execution lifecycle state to RESUMED
only if the activity was RESUMED while delivering new intent.

Bug: 135715788
Test: making skype calls
Test: atest ActivityThreadTest

Change-Id: I1e3054e1d1611aecf6ddf6d482abf2cb3ebdf9a4
2019-07-03 09:44:12 +08:00
TreeHugger Robot
f76bdce6e0 Merge "Restore some greylist entries." into qt-dev 2019-06-28 12:02:43 +00:00
Mathew Inwood
3a75f264a8 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I5ac8b8b9b23c3789d80239cf456072cc7dfa1203
2019-06-28 10:15:37 +01:00
David Nelloms
22a5e4e5d9 Merge "Notify on task display change." into qt-dev 2019-06-28 00:12:49 +00:00
davidln
a06b4b2fa5 Notify on task display change.
This is a targeted fix for not receiving a task stack change callback
when a task with a resumed Activity is reparented to another display.

Bug: 128932906

Test: manual - launch activity from virtual display onto default display
  in a new task, verify callback notified. atest WmTests
Change-Id: Idabad8379cded664bcf302d5c6fb69564d158eb7
Merged-In: Idabad8379cded664bcf302d5c6fb69564d158eb7
2019-06-27 18:54:00 +00:00
Hai Zhang
bae001170b Add link to AndroidX Role library in RoleManager documentation.
Fixes: 136119951
Test: presubmit
Change-Id: Iab4c8617983555b04d7c49b7f9583cf2132d57c8
2019-06-27 00:14:44 +00:00
Ioannis Ilkos
9af8d15783 Merge "Add anon RSS + swap metric" into qt-dev 2019-06-24 08:46:40 +00:00
Antoan Angelov
ab34f61c3b Merge "Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS." into qt-dev 2019-06-21 18:07:22 +00:00
Ioannis Ilkos
466ad6c3e0 Add anon RSS + swap metric
We are planning to use this metric to detect leaks.

This CL also decouples the actual memory sampling from AM. This means:
- Less time locking the pid list (we used to lock and then read proc)
- Less serialization / deserialization for the parcel
- Simpler to evolve (e.g. removed the HWM-specific method in AM)

Change-Id: I87a7243156dd8c88cfa85038e7e6cf4963e271e1
Test: manual, MemoryStatUtilTest, UidAtomTests
Bug: b/135418017
2019-06-21 11:10:19 +01:00
arangelov
bb2a802a23 Update docs for EXTRA_PROVISIONING_SKIP_EDUCATION_SCREENS.
Bug: Fixes: 134391678
Test: manual
Change-Id: I993af4f4a741283294b1754dfc0adc7c6f6f849e
2019-06-20 16:31:10 +01:00
Makoto Onuki
71acb72cbd Merge "Optionally trigger CG in onTrimMemory()" into qt-dev 2019-06-19 23:24:04 +00:00
Makoto Onuki
0a9ee1af2c Optionally trigger CG in onTrimMemory()
Set a trim-level threshold to debug.am.run_gc_trim_level to activate it.

Bug: 135148702
Test: Manual test with "setprop debug.am.run_gc_trim_level 0", run a lot of
heavy apps and take pictures, and check logcat for the "force_gc" event log.
Test: Manual test with "setprop debug.am.run_mallopt_trim_level 0", run a lot of
heavy apps and take pictures, and check logcat for a debug log.

Change-Id: I73b4dc7374e85e9a22c98ab17da53aa6cb25a188
2019-06-19 10:01:55 -07:00
Philip P. Moltmann
c073e956dc Mark getProfileOwnerAsUser(int) as UnsupportedAppUsage again
As it was in P. There are no public APIs created, hence there is no
better, _public_, alternative.

Fixes: 135282729
Test: none
Change-Id: I199cfcc125f948b983eb55a199abf673cc58b7e1
2019-06-14 14:09:35 -07:00