Commit Graph

93832 Commits

Author SHA1 Message Date
Alex Buynytskyy
a5dd59db6d Always restart apps if base.apk gets updated.
Bug: 219044664
Fixes: 219044664
Test: atest PackageManagerShellCommandTest
Change-Id: I27a0c5009b2d5f1ea51618b9acfa1e6ccee71296
Merged-In: I27a0c5009b2d5f1ea51618b9acfa1e6ccee71296
2022-03-09 00:48:11 +00:00
Wu Ahan
b6509bdc18 Revert "DO NOT MERGE: Decode the input of both setStream and setResource calls first"
This reverts commit 4d91b5aa0b.

Reason for revert: will deliver a better fix for that, ag/16580245.

Change-Id: I8691f47251157aae83d326eb808dd1c06b13a420
2022-01-13 14:41:40 +00:00
Wu Ahan
4d91b5aa0b DO NOT MERGE: Decode the input of both setStream and setResource calls first
The size of the input of both setStream and setResource may very big
that system server got oom while handling it, so we try to decode it
first before copying it to the wallpaper path, if the decoding fails, we
treat the input as an invalid input.

Bug: 204087139
Test: Manually set wallpaper, no PDoS observed.
Change-Id: I014cf461954992782b3dfa0dde67c98a572cc770
2021-12-06 03:16:20 +00:00
TreeHugger Robot
204ab511e0 Merge "DO NOT MERGE Bluetooth: Fix formatting in getAlias()" into qt-dev 2021-09-02 01:20:06 +00:00
Hansong Zhang
e15791bbe1 DO NOT MERGE Bluetooth: Fix formatting in getAlias()
Bug: 180747689
Test: manual
Change-Id: Ic309f4aad116fd424d5d0d0e2016d61be8826b78
Merged-In: Ic309f4aad116fd424d5d0d0e2016d61be8826b78
2021-09-01 21:18:43 +00:00
TreeHugger Robot
b65ac540d2 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev am: a0226b4d47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405290

Change-Id: I0073721ed49e40043625eae71f37e7e95b987340
2021-09-01 00:34:01 +00:00
TreeHugger Robot
a0226b4d47 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev 2021-09-01 00:11:36 +00:00
Aseem Kumar
5beff34b57 Prevent apps from spamming addAccountExplicitly.
See comment here for the discussion on solution
https://b.corp.google.com/issues/169762606#comment14

Change-Id: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253

Bug: 169762606
(cherry picked from commit 11053c17b3)

Change-Id: I6494366a5695daedc3f4f0046da9e130a5363f5f
Merged-In: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253
2021-08-19 09:52:26 +00:00
Rhed Jao
eeb7b8088a Merge "DO NOT MERGE Apply a maximum char count to the load label api" into qt-dev 2021-08-11 03:39:57 +00:00
Jayant Chowdhary
250fe56a43 Merge "camera2: Fix exception swallowing in params classes createFromParcel" into oc-mr1-dev am: b8ce7ca6a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15134188

Change-Id: I5b6f88fae24d84d5ca766e9dc3ef8863b7d35f9c
2021-08-10 00:41:08 +00:00
Jayant Chowdhary
b8ce7ca6a1 Merge "camera2: Fix exception swallowing in params classes createFromParcel" into oc-mr1-dev 2021-08-10 00:28:42 +00:00
Jayant Chowdhary
93e157955a Merge "camera2: Fix exception swallowing in params classes createFromParcel" into qt-dev 2021-08-09 15:12:22 +00:00
Rhed Jao
7380c153b9 DO NOT MERGE Apply a maximum char count to the load label api
The system is overwhelmed by an enormous label string returned by
the load label api. This cl truncates the label string if it exceeds
the maximum safe length.

Also update the max safe label length to 1000 characters, which is
enough.

Bug: 67013844
Test: atest PackageManagerTest
Change-Id: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
Merged-in: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
2021-08-03 14:00:18 +08:00
Rhed Jao
b55d314f46 DO NOT MERGE Apply a maximum char count to the load label api
The system is overwhelmed by an enormous label string returned by
the load label api. This cl truncates the label string if it exceeds
the maximum safe length.

Also update the max safe label length to 1000 characters, which is
enough.

