Commit Graph

419682 Commits

Author SHA1 Message Date
TreeHugger Robot
8a2baf4e16 Merge "[Do Not Merge] Ignore malformed shortcuts" into qt-dev 2022-10-03 20:23:07 +00:00
Matt Pietal
2663e8aa43 Merge "[DO NOT MERGE] Update window with FLAG_SECURE when bouncer is showing" into qt-dev 2022-09-27 19:25:13 +00:00
Pinyao Ting
5a292b8bf4 Merge "Fix a security issue in app widget service." into qt-dev 2022-09-23 19:57:23 +00:00
Julia Reynolds
261b601d25 Merge "Fix NPE" into qt-dev 2022-09-22 18:37:39 +00:00
Pinyao Ting
0ee21ef3e6 Fix a security issue in app widget service.
Bug: 234013191
Test: atest RemoteViewsAdapterTest
Change-Id: Icd2eccb7a90124aca18a3dd463c3f79e3a595c20
Merged-In: Icd2eccb7a90124aca18a3dd463c3f79e3a595c20
(cherry picked from commit 263d7d0ba8)
2022-09-22 18:01:28 +00:00
Yuri Lin
da63d3e028 Merge "Limit lengths of fields in Condition to a max length." into qt-dev 2022-09-22 15:21:17 +00:00
Pinyao Ting
9b0dd514d2 [Do Not Merge] Ignore malformed shortcuts
After an app publishes a shortcut that contains malformed intent, the
system can be stuck in boot-loop due to uncaught exception caused by
parsing the malformed intent.

This CL ignores that particular malformed entry. Since shortcuts are
constantly writes back into the xml from system memory, the malformed
entry will be removed from the xml the next time system persists
shortcuts from memory to file system.

Bug: 246540168
Change-Id: Ie1e39005a5f9d8038bd703a5bc845779c2f46e94
Test: manual
2022-09-21 23:03:20 +00:00
Songchun Fan
b625b562c4 Merge "[pm] forbid deletion of protected packages" into qt-dev 2022-09-15 20:58:34 +00:00
Yuri Lin
5cb217fff3 Limit lengths of fields in Condition to a max length.
This app-generated input needs to not be too long to avoid errors in the process of writing to disk.

Bug: 242846316
Test: cts ConditionTest; atest ConditionTest; manually verified exploit apk is OK

Change-Id: Ic2fa8f06cc7a4c1f262115764fbd1be2a226b4b9
Merged-In: Ic2fa8f06cc7a4c1f262115764fbd1be2a226b4b9
(cherry picked from commit 81352c3775)
2022-09-15 18:06:30 +00:00
Matt Pietal
c561831af7 [DO NOT MERGE] Update window with FLAG_SECURE when bouncer is showing
This will prevent bouncer interactions from showing up in
screenrecords or screenshots.

Fixes: 215005011
Test: atest StatusBarWindowControllerTest && take screenshot
with bouncer up

Merged-In: I3f59df865dc2dd13d4b9ac54bb2dacb7b23f0aa1
Change-Id: I8df2258863b8cede5ba112331e0446f534267ba2
2022-09-15 17:52:28 +00:00
Daniel Norman
6505ed1695 Merge "Include all enabled services when FEEDBACK_ALL_MASK." into qt-dev 2022-09-15 16:43:41 +00:00
TreeHugger Robot
c184d7b721 Merge "[DO NOT MERGE] Do not dismiss keyguard after SIM PUK unlock" into qt-dev 2022-09-15 16:39:42 +00:00
Matt Pietal
a30148b8a4 [DO NOT MERGE] Do not dismiss keyguard after SIM PUK unlock
After PUK unlock, multiple calls to
KeyguardSecurityContainerController#dismiss() were being called from
the KeyguardSimPukViewController, which begins the transition to the
next security screen, if any. At the same time, other parts of the
system, also listening to SIM events, recognize the PUK unlock and
call KeyguardSecurityContainer#showSecurityScreen, which updates which
security method comes next. After boot, this should be one of PIN,
Password, Pattern, assuming they have a security method. If one of the
first dismiss() calls comes AFTER the security method changes, this is
incorrectly recognized by the code as a successful
PIN/pattern/password unlock. This causes the keyguard to be marked as
done, causing screen flickers and incorrect system state.

