Commit Graph

105701 Commits

Author SHA1 Message Date
Aseem Kumar
9050942832 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: Ic65162df3415275514f6277891a9412865e2315b
Merged-In: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253
2021-08-20 17:11:57 +00:00
Jayant Chowdhary
9e82fb98ed Merge "camera2: Fix exception swallowing in params classes createFromParcel" into qt-dev am: 93e157955a am: 0cf6fdb791 am: 3c93e01ccf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15121727

Change-Id: I0dc4ada4e6e664d8517c710b8b905dffa825b2c0
2021-08-09 15:45:20 +00:00
Jayant Chowdhary
3c93e01ccf Merge "camera2: Fix exception swallowing in params classes createFromParcel" into qt-dev am: 93e157955a am: 0cf6fdb791
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15121727

Change-Id: I1adb4fa9ae369c1eabbd3fcbdac7abf4425743bb
2021-08-09 15:30:32 +00:00
Jayant Chowdhary
0cf6fdb791 Merge "camera2: Fix exception swallowing in params classes createFromParcel" into qt-dev am: 93e157955a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15121727

Change-Id: Id144b968bf5154f806900e030d2b7bd9ba407c67
2021-08-09 15:20:58 +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
TreeHugger Robot
17d1be8efc Merge "Revert "wifidisplay: restrict broadcast by the proper permission"" into rvc-dev am: 30c6383d1d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15287612

Change-Id: I2fba182703b7e2362a0cd0934903c6a2af849751
2021-07-20 02:31:53 +00:00
TreeHugger Robot
30c6383d1d Merge "Revert "wifidisplay: restrict broadcast by the proper permission"" into rvc-dev 2021-07-20 02:13:10 +00:00
Jimmy Chen
955b64a6e7 Revert "wifidisplay: restrict broadcast by the proper permission"
This reverts commit cff8340c84.

Reason for revert: Remove from July 2021 Android Security Bulletin due to break existing applications.

Bug: 176541017
Change-Id: Iacef744056630e85fb43d838a72abfae331cbaf4
Test: install WFD application and check whether it works normally.
2021-07-15 00:56:19 +00:00
Bernardo Rufino
ccdf929a26 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1 am: 57af3050d2 am: f7c195b4e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I0811d754d2b7a796e22baeb62d047c732f8d9826
2021-06-30 16:06:07 +00:00
Bernardo Rufino
f7c195b4e9 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1 am: 57af3050d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I0bf46422d4f7d2621a33776a4c98375d566af117
2021-06-30 15:41:55 +00:00
Bernardo Rufino
57af3050d2 Merge "Fix background bypass via notifications" into qt-dev am: 22500563c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14937196

Change-Id: I193bfe3aa08c2f397d037c2d5c71cfe854cd343d
2021-06-30 15:30:23 +00:00
Bernardo Rufino
22500563c1 Merge "Fix background bypass via notifications" into qt-dev 2021-06-30 07:18: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
TreeHugger Robot
c5b814ec0a Merge "Improve ellipsize performance" into qt-dev am: 819dc46ad3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14904663

Change-Id: Ia1486957866ef76461718a679e956e7ee627cc7f
2021-06-26 02:45:31 +00:00
TreeHugger Robot
3f7f408f58 Merge "Improve ellipsize performance" into rvc-qpr-dev 2021-06-26 02:39:01 +00:00
TreeHugger Robot
b3b4990453 Merge "Improve ellipsize performance" into rvc-dev 2021-06-26 02:38:59 +00:00
Winson
f416e7b485 Remove ParsedIntentInfo CREATOR am: 75214cc510
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15080916

Change-Id: I4210bdd97953331cfe9e7cfbe30422fec91a2eac
2021-06-24 21:45: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
Winson
75214cc510 Remove ParsedIntentInfo CREATOR
Its existence allows implicit readParcelable calls to invoke a Parcel
operation with mismatched read/write data sizes, allowing someone to
swap out the data on a reparcel.

Internal classes will use writeIntentInfoToParcel, so this is safe to
remove.

Bug: 191055353

Test: atest com.android.server.pm.test.parsing.parcelling

Change-Id: I44faa635faf8a77894a3dda8adf89c10064e53f1
2021-06-23 18:04:15 +00:00
Seigo Nonaka
40d7a4535a 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:39 +00:00
Seigo Nonaka
599f1b76fa 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:25 +00: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
Aemon Cannon
d2317d0fac Merge "Add instrumented app to JAR path (isolated splits)" into qt-qpr1-dev 2021-04-28 22:38:41 +00:00
Christopher Tate
3c507386ca DO NOT MERGE - Disallow deletion of channels with FGS notifications am: 88380a00d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13728411

