Commit Graph

483519 Commits

Author SHA1 Message Date
András Kurucz
f31df62340 Truncate ShortcutInfo Id
Creating Conversation with a ShortcutId longer than 65_535 (max unsigned short), we did not save the conversation settings into the notification_policy.xml due to a restriction in FastDataOutput.
This put us to a state where the user changing the importance or turning off the notifications for the given conversation had no effect on notification behavior.

Fixes: 273729476
Test: atest ShortcutManagerTest2
Test: Create a test app which creates a Conversation with a long shortcutId. Go to the Conversation Settings and turn off Notifications. Post a new Notification to this Conversation and see if it is displayed.
Change-Id: I2617de6f9e8a7dbfd8fbeff589a7d592f00d87c5
Merged-In: I2617de6f9e8a7dbfd8fbeff589a7d592f00d87c5
2023-05-03 13:02:30 +00:00
Aaron Liu
2b3817680a Merge "DO NOT MERGE Dismiss keyguard when simpin auth'd and..." into rvc-dev 2023-04-19 17:30:06 +00:00
Winson Chung
7d8fd7a9e9 Merge "Only allow NEW_TASK flag when adjusting pending intents" into qt-dev am: a082fd92a4 am: a0237b2e83
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21327525

Change-Id: Ifef9764db9f05834e98d53e946028ce1b7a54463
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-19 09:00:10 +00:00
Winson Chung
a0237b2e83 Merge "Only allow NEW_TASK flag when adjusting pending intents" into qt-dev am: a082fd92a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21327525

Change-Id: I6815d23a9672f31048a650bb29de39880b698194
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-19 08:19:51 +00:00
Winson Chung
a082fd92a4 Merge "Only allow NEW_TASK flag when adjusting pending intents" into qt-dev 2023-04-19 07:24:18 +00:00
Nate(Qiang) Jiang
07272cfaee Merge "DO NOT MERGE: Limit the ServiceFriendlyNames" into rvc-dev 2023-04-18 17:23:33 +00:00
Aaron Liu
09f0047222 DO NOT MERGE Dismiss keyguard when simpin auth'd and...
security method is none. This is mostly to fix the case where we auth
sim pin in the set up wizard and it goes straight to keyguard instead of
the setup wizard activity.

This works with the prevent bypass keyguard flag because the device
should be noe secure in this case.

Fixes: 222446076
Test: turn locked sim on, which opens the sim pin screen. Auth the
screen and observe that keyguard is not shown.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:48fa9bef3451e4a358c941af5b230f99881c5cb6)
Merged-In: Ib2d5400e930fa4d6f7f98e46f32a290ba5f558f4
Change-Id: Ib2d5400e930fa4d6f7f98e46f32a290ba5f558f4
Cherry-picking this CL as a security fix

Bug: 222446076
Change-Id: If4360dd6ae2e5f79b43eaf1a29687ac9cc4b6101
2023-04-14 19:56:13 +00:00
Nate(Qiang) Jiang
23a890a43f Merge "DO NOT MERGE: Add size check on PPS#policy" into rvc-dev 2023-04-14 19:43:49 +00:00
Winson Chung
c62d2e1021 Only allow NEW_TASK flag when adjusting pending intents
Bug: 243794108
Test: atest CtsSecurityBulletinHostTestCases:android.security.cts.CVE_2023_20918
Change-Id: I5d329beecef1902c36704e93d0bc5cb60d0e2f5b
2023-04-14 19:23:04 +00:00
Nate(Qiang) Jiang
d1afd2c47d DO NOT MERGE: Add size check on PPS#policy
Bug: 275340417
Test: atest android.net.wifi
Change-Id: I6e6128b7ed5327da8dbc9186a82bef0f2e4197bb
2023-04-13 21:20:37 +00:00
Nate(Qiang) Jiang
6b1746ab6f DO NOT MERGE: Limit the ServiceFriendlyNames
Bug: 274445194
Test: atest android.net.wifi
Change-Id: Id4e16007531ba1ce3e3f9fa3d3111b5af57751be
2023-04-12 18:43:20 +00:00
TreeHugger Robot
1360ebb441 Merge "Import translations. DO NOT MERGE ANYWHERE" into rvc-dev 2023-04-06 06:12:02 +00:00
Michael Groover
00f3afecdb Merge "Limit the number of supported v1 and v2 signers" into rvc-dev 2023-04-05 00:38:04 +00:00
Bill Yi
2fe87df11e Import translations. DO NOT MERGE ANYWHERE
BUG:204554636