The solution: every call to dismiss() should include a new parameter
for the security method used. If there is a difference between this
parameter and the current value in KeyguardSecurityContainerCallback,
ignore the request, as the system state has changed.

Bug: 218500036
Test: atest KeyguardSecurityContainerTest

Merged-In: I7c8714a177bc85fbce92f6e8fe911f74ca2ac243
Change-Id: I30226bc7b5eda9480d471b35fe81e106b0491ff8
2022-09-14 14:49:28 +00:00
Songchun Fan
2e42c393f2 [pm] forbid deletion of protected packages
BUG: 242996180
Test: adb shell pm uninstall --user 0 com.google.android.apps.work.oobconfig
Test: Verified with the command above. Before this CL, the package can
be deleted. After this CL, the deletion will fail.

Change-Id: Iba408e536b340ea5d66ab499442c0c4f828fa36f
(cherry picked from commit 15f85c7fa9)
Merged-In: Iba408e536b340ea5d66ab499442c0c4f828fa36f
2022-09-12 17:26:02 -07:00
Julia Reynolds
a375542897 Fix NPE
Test: NotificationChannelGroupTest
Test: view notification settings for an app that doesn't use groups
Fixes: 244574602
Bug: 241764350
Bug: 241764340
Bug: 241764135
Bug: 242702935
Bug: 242703118
Bug: 242703202
Bug: 242702851
Bug: 242703217
Bug: 242703556
Change-Id: I9c681106f6d645e62b0e44903d40aa523fee0e95
(cherry picked from commit 6f02c07176)
2022-09-08 14:05:01 +00:00
Yuri Lin
3fe8fdc4dc Merge "Fix system zen rules by using owner package name if caller is system" into qt-dev 2022-09-07 18:09:40 +00:00
TreeHugger Robot
cef7f19369 Merge "[RESTRICT AUTOMERGE] Check permission for VoiceInteraction" into qt-dev 2022-09-07 03:10:24 +00:00
Yuri Lin
380ec03dee Merge "Trim any long string inputs that come in to AutomaticZenRule" into qt-dev 2022-09-06 23:01:44 +00:00
Yuri Lin
dbfe869c30 Fix system zen rules by using owner package name if caller is system
Previously were unable to add new zen rules because rules added via the settings pages were getting registered under package "com.android.settings", which then were not considered "system rules". These rules should have package android, so when we can trust the caller (via checking that the caller is system) we should be taking the package name from the owner of the rule.

Bug: 245236706
Bug: 242537431
Test: NMSTest; manual

Change-Id: Id69b671592396ac3304862dadbe73de328a8e27a
Merged-In: Id69b671592396ac3304862dadbe73de328a8e27a
2022-09-06 21:20:11 +00:00
TreeHugger Robot
0b5ceb8cd2 Merge "Validate package name passed to setApplicationRestrictions." into qt-dev 2022-09-06 15:05:26 +00:00
Daniel Norman
2bc4d49c2b Include all enabled services when FEEDBACK_ALL_MASK.
Bug: 243849844
Test: m sts;
      sts-tradefed run sts-dynamic-develop -m CtsAccessibilityTestCases
Change-Id: I4f93e06d1066085bd64e8f09882de2f4a72a0633
2022-09-01 20:17:54 +00:00
Yuri Lin
c4b2c877ec Trim any long string inputs that come in to AutomaticZenRule
This change both prevents any rules from being unable to be written to disk and also avoids risk of running out of memory while handling all the zen rules.