Bug: 67013844
Test: atest PackageManagerTest
Change-Id: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
Merged-in: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
2021-08-02 22:46:59 +08:00
Rhed Jao
6172201637 DO NOT MERGE Apply a maximum char count to the load label api
The system is overwhelmed by an enormous label string returned by
the load label api. This cl truncates the label string if it exceeds
the maximum safe length.

Also update the max safe label length to 1000 characters, which is
enough.

Bug: 67013844
Test: atest PackageManagerTest
Change-Id: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
Merged-in: Ia4d768cc93a47cfb8b6f7c4b6dc73abd801809bd
2021-08-02 19:44:04 +08:00
Bernardo Rufino
22500563c1 Merge "Fix background bypass via notifications" into qt-dev 2021-06-30 07:18:28 +00:00
Jayant Chowdhary
8a11538146 camera2: Fix exception swallowing in params classes createFromParcel
Do not catch exceptions when we attempt to create the following classes
from a parcel
- OutputConfiguration
- VendorTagDescriptor
- VendorTagDescriptorCache
- SessionConfiguration
This could cause subsequent parcel information to be read incorrectly.

Bug: 188675581

Test: Sample app which tries to write invalid data into an
      OutputConfiguration parcel to send in an intent via Broadcast. When read by the receiving app,
      gets an exception (not swallowed).

Merged-In: I745ca49daa6ca36b1020d518e9f346b52684f2b1
Change-Id: I745ca49daa6ca36b1020d518e9f346b52684f2b1
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 6b0bcd60c8)
2021-06-29 01:08:28 +00:00
Jayant Chowdhary
7bf30cb92a camera2: Fix exception swallowing in params classes createFromParcel
Do not catch exceptions when we attempt to create the following classes
from a parcel
- OutputConfiguration
- VendorTagDescriptor
- VendorTagDescriptorCache
- SessionConfiguration
This could cause subsequent parcel information to be read incorrectly.

Bug: 188675581

Test: Sample app which tries to write invalid data into an
      OutputConfiguration parcel to send in an intent via Broadcast. When read by the receiving app,
      gets an exception (not swallowed).

Merged-In: I745ca49daa6ca36b1020d518e9f346b52684f2b1
Change-Id: I745ca49daa6ca36b1020d518e9f346b52684f2b1
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 6b0bcd60c8)
2021-06-28 20:32:50 +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
Seigo Nonaka
ae1912b62f Improve ellipsize performance
Instead of iterate all ellipsized characters, only iterate the necessary
ranges for copying.

Bug: 188913943
Test: atest CtsTextTestCases CtsGraphicsTestCases CtsWidgetTestCases
Change-Id: I3d03b1e3897e427c23fbe51315f412c57a4ce9e9
Merged-In: I3d03b1e3897e427c23fbe51315f412c57a4ce9e9
2021-06-08 20:38:08 -07:00
Seigo Nonaka
5238a7a79b Improve ellipsize performance
Instead of iterate all ellipsized characters, only iterate the necessary
ranges for copying.

Bug: 188913943
Test: atest CtsTextTestCases CtsGraphicsTestCases CtsWidgetTestCases
Change-Id: I3d03b1e3897e427c23fbe51315f412c57a4ce9e9
(cherry picked from commit 2c6121f3e3)
2021-06-08 19:37:07 +00:00
Seigo Nonaka
0c17ccc4af Improve ellipsize performance
Instead of iterate all ellipsized characters, only iterate the necessary
ranges for copying.

Bug: 188913943
Test: atest CtsTextTestCases CtsGraphicsTestCases CtsWidgetTestCases
Change-Id: I3d03b1e3897e427c23fbe51315f412c57a4ce9e9
(cherry picked from commit 2c6121f3e3)
2021-06-08 19:36:07 +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
Christopher Tate
b320763eb8 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: Ie917a4d1b4595a576c4ea5ea079ecc773000abdc
2021-03-19 04:24:37 +00:00
Christopher Tate
cfd88a8e24 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:24 +00:00
TreeHugger Robot
a9638beba3 Merge "[SettingsProvider] extend font size scale range" into qt-dev 2021-02-02 22:36:24 +00:00
Rob Carr
525770f7e8 Merge "DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL." into qt-dev 2021-01-26 19:27:40 +00:00
Rob Carr
e3f7644490 Merge "DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL." into oc-mr1-dev 2021-01-26 19:27:37 +00:00
Rob Carr
4f162df18e Merge "DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL." into pi-dev 2021-01-26 19:27:19 +00:00
Songchun Fan
c0b28414d5 [SettingsProvider] extend font size scale range
As per requested in b/176940932#comment3 and b/156260178#comment32,
extending the valid font size scale range to [0.25, 5].