Auto-generated-cl: translation import
Change-Id: I1720c67e4361d9019b12fa5a510cd34918dfedb4
2023-04-04 11:24:47 -07:00
Michael Groover
6f6ee8a55f Limit the number of supported v1 and v2 signers
The v1 and v2 APK Signature Schemes support multiple signers; this
was intended to allow multiple entities to sign an APK. Previously,
the platform had no limits placed on the number of signers supported
in an APK, but this commit sets a hard limit of 10 supported signers
for these signature schemes to ensure a large number of signers
does not place undue burden on the platform.

Bug: 266580022
Test: Manually verified the platform only allowed an APK with the
       maximum number of supported signers.
Change-Id: I6aa86b615b203cdc69d58a593ccf8f18474ca091
2023-04-03 15:22:44 +00:00
Jeff DeCew
2f02357e1d Merge "[RESTRICT AUTOMERGE] Add BubbleMetadata detection to block FSI" into rvc-dev 2023-03-31 15:01:38 +00:00
Pavel Grafov
b4083e039e Merge "Enforce DevicePolicyManager.setUserControlDisabledPackages in AppStandbyController" into rvc-dev 2023-03-31 14:09:57 +00:00
Julia Reynolds
9fa258770e Merge "Allow filtering of services" into rvc-dev 2023-03-29 15:25:15 +00:00
Julia Reynolds
44dcb8351e Allow filtering of services
Test: ServiceListingTest
Bug: 260570119
Change-Id: Ib4740ba401667de62fa1a33334c2c1fbee25b760
Merged-In: Ib4740ba401667de62fa1a33334c2c1fbee25b760
2023-03-29 13:22:33 +00:00
TreeHugger Robot
36fd98e6b5 [automerger skipped] Merge "Handle invalid data during job loading." into qt-dev am: ba8c9b4f2d am: b59868db83 -s ours
am skip reason: Merged-In Id0ceba345942baf21177f687b8dd85ef001c0a9e with SHA-1 df1ba00dd9 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20026092

Change-Id: Ibacc09f78b4dca469da219441563597a03282ede
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 04:51:28 +00:00
TreeHugger Robot
b59868db83 Merge "Handle invalid data during job loading." into qt-dev am: ba8c9b4f2d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20026092

Change-Id: I3cbb3042328108ba2847cffede3f56c73d34290d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 04:24:56 +00:00
TreeHugger Robot
ba8c9b4f2d Merge "Handle invalid data during job loading." into qt-dev 2023-03-29 03:52:02 +00:00
Kweku Adams
a9d54c2d90 Handle invalid data during job loading.
Catch exceptions that may be thrown if invalid data ended up in the
persisted job file.

Bug: 246541702
Bug: 246542132
Bug: 246542285
Bug: 246542330
Test: install test app with invalid job config, start app to schedule job, then reboot device
Change-Id: Id0ceba345942baf21177f687b8dd85ef001c0a9e
(cherry picked from commit c98fb42b48)
Merged-In: Id0ceba345942baf21177f687b8dd85ef001c0a9e
2023-03-28 21:31:12 +00:00
TreeHugger Robot
2ef87719c8 Merge "Handle invalid data during job loading." into rvc-dev 2023-03-28 19:24:54 +00:00
Alex Johnston
552dbbc142 Enforce DevicePolicyManager.setUserControlDisabledPackages in AppStandbyController
When deciding an app's standby bucket, check if the
app has its user control disabled by an IT admin. If so,
the app should be the exempted restricted bucket.