Bug: 242703460
Bug: 242703505
Bug: 242703780
Bug: 242704043
Bug: 243794204
Test: cts AutomaticZenRuleTest; atest android.app.AutomaticZenRuleTest; manually confirmed each exploit example either saves the rule successfully with a truncated string (in the case of name & conditionId) or may fail to save the rule at all (if the owner/configactivity is invalid). Additionally ran the memory-exhausting PoC without device crashes.

Change-Id: I110172a43f28528dd274b3b346eb29c3796ff2c6
Merged-In: I110172a43f28528dd274b3b346eb29c3796ff2c6
(cherry picked from commit de172ba0d4)
2022-09-01 18:54:21 +00:00
Oli Lan
cfcfe6ca8c Validate package name passed to setApplicationRestrictions.
This adds validation that the package name passed to
setApplicationRestrictions is in the correct format. This will avoid
an issue where a path could be entered resulting in a file being
written to an unexpected place.

Bug: 239701237
Test: atest UserManagerServiceTest
Change-Id: I1ab2b7228470f10ec26fe3a608ae540cfc9e9a96
(cherry picked from commit 31a582490d)
Merged-In: I1ab2b7228470f10ec26fe3a608ae540cfc9e9a96
2022-08-30 16:10:28 +01:00
Yuri Lin
fcc640c578 Check rule package name in ZenModeHelper.addAutomaticRule
instead of checking that of the configuration activity, which is potentially spoofable. The package name is verified to be the same app as the caller by NMS.

This change removes isSystemRule (called only once) in favor of checking the provided package name directly.

Bug: 242537431
Test: ZenModeHelperTest, manual by verifying via provided exploit apk
Change-Id: Ic7f350618c26a613df455a4128c9195f4b424a4d
Merged-In: Ic7f350618c26a613df455a4128c9195f4b424a4d
2022-08-25 21:17:32 +00:00
Oli Lan
adafc9cb0f Merge "RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps." into qt-dev 2022-08-24 13:37:04 +00:00
Julia Reynolds
c2d264989a Limit the size of NotificationChannel and NotificationChannelGroup
Test: android.app.NotificationChannelGroupTest
Test: android.app.NotificationChannelTest
Test: cts NotificationChannelTest
Test: cts NotificationChannelGroupTest
Bug: 241764350
Bug: 241764340
Bug: 241764135
Bug: 242702935
Bug: 242703118
Bug: 242703202
Bug: 242702851
Bug: 242703217
Bug: 242703556
Change-Id: I0925583ab54d6c81c415859618f6b907ab7baada
Merged-In: I0925583ab54d6c81c415859618f6b907ab7baada
(cherry picked from commit 3850857cb0)
2022-08-23 13:22:33 +00:00
TreeHugger Robot
dedf573b23 Merge "Do not send AccessibilityEvent if notification is for different user." into qt-dev 2022-08-20 02:34:14 +00:00
Ivan Chiang
e4e77f4570 [RESTRICT AUTOMERGE] Check permission for VoiceInteraction
The service must have the CAPTURE_AUDIO_HOTWORD permission to access
AlwaysOnHotwordDetector. If it doesn't have the permission, return
STATE_HARDWARE_UNAVAILABLE state. If it is not granted the
RECORD_AUDIO permisison, it also can't start to recognize the audio.

Test: manual
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsAssistTestCases
Bug: 229793943
Change-Id: I7d0f8d2f6af4bc4210060f0a44469db2afc7a1bb
Merged-In: I7d0f8d2f6af4bc4210060f0a44469db2afc7a1bb
2022-08-15 15:09:33 +08:00
Ganesh Olekar
e893eff6f2 Merge "DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q" into qt-dev 2022-08-15 06:08:20 +00:00
Daniel Norman
18f2ec86d6 Do not send AccessibilityEvent if notification is for different user.
Bug: 237540408
Test: BuzzBeepBlinkTest#testA11yCrossUserEventNotSent
Change-Id: I62a875e26e214847ec72ce3c41b4f2fa8e597e07
Merged-In: I62a875e26e214847ec72ce3c41b4f2fa8e597e07
2022-08-12 19:44:08 +00:00
TreeHugger Robot
750c978db5 Merge "[RESTRICT AUTOMERGE] Do not send new Intent to non-exported activity when navigateUpTo" into qt-dev 2022-08-11 15:41:19 +00:00
Louis Chang
b9a9340645 [RESTRICT AUTOMERGE] Do not send new Intent to non-exported activity when navigateUpTo
The new Intent was delivered to a non-exported activity while
#navigateUpTo was called from an Activity of a different uid.

