Commit Graph

483505 Commits

Author SHA1 Message Date
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
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
Rhed Jao
1b0f4091fc Merge "[RESTRICT AUTOMERGE] Fix bypass BG-FGS and BAL via package manager APIs" into rvc-dev 2023-02-07 02:01:24 +00:00
Songchun Fan
341669af52 [RESTRICT AUTOMERGE][pm] still allow debuggable for system app downgrades
Turns out we do have internal tests that downgrades system apps, so adding this exception to allow for that.

BUG: 267232653
BUG: 256202273

Test: manual
Change-Id: Ie281bbdc8788ee64ff99a7c5150da7ce7926235e
(cherry picked from commit ceeca68b8c)
2023-02-03 18:45:40 +00:00
Julia Reynolds
0f29716ab6 Add a limit on channel group creation
Same as exists for channels

This is a backport of the fix in ag/16659457, including the adjustment from ag/20920023 (changed the max value from 50000 to 6000).

Test: PreferencesHelperTest
Bug: 210114537
Bug: 261723753
Change-Id: Ic27efba4c54e22eebca16fc948879e652df4467b
(cherry picked from commit 37b3549807 & I3f3a99765c161369e1b026686a0e5f0c83ed839e)
Merged-In: I3f3a99765c161369e1b026686a0e5f0c83ed839e
Merged-In: Ic27efba4c54e22eebca16fc948879e652df4467b
2023-02-03 12:12:24 +00:00
Songchun Fan
aec76152d6 [RESTRICT AUTOMERGE][pm] prevent system app downgrades of versions lower than preload
Also remove misleading commandline output.

BUG: 256202273

Test: manual
1. Install preload system app v90, reboot
2. (W/O data, W/ Flag, 90->80 NOK) adb install -d ~/Downloads/PrivApplication_80.apk
Performing Streamed Install
adb: failed to install /usr/local/google/home/schfan/Downloads/PrivApplication_80.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: System app: com.example.privapplication cannot be downgraded to older than its preloaded version on the system image. Update version code 80 is older than current 90]
3. (90->100) Install data app v100
4. (W/ data, W/O Flag, 100->90 NOK) adb install ~/Downloads/PrivApplication_90.apk
Performing Streamed Install
adb: failed to install /usr/local/google/home/schfan/Downloads/PrivApplication_90.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: Downgrade detected: Update version code 90 is older than current 100]
5. (W/ data, W/ Flag, 100->90 downgrade OK) adb install -d ~/Downloads/PrivApplication_90.apk
Performing Streamed Install
Success
6. (90->100) Install v100
6. (W/data, W/ Flag, 100->80 NOK) adb install -d ~/Downloads/PrivApplication_80.apk
Performing Streamed Install
adb: failed to install /usr/local/google/home/schfan/Downloads/PrivApplication_80.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE: System app: com.example.privapplication cannot be downgraded to older than its preloaded version on the system image. Update version code 80 is older than current 90]

Change-Id: I5a8ee9e29a3a58f6e3fd188e0122355744b8b0ce
(cherry picked from commit a4484d7f1b)
2023-01-31 22:17:36 +00:00
Winson Chung
62c12ffd8e Merge "Revert "Ensure that only SysUI can override pending intent launch flags"" into qt-dev am: e6ffbc91fb am: b34c84221f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20946190

Change-Id: Ic7d4a98b4c83a84b73eb34180a9318fc53a116ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-21 06:47:56 +00:00
Winson Chung
b34c84221f Merge "Revert "Ensure that only SysUI can override pending intent launch flags"" into qt-dev am: e6ffbc91fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20946190

Change-Id: I65f295af8c9e627b531fafa717324fbf37cf3925
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-01-21 06:08:02 +00:00
Winson Chung
e6ffbc91fb Merge "Revert "Ensure that only SysUI can override pending intent launch flags"" into qt-dev 2023-01-21 05:01:52 +00:00
Rhed Jao
b0b1ddb4b4 [RESTRICT AUTOMERGE] Fix bypass BG-FGS and BAL via package manager APIs
Opt-in for BAL of PendingIntent for following APIs:

* PackageInstaller.uninstall()
* PackageInstaller.installExistingPackage()
* PackageInstaller.uninstallExistingPackage()
* PackageInstaller.Session.commit()
* PackageInstaller.Session.commitTransferred()
* PackageManager.freeStorage()

Bug: 230492955
Bug: 243377226
Test: atest android.security.cts.PackageInstallerTest
Test: atest CtsStagedInstallHostTestCases
Change-Id: I9b6f801d69ea6d2244a38dbe689e81afa4e798bf
2023-01-17 19:20:43 +08:00
Louis Chang
5603eb78f1 Merge "[RESTRICT AUTOMERGE] Strip part of the activity info of another uid if no privilege" into rvc-dev 2023-01-13 02:25:28 +00:00
Christophe Pinelli
e5bed43da4 Merge "[DO NOT MERGE] Backport BAL restrictions from S to R, this blocks apps from using Alarm Manager to bypass BAL restrictions." into rvc-dev 2023-01-11 23:40:30 +00:00
Winson Chiu
94b3091a5a Merge "Encode Intent scheme when serializing to URI string RESTRICT AUTOMERGE" into rvc-dev 2023-01-11 23:07:00 +00:00
Hao Ke
82a8fddc91 Merge "Fix checkKeyIntentParceledCorrectly's bypass" into rvc-dev 2023-01-11 19:09:28 +00:00
Winson Chung
48acfb0f1d Revert "Ensure that only SysUI can override pending intent launch flags"
This reverts commit c4d3106e34.

Reason for revert: b/264884187, b/264885689 

Change-Id: I9fb0d66327f3f872a92e6b9d682d58489e81e6ba
2023-01-11 18:58:41 +00:00
Louis Chang
e534fa2a71 [RESTRICT AUTOMERGE] Strip part of the activity info of another uid if no privilege
The activity info could be from another uid which is different
from the app that hosts the task. The information should be
trimmed if the caller app doesn't have the privilege.

However, removing the entire info may result in app compatibility
issues. So, only swiping the info that are sensitive to empty
string.

Bug: 243130512
Test: verified market app locally
Test: atest RecentTasksTest
Change-Id: I5b6775dd3c4e2ccdacd30741884d336b2eaa70da
Merged-In: I5b6775dd3c4e2ccdacd30741884d336b2eaa70da
(cherry picked from commit 5ba72200f6)
2023-01-10 05:11:15 +00:00