Bug: 272042183
Test: atest AppStandbyControllerTests
Change-Id: I4279dc37f0e17aedb1c2a87468478248443a253e
Merged-In: I4279dc37f0e17aedb1c2a87468478248443a253e
(cherry picked from commit 269fcb6873)
2023-03-28 17:01:14 +00:00
Jeff DeCew
c60e264a55 [RESTRICT AUTOMERGE] Add BubbleMetadata detection to block FSI
Bug: 274759612
Test: atest NotificationInterruptStateProviderImplTest
Change-Id: I40e1aa6377b8a60d91cb2f4189df1e9a4a4578a2
2023-03-28 13:58:19 +00:00
Dmitry Dementyev
c162515bd5 Merge "Check key intent for selectors and prohibited flags" into rvc-dev 2023-03-23 19:51:55 +00:00
TreeHugger Robot
677e9e1181 Merge "[DO NOT MERGE] Prevent RemoteViews crashing SystemUi" into rvc-dev 2023-03-22 18:47:42 +00:00
Jean Chalard
230c7ab574 Merge "Sanitize VPN label to prevent HTML injection" into rvc-dev 2023-03-20 05:22:22 +00:00
Brian Lee
92114886bd Check key intent for selectors and prohibited flags
Bug: 265015796
Test: atest
FrameworksServicesTests: com.android.server.accounts.AccountManagerServiceTest
Change-Id: Ie16f8654337bd75eaad3156817470674b4f0cee3
(cherry picked from commit e53a963043)
Merged-In: Ie16f8654337bd75eaad3156817470674b4f0cee3
2023-03-16 22:49:22 +00:00
Valentin Iftime
cfc0b34432 [DO NOT MERGE] Prevent RemoteViews crashing SystemUi
Catch canvas drawing exceptions caused  by unsuported image sizes.

Test: 1. Post a custom view notification with a layout
	containing an ImageView that references a 5k x 5k image
2. Add an App Widget to the home screen with that has the
	layout mentioned above as preview/initial layout.

Bug: 268193777

Change-Id: Ib3bda769c499b4069b49c566b1b227f98f707a8a
Merged-In: Ib3bda769c499b4069b49c566b1b227f98f707a8a
2023-03-15 18:34:50 +01:00
Valentin Iftime
733089e71c [DO NOT MERGE] Wait for preloading images to complete before inflating notifications
NotificationContentInflater waits on SysUiBg thread for images to load, with a timeout
 of 1000ms.

Test: 1. Build a test app that posts MessagingStyle notifications with a huge image (8k+) set as data Uri.
 2. SystemUi should not ANR
 3. adb logcat | grep NotificationInlineImageCache  - shows timeout/cancellation logs

Bug: 252766417
Bug: 223859644

Change-Id: I341db60223214cf2282b5c0270e343e1ce95fa01
(cherry picked from commit 195043f40e)
Merged-In: I341db60223214cf2282b5c0270e343e1ce95fa01
2023-03-10 10:30:49 +01:00
Lucas Lin
2178216b98 Sanitize VPN label to prevent HTML injection
This commit will try to sanitize the content of VpnDialog. This
commit creates a function which will try to sanitize the VPN
label, if the sanitized VPN label is different from the original
one, which means the VPN label might contain HTML tag or the VPN
label violates the words restriction(may contain some wording
which will mislead the user). For this kind of case, show the
package name instead of the VPN label to prevent misleading the
user.

The malicious VPN app might be able to add a large number of line
breaks with HTML in order to hide the system-displayed text from
the user in the connection request dialog. Thus, sanitizing the
content of the dialog is needed.