Bug: 238605611
Test: atest StartActivityTests
Change-Id: I854dd825bfd9a2c08851980d480d1f3a177af6cf
Merged-In: I854dd825bfd9a2c08851980d480d1f3a177af6cf
2022-08-11 02:03:47 +00:00
Yuri Lin
718c21f25e Merge changes from topic "cherrypick-cherrypick-jr-owner-azffbn1bzv-en33flblkb" into qt-dev
* changes:
  Enforce zen rule limit on a package level.
  Fix NPE when deleting old zen rules
  Store DND rule owners
2022-08-10 20:51:29 +00:00
TreeHugger Robot
8f07d18092 Merge "switch TelecomManager List getters to ParceledListSlice" into qt-dev 2022-08-10 16:17:49 +00:00
Linus Tufvesson
b6d3c1a021 Merge "DO NOT MERGE - Exclude TYPE_PRIVATE_PRESENTATION app visiblity" into qt-dev 2022-08-10 07:59:57 +00:00
Oli Lan
7fdc96aef4 RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps.
This addresses a security issue where the guest user can remove updates
for system apps.

With this CL, attempts to uninstall/downgrade system apps will fail if
attempted by a non-admin user, unless the DELETE_SYSTEM_APP flag is
specified.

This is a fixed version of ag/17400663, to address b/236578018.

Bug: 170646036
Test: manual, try uninstalling system app update as guest
Change-Id: I5eab215cba6528aa4316ed7b20bee544915c1486
2022-08-08 13:31:36 +01:00
Linus Tufvesson
c97296e9d9 DO NOT MERGE - Exclude TYPE_PRIVATE_PRESENTATION app visiblity
These windows can only be placed on private virtual displays, and as
such they should not be considered when deciding if an application has
any visible windows or not.

Bug:205130886
Test:Manually verified that sample from 205130886 no longer allows
background activity launches
Test: atest CtsActivityManagerBackgroundActivityTestCases

Change-Id: I76208722bbb7a407ba1f2dc4305a28226166414d
Merged-In: I76208722bbb7a407ba1f2dc4305a28226166414d
2022-08-08 12:55:24 +02:00
Oli Lan
82a9fa1667 Merge "Revert "RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps."" into qt-dev 2022-08-08 10:08:09 +00:00
Aseem Kumar
3f218c9a5e DO NOT MERGE
Move accountname and typeName length check from Account.java to AccountManagerService.

Bug: 169762606
Test: atest AccountManagerServiceTest
Change-Id: I80fabf3a64c55837db98ff316e7e5420129c001b
2022-08-04 22:21:52 +00:00
Jeff DeCew
b38c650ea9 Merge "Block FullScreenIntent while device is in use if notification has a silencing GroupAlertBehavior." into qt-dev 2022-08-02 11:56:41 +00:00
Thomas Stuart
773cddde3d switch TelecomManager List getters to ParceledListSlice
It was shown that given a large phoneAccountHandles that are
over 1 mb, a TransactionTooLarge exception can be silently thrown
causing an empty list to be returned.

In order to prevent this behavior, all Lists that return a
PhoneAccountHandle or PhoneAccount have been switched to
ParceledListSlice.

bug: 236263294
Test: atest android.telecom.cts.PhoneAccountRegistrarTest
             #testRegisterPhoneAccountHandleWithFieldOverLimit