Existing CTS tests still pass.

BUG: 156260178
Test: atest android.provider.cts.settings.Settings_SystemTest
Test: atest android.app.cts.ApplicationTest
Change-Id: Icff82d727d63da4353342b0f9a5ca3c2ae1671c1
(cherry picked from commit df8852a0b5)
Merged-In: Icff82d727d63da4353342b0f9a5ca3c2ae1671c1
2021-01-20 21:53:16 +00:00
Dmitry Dementyev
e1d00ab8b8 Protect account chooser activities against overlay. am: fedbadf57e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13194523

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iec137ae2642e0a5ac5247e9939c68d65179f02fd
2021-01-06 22:51:41 +00:00
TreeHugger Robot
7f2257fa0f Merge "Protect account chooser activities against overlay." into qt-dev 2021-01-06 21:50:26 +00:00
Robert Carr
9661bf7a40 DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL.
NO_INPUT_CHANNEL is a hidden WM flag that allows creation of a window
without an input channel. Unfortunately in releases prior to Android R
this would allow creation of a Window which will not be known to the
InputDispatcher at all. This means that the logic generating
FLAG_OBSCURED will work and a window will be able to overlay another
window without the overlayed window being notified. In Android R and
later this isn't a problem as the InputDispatcher is informed of all
windows, input channel or not. For past Android releases, this patch
disables NO_INPUT_CHANNEL for use outside of the WM.

Bug: 152064592
Test: Existing tests pass
Change-Id: I7e1f45cba139eab92e7df88d1e052baba0ae2cc6
2020-12-14 18:32:56 +00:00
Robert Carr
514b329776 DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL.
NO_INPUT_CHANNEL is a hidden WM flag that allows creation of a window
without an input channel. Unfortunately in releases prior to Android R
this would allow creation of a Window which will not be known to the
InputDispatcher at all. This means that the logic generating
FLAG_OBSCURED will work and a window will be able to overlay another
window without the overlayed window being notified. In Android R and
later this isn't a problem as the InputDispatcher is informed of all
windows, input channel or not. For past Android releases, this patch
disables NO_INPUT_CHANNEL for use outside of the WM.

Bug: 152064592
Test: Existing tests pass
Change-Id: I7e1f45cba139eab92e7df88d1e052baba0ae2cc6
2020-12-14 18:32:46 +00:00
Robert Carr
0fed2d8e7e DO NOT MERGE: WM: Only allow system to use NO_INPUT_CHANNEL.
NO_INPUT_CHANNEL is a hidden WM flag that allows creation of a window
without an input channel. Unfortunately in releases prior to Android R
this would allow creation of a Window which will not be known to the
InputDispatcher at all. This means that the logic generating
FLAG_OBSCURED will work and a window will be able to overlay another
window without the overlayed window being notified. In Android R and
later this isn't a problem as the InputDispatcher is informed of all
windows, input channel or not. For past Android releases, this patch
disables NO_INPUT_CHANNEL for use outside of the WM.

Bug: 152064592
Test: Existing tests pass
Change-Id: I7e1f45cba139eab92e7df88d1e052baba0ae2cc6
2020-12-14 18:32:39 +00:00
Dmitry Dementyev
fedbadf57e Protect account chooser activities against overlay.
Bug: 172841550
Test: manual
Merged-In: I1a16808426934f4a8d12410576d769443e4c2a04
Merged-In: I3cd5a94386f15cf60a7fe3095b00815e4a6485ae
Change-Id: I35dc86b5721a4531447a6d99d6c30f23543130cb
2020-12-14 09:09:18 -08:00
Dmitry Dementyev
6ff42dd2d2 Protect account chooser activities against overlay.
Bug: 172841550
Test: manual
Change-Id: I1a16808426934f4a8d12410576d769443e4c2a04
Merged-In: I3cd5a94386f15cf60a7fe3095b00815e4a6485ae
2020-12-14 09:08:42 -08:00
Songchun Fan
9af8c6364f [SettingsProvider] fix font size scale validator
BUG: 156260178
Test: builds
Change-Id: I32f3b7ece78ec8cc97c52a0484151a6a777aa9da
Merged-In: I32f3b7ece78ec8cc97c52a0484151a6a777aa9da
2020-12-07 14:06:34 -08:00
Diksha Gohlyan
dc6d643c77 Add back enforceReadPermission for getmetadata
Test: manually tested
Bug: 151095863