Bug: 204554636
Test: N/A
Change-Id: I8eb890fd2e5797d8d6ab5b12f9c628bc9616081d
Merged-In: I8eb890fd2e5797d8d6ab5b12f9c628bc9616081d
2023-03-09 21:14:14 +09:00
Arthur Hung
33a2bc8f7a Merge "Fix WindowInputTests#testOverlapWindow failing (1/2)" into rvc-dev 2023-03-06 03:18:58 +00:00
Pinyao Ting
15ae228ddb Merge "Limit the number of shortcuts per app that can be retained by system" into rvc-dev 2023-03-05 06:41:17 +00:00
Pinyao Ting
2296ccfde0 Limit the number of shortcuts per app that can be retained by system
This is a second attempt at fixing the issue, the previous CL
ag/20642213 was reverted because it simply throws an exception when the
limit is reached, which causes apps to crash since chat apps tends to be
sending large amount of conversation shortcuts and they have no way to
know how many of these shortcuts are still cached by the system.

Instead of throwing an exception, this CL simply removes excessive
shortcuts to avoid crashes. Currently there is a limit on the number
of shortcuts an app can publish in respect to each launcher activity.
This CL further implements a global maximum of total number of shortcuts
that can be retained for an app to mitigate from any potential system
health issue.

When the global maximum is reached, ShortcutService will proactively
removes shortcuts from system memory. Cached shortcuts are removed
first, followed by dynamic shortcuts, using last updated time as
tie-breaker.

This CL additionally addresses an unexpected flow where re-publishing
previously removed shortcuts that are still retained by the system could
cause the total number of shortcuts to exceed previously set limit.

Bug: 250576066 233155034
Test: manual
Change-Id: I001c7a87b62aefa9487bf8efaf3cd02d7cb21521
Merged-In: I001c7a87b62aefa9487bf8efaf3cd02d7cb21521
2023-03-05 02:55:25 +00:00
arthurhung
657c2a4115 Fix WindowInputTests#testOverlapWindow failing (1/2)
The 'InputWindowInfo.isTrustedOverlay' function had been removed, we
have to indicate the trustedOverlay flag when fill input info to overlay
window.

Bug: 161789401
Bug: 158717144
Test: atest WindowInputTests
Change-Id: Idf17fd64c6a1399d04c51e3f0bd600dc4a84239a
Merged-In: Idf17fd64c6a1399d04c51e3f0bd600dc4a84239a
2023-03-04 17:08:19 +00:00
Mark Renouf
3062b80fb2 Prevent sharesheet from previewing unowned URIs
Bug: 261036568
Test: manually via supplied tool (see bug)
Change-Id: I21accf6f753d2f676f1602d6e1ce829c5ef29e9a
Merged-In: I582bacca197d814204b48b917a550f72dbde87d6
Merged-In: Ib3f5839d00c7cf09bca3b01fc0a8a6f0f4960993
Merged-In: Iee1a75ef6ecbf471badeb42d8ebea11e74d884c1
Merged-In: I83e93c373538460e38ec17f1fd8e39d7aea95c10
2023-03-04 12:27:28 +00:00
Hongwei Wang
81224e6f76 Merge "Remove Activity if it enters PiP without window" into rvc-dev 2023-03-04 01:20:30 +00:00
Ioana Alexandru
931093dfb4 Trim strings added to persistent snoozed notification storage.
This is a backport of ag/20581190 and includes the fix in ag/20778075.
Note that on this branch, clearData doesn't seem to actually clear persistent storage.

Bug: 258422365
Test: atest NotificationManagerServiceTest SnoozeHelperTest
Change-Id: If7c7db6694330ffbac551d044efadb26219fe17f
Merged-In: I5a2823f10053ea8c83c612a567d6d4f1b6af23e7
Merged-In: Ie809cb4d648a40622618e0fb374f36b6d8dc972a
Merged-In: If7c7db6694330ffbac551d044efadb26219fe17f
2023-03-03 21:41:05 +00:00
Jing Ji
5d4989646c Merge "DO NOT MERGE: ActivityManager#killBackgroundProcesses can kill caller's own app only" into rvc-dev 2023-03-03 00:43:37 +00:00
Linus Tufvesson
b612e74dc0 Merge changes from topic "aris-backport-rvc-dev" into rvc-dev
* changes:
  Make Activites touch opaque - DO NOT MERGE
  Revert "Make Activites touch opaque - DO NOT MERGE"