Change-Id: I025245b2a6f8cfaca86f268851a9d8f0817e07dd
Merged-In: I025245b2a6f8cfaca86f268851a9d8f0817e07dd
2022-08-01 16:54:58 +00:00
Suprabh Shukla
c010da3a46 Stop crashing the system on hitting the alarm limit
Exempting the system as a runtime restart is not clearly
better than extreme memory and computation pressure that can result from
the originating spam.
Callers in the system should guard against any spammy requests that lead
them to create a lot of alarms.

Test: Builds, boots and existing tests should pass.

atest CtsAlarmManagerTestCases:UidCapTests
atest FrameworksMockingServicesTests:AlarmManagerServiceTest

Bug: 234441463
Change-Id: Id5e94d44ac9ab24870a8213ec7583da0f592a5ff
(cherry picked from commit 3b9f3f4a0f)
Merged-In: Id5e94d44ac9ab24870a8213ec7583da0f592a5ff
2022-07-20 01:48:40 +00:00
Jeff DeCew
8ce3c53fcf Block FullScreenIntent while device is in use if notification has a silencing GroupAlertBehavior.
Bug: 231322873
Test: atest NotificationInterruptStateProviderImplTest
Merged-In: Id82d20c9f1f2001400871b5381f52b40fbdf81c5
Change-Id: Id82d20c9f1f2001400871b5381f52b40fbdf81c5
2022-07-20 01:13:11 +00:00
Oli Lan
49d8f9325a Revert "RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps."
This reverts commit a7621e0ce0.

Reason for revert: Regression, DELETE_SYSTEM_APP flag no longer works

Change-Id: I7386d1ba3d61b95836b85c52214c83b216c478e8
2022-07-19 10:45:22 +00:00
Julia Reynolds
c38cc3e355 DO NOT MERGE Limit the number of concurrently snoozed notifications
Test: atest FrameworksUiServicesTests
Bug: 234441463
Change-Id: I005b43979d1c708fd505c8b33ae0c8cb03ddbb35
Merged-In: I005b43979d1c708fd505c8b33ae0c8cb03ddbb35
(cherry picked from commit 7c38394ae9)
2022-07-08 15:39:10 +00:00
Yuri Lin
55d8e634dc Enforce zen rule limit on a package level.
This means that a single package with multiple different condition providers or configuration activities will correctly have all of their zen rules associated with the same package rather than each owner/activity having their rules counted separately.

Bug: 235823407
Test: ZenModeHelperTest
Change-Id: I35daf9a24f546ae25a78a2d841be39072cdc5641
Merged-In: I35daf9a24f546ae25a78a2d841be39072cdc5641
(cherry picked from commit f4e69394ee)
2022-07-07 15:50:44 +00:00
Julia Reynolds
7bb9cd92bf Fix NPE when deleting old zen rules
Test: manually revoke access for a DND app that has rules
created before and after b/189332346
Bug: 191773100
Bug: 189332346
Bug: 235823407

Change-Id: I069fcc124af24227fa50b61d4fc55d6dadc7a20b
Merged-In: I069fcc124af24227fa50b61d4fc55d6dadc7a20b
(cherry picked from commit b4fe101e5e)
2022-07-07 15:50:38 +00:00
Julia Reynolds
eda171cffa Store DND rule owners
Test: uiservicestest, cts
Bug: 189332346
Bug: 235823407

Change-Id: Ie546c15c25fcbd193b67cb997220f075691e9bab
Merged-In: Ie546c15c25fcbd193b67cb997220f075691e9bab
2022-07-07 15:50:29 +00:00
Manjeet Rulhania
2c12354e77 Merge "Remove package name from SafetyNet logs" into qt-dev 2022-07-06 22:32:27 +00:00
TreeHugger Robot
5ccf55eb8a Merge "IMMS: Make IMMS PendingIntents immutable" into qt-dev 2022-07-01 18:13:46 +00:00