Change-Id: I5c649a005fb5ad7bd904b64d03488a6be6ff30f7
2021-04-27 21:22:35 +00:00
Jason O'Brien
472e9444ac Add instrumented app to JAR path (isolated splits)
The base APK is loaded during normal execution even when isolated splits
are requested. This preserves that behavior during instrumented tests,
which previously skipped the base APK (causing class loading errors).

Test: tested on device with a trivial automated instrumented test
Bug: 146183755
Change-Id: Ia54072ee91b7c06cb4a787a8954ad2e69b322cac
(cherry picked from commit 6f2978c9fc)
2021-04-19 22:04:25 +00:00
Chris Tate
68a604b920 Merge "DO NOT MERGE - Disallow deletion of channels with FGS notifications" into rvc-dev 2021-04-06 16:23:21 +00:00
Chris Tate
ced44641d9 Merge "DO NOT MERGE - Disallow deletion of channels with FGS notifications" into rvc-qpr-dev 2021-04-06 16:22:21 +00:00
Jayant Chowdhary
02622abbe2 getCameraIdListNoLazy : remove system cameras from mTorchStatus as well.
Bug: 182530469

Test: Make Emulator back camera system camera; atest FlashlightTest.java

Merged-In: I0a149ba3d93a740cfbfdc2d04c1235e648061156
Change-Id: I0a149ba3d93a740cfbfdc2d04c1235e648061156
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit bedb9950c8)
2021-04-02 18:55:48 +00:00
Jimmy Chen
e851fc58d6 Merge "wifidisplay: restrict broadcast by the proper permission" into rvc-qpr-dev 2021-04-01 01:42:28 +00:00
Seigo Nonaka
39c49f8daa Merge "Override isRestricted for preventing unexpected resource loading" into rvc-qpr-dev 2021-03-31 21:53:43 +00:00
Louis Chang
b6d433cdbd Merge "Dump warning logs to prevent app crash while no top-resumed changes" into rvc-qpr-dev 2021-03-31 06:15:30 +00:00
Shuzhen Wang
640011569f Camera: Fix a removal-while-iterate bug
The onStatusChangedLocked removes entries from the ArrayMap. Needs to
iterate in the reverse order.

Test: Vendor testing
Bug: 182876702
Change-Id: I5891f24a25c83f096d23ca5675126889a7d2a61c
2021-03-30 14:42:33 -07:00
Hui Yu
4221ca489c Merge "Allow FGS started from MediaButtonReceiver to have while-in-use permissions." into rvc-qpr-dev 2021-03-24 17:41:39 +00:00
Hui Yu
ebfad50cc1 Allow FGS started from MediaButtonReceiver to have while-in-use
permissions.

1. Create FgsWhileInUseTempAllowList, the uid on this list is allowed to
have while-in-use permission when the FGS is started from background for
a duration of time.
2. When media button is pressed, the targetUid is added to
FgsWhileInUseTempAllowList for the duration of 10 seconds, this way the
targetUid can start FGS from background and have while-in-use permission.
3. When checking for ProcessRecord.
mAllowBackgroundActivityStartsTokens, it is the caller app's
ProcessRecord should be checked instead of the service's ProcessRecord.

Bug: 182481312
Test: use b/167998084 reproduce steps, use Line app to make a voip call, the
 receiver side screen is unlocked, the receiver side uses bluetooth
headset button to pick up the call, "dumpsys activity -a" shows the FGS
"com.linecorp.voip.core.common.notification.VoipNotificationCommand" has
"allowWhileInUsePermissionInFgs=true" and "isForeground=true".

Change-Id: Ic80aefe4202fe2210881bb8eea24b6e34cb1e7d0
Merged-In: I32a14d675550cd262976bb8e16a48a070387d318
2021-03-23 23:19:19 -07: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
Louis Chang
ed9f50dd58 Dump warning logs to prevent app crash while no top-resumed changes
Applications crashed due to duplicated top resumed activity change
events. Currently, the only possible scenario we know if that the
application invokes Looper#loop() and reverse the messages order.

Write warning logs vs. throwing exceptions to prevent application
crashes.