2023-03-01 17:55:16 +00:00
Linus Tufvesson
73ee4cb9c4 Make Activites touch opaque - DO NOT MERGE
Block touches from passing through activities by adding a dedicated
surface that consumes all touches that would otherwise pass through the
bounds availble to the Activity.

+ Keep displayId in sync for ActivityRecord

Bug: 194480991
Test: atest CtsWindowManagerDeviceTestCases:ActivityRecordInputSinkTests
Test: atest CtsWindowManagerDeviceTestCases:CrossAppDragAndDropTests
Test: atest CtsWindowManagerDeviceTestCases:PinnedStackTests
Test: Used "System > Developer Options > Simulate secondary display" to
test that moving activites between displays work as intended.

Change-Id: Idace4104c2708ce99309fa54fd44dd000e7f8894
2023-03-01 11:24:24 +01:00
Justin Dunlap
dd4ee68792 Revert "Make Activites touch opaque - DO NOT MERGE"
This reverts commit 74ce78dfb4.

Reason for revert: re-release due to functional regression

Change-Id: I71e2e889d1f2d026f708bdb617b73a5c7c10467d
2023-03-01 11:19:57 +01:00
Thomas Stuart
7e58d882e3 Merge "enforce stricter rules when registering phoneAccounts" into rvc-dev 2023-02-28 21:03:30 +00:00
Thomas Stuart
a66a3156e0 enforce stricter rules when registering phoneAccounts
- include disable accounts when looking up accounts for a package to
  check if the limit is reached (10)
- put a new limit of 10 supported schemes
- put a new limit of 256 characters per scheme
- put a new limit of 256 characters per address
- ensure the Icon can write to memory w/o throwing an exception

bug: 259064622
bug: 256819769
Test: cts + unit
Change-Id: Ia7d8d00d9de0fb6694ded6a80c40bd55d7fdf7a7
Merged-In: Ia7d8d00d9de0fb6694ded6a80c40bd55d7fdf7a7
2023-02-27 17:10:31 +00:00
Hongwei Wang
4fad145640 Remove Activity if it enters PiP without window
This is to prevent malicious app entering PiP without being visible
first, like blocking onResume from completion. Which in turn
leaves the PiP window in limbo and non-interactable.

Bug: 265293293
Test: atest PinnedStackTests
Change-Id: I458a9508662e72a1adb9d9818105f2e9d7096d44
2023-02-24 11:34:13 -08:00
Manjeet Rulhania
74184991b7 Rely on Display#getRealSize when dumping XML hierarchy
* Previously, the height returned by Display#getSize was used to
  determine visible objects. Based on the API level and the presence of system decorations (e.g. notches), this can cause objects near the
  bottom of the screen to be considered out of bounds (i.e. only objects
  within y=0 and y=partial_height are considered even if the omitted
  decorations are at the top of the screen). cherry pick from aosp/2384832

Bug: 236669488
Test: manual
Merged-In: Iba21245c947cec0d0054f6d86e3585ba73233223
Change-Id: I50f143528d1f5a5b677eb2628efbcd658f4cc1b0
(cherry picked from commit afebeb7b43)
2023-02-23 00:54:52 +00:00
TreeHugger Robot
546d9f8e41 Merge "Uri: check authority and scheme as part of determining URI path" into rvc-dev 2023-02-22 16:41:07 +00:00
Daniel Norman
553232c290 Checks if AccessibilityServiceInfo is within parcelable size.
- If too large when parsing service XMLs then skip this service.
- If too large when a service attempts to update its own info
  then throw an error.

Bug: 261589597
Test: atest AccessibilityServiceInfoTest
Change-Id: Iffc0cd48cc713f7904d68059e141cb7de5a4b906
Merged-In: Iffc0cd48cc713f7904d68059e141cb7de5a4b906
2023-02-12 21:03:07 +00:00