Change-Id: I29ef120c10c488550b85269e598aeb6ff9505038
Merged-In: I4f04f08f76d039196c2c67bac80d4a46ebec87f2
(cherry picked from commit 71ec29b050)
2020-12-02 20:08:37 +00:00
Dmitry Dementyev
fe16873a33 Merge "Ignore GrantCredentials call with unexpected calling uid." into pi-dev 2020-11-11 21:11:06 +00:00
Dmitry Dementyev
a064b69f18 Merge "Ignore GrantCredentials call with unexpected calling uid." into qt-dev 2020-11-11 21:10:46 +00:00
Dmitry Dementyev
6717abba6e Protect GrantCredentialsPermissionActivity against overlay. am: deddb784d0 am: 21e36702cd am: f312c9e864
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13021294

Change-Id: Ie0a25150cbbd4aeda11f41df9fecebcac4ba7089
2020-11-11 14:55:07 +00:00
Dmitry Dementyev
f312c9e864 Protect GrantCredentialsPermissionActivity against overlay. am: deddb784d0 am: 21e36702cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13021294

Change-Id: I3fe44a233948b572499797f954c304ab40d02f35
2020-11-11 14:23:35 +00:00
Dmitry Dementyev
21e36702cd Protect GrantCredentialsPermissionActivity against overlay. am: deddb784d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13021294

Change-Id: I37e60418b8f67f3223692d370ced45aae46a706f
2020-11-11 14:02:42 +00:00
Dmitry Dementyev
ece586e321 Ignore GrantCredentials call with unexpected calling uid.
Activity can be used only in two cases.
1) Calling uid matches uid grantee.
2) Calling uid is is system. This flow is used by getToken methods with
notifyAuthFailure=true.

Test: Existing CTS tests
Bug: 158480899
Merged-In: I1421c333b6cebb4f7cddcdd8766298f6872e933b
Change-Id: I18af48cf3cb4ad23a3e5b02a8ea1416aa5570dba
2020-11-10 16:08:43 -08:00
Dmitry Dementyev
10d8a114bb Ignore GrantCredentials call with unexpected calling uid.
Activity can be used only in two cases.
1) Calling uid matches uid grantee.
2) Calling uid is is system. This flow is used by getToken methods with
notifyAuthFailure=true.

Test: Existing CTS tests
Bug: 158480899
Change-Id: I1421c333b6cebb4f7cddcdd8766298f6872e933b
2020-11-10 16:05:58 -08:00
Dmitry Dementyev
f45dcfe1f5 Protect GrantCredentialsPermissionActivity against overlay.
Bug: 169763814
Test: manual
Change-Id: I15dd22791fcc61ef02b06ad51d9e4409d11c0181
2020-11-10 22:43:31 +00:00
Dmitry Dementyev
1d3492e181 Merge "Revert "Ignore GrantCredentials call with unexpected calling uid."" into pi-dev am: 888ba5ee1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13028859

Change-Id: I25446d7e0cb9eec2b98cf630bd85db30a007f6a0
2020-11-10 22:23:04 +00:00
Dmitry Dementyev
888ba5ee1a Merge "Revert "Ignore GrantCredentials call with unexpected calling uid."" into pi-dev 2020-11-10 21:44:51 +00:00
Dmitry Dementyev
c1097a8488 Revert "Ignore GrantCredentials call with unexpected calling uid."
This reverts commit 4f0084580d.

Reason for revert: Build breakage - b/172932743

Bug: 172932743
Change-Id: Iee0a5e2b84e5d89a206b099f75a15e714a332ff4
2020-11-10 21:44:34 +00:00