Bug: 140571893
Test: build and boot pass
Change-Id: If6f6c502b96ccc11b230ba075c61118f03e13d5c
2021-03-19 02:37:37 +00:00
Christopher Tate
8cb7e0a881 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
(cherry picked from commit 39b3890268913bc2dc8b90671d042c0e9b4090d2)
2021-03-18 08:11:45 -07:00
Christopher Tate
2a33098b6c 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
(cherry picked from commit 39b3890268913bc2dc8b90671d042c0e9b4090d2)
2021-03-17 17:29:36 -07:00
Tobias Thierer
3a9dd32f61 Merge changes from topic "bug158482162_rvc-qpr-dev" into rvc-qpr-dev
* changes:
  Fix DevicePolicyManager.isBackupServiceEnabled() breakage.
  BackupManagerService: Make new behavior conditional on ChangeId.
  Enforce BACKUP permission on Service end.
2021-03-17 12:09:13 +00:00
Seigo Nonaka
ba987ca94f Override isRestricted for preventing unexpected resource loading
Bug: 179461812
Test: atest FontResourceTest
Change-Id: Ifb731310d31b80522bc82052625716083cac9e6f
(cherry picked from commit 0de34e9d87)
2021-03-12 19:32:27 +00:00
Jimmy Chen
cff8340c84 wifidisplay: restrict broadcast by the proper permission
WIFI_DISPLAY_STATUS_CHANGED event contains the MAC address of peers.
As the MAC address is PII data, this should be restricted by proper
permission.

Bug: 176541017
Test: install PoC in b/176541017 and check PII data is not leaked.
Change-Id: I36b85f44678fe232486702fa009f5f06d1a7af75
2021-03-11 12:07:46 +08:00
Jimmy Chen
fd8b6dabf9 wifidisplay: restrict broadcast by the proper permission
WIFI_DISPLAY_STATUS_CHANGED event contains the MAC address of peers.
As the MAC address is PII data, this should be restricted by proper
permission.

Bug: 176541017
Test: install PoC in b/176541017 and check PII data is not leaked.
Change-Id: I36b85f44678fe232486702fa009f5f06d1a7af75
2021-03-11 12:07:31 +08:00
Chris Li
0c603d91a7 Include whether in touch mode for WindowlessWindowManager
Fix: 179583920
Fix: 180530717
Test: manually with a windowless button
Change-Id: Ice37c3182a44c6284ffa8950996507025c59270b
Merged-In: Ice37c3182a44c6284ffa8950996507025c59270b
2021-03-10 21:11:34 +00:00
Hall Liu
5fa6de7421 Merge "Allow empty tokens in strict grammar" into rvc-dev 2021-03-04 02:25:54 +00:00
Hall Liu
c5c9242194 Merge "Allow empty tokens in strict grammar" into rvc-dev 2021-03-04 02:25:54 +00:00
Patrick Baumann
ec4ba204d8 Merge "Adds caller check to getAllPackages()" into rvc-qpr-dev 2021-03-02 23:10:45 +00:00
Abhijeet Kaur
804642bd6c Merge "Disable resetting WRITE_MEDIA_IMAGES and WRITE_MEDIA_VIDEO appops" into rvc-qpr-dev 2021-02-25 16:29:05 +00:00
Abhijeet Kaur
5630668181 Disable resetting WRITE_MEDIA_IMAGES and WRITE_MEDIA_VIDEO appops
App holding System Gallery role is allowed WRITE_MEDIA_* appops by
virtue of the role. This allows the System Gallery app write-access for
images and videos.

When app preferences are reset AppOpsService toggles the appops for
all apps. Only the appops mentioned in sOpDisableReset are not toggled.

Disable WRITE_MEDIA_* appops to reset, as the system gallery app loses
write access on images/videos.

Bug: 179133883
Test: Manual
Change-Id: I168221c641566a9f691ed7956c038206b114d802
Merged-In: I168221c641566a9f691ed7956c038206b114d802
(cherry picked from commit de862be6a8)
2021-02-23 19:09:10 +00:00
Daniel Peykov
41802905f9 Fix possible NPE when matching accessory version
As UsbAccessory#getVersion is nullable, a NPE can occur if the manufacturer/model match.

Bug: 172002066
Bug: 178227159
Bug: 180055624
Change-Id: I751a01e3d182e01e5a9dbc011b60535997f9bc15
(cherry picked from commit 25dca30e2f)
2021-02-23 09:11:52 +00:00
yawanng
9b694ef4d4 Adds caller check to getAllPackages()
This change enforces that only system, root or shell may call
getAllPackages(), a hidden API that shares all package names regardless
of user, instant app or package visibility rules.

The only exception is the uid of iorapd. iorapd needs the package info
to prefetch the right data.

Bug: 179618216
Bug: 174661955
Test: run iorapd and check it works well.
Change-Id: I77460ae19a4d41151577646441f11e2eddbb741a
(cherry picked from commit 8124efd57b)
2021-02-18 18:19:44 +00:00