Commit Graph

419651 Commits

Author SHA1 Message Date
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
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
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
Manjeet Rulhania
50d343c656 Remove package name from SafetyNet logs
Bug: 213323615
Test: AppSecurityTests
Change-Id: Ia2be2b1e32dc0b75c352bc15219f4c4de9abb45a
Merged-In: I993832e148636f1795ffe393c6dc74a08b9442f8
Merged-In: I8f823487ca16861a35135cfc3383fa2ce8258017
Merged-In: I4b61d13256ce0bfb8fc9d21db52ee78ce2097f14
2022-06-30 22:33:55 +00:00
Adrian Roos
2b85982616 IMMS: Make IMMS PendingIntents immutable
Fixes: 154913391
Test: n/a
Change-Id: I34a95732ef3e7c20d6549b57230c11f0c3db04d6
Merged-In: I34a95732ef3e7c20d6549b57230c11f0c3db04d6
(cherry picked from commit d4b625994f)
(cherry picked from commit 6842f03c9d)
2022-06-29 17:33:52 +00:00
Steven Moreland
b5c79e141a Parcel: recycle recycles
Before, it was like getting a used pan with food stuck on it. We run
a clean ship here. You want a Parcel? You get a fresh Parcel. When
we recycle a Parcel, we do a real clean-up job. Air freshener. All
bits brushed over. These Parcel objects are clean as heck now!

(specifically cleans mClassCookies)

Bug: 208279300
Test: build
Merged-In: I250872f5c6796bb64e2dc68008154c0e90feb218
Change-Id: I250872f5c6796bb64e2dc68008154c0e90feb218
(cherry picked from commit 46770fa49c)
2022-06-28 23:11:34 +00:00
Songchun Fan
63257e0e97 Merge changes from topic "revert-16575908-dont_abandon_child_qt_dev-VVMFNIYZZO" into qt-dev
* changes:
  [RESTRICT AUTOMERGE] Revert "Revert "Revert "[pm] remove old stage dirs on low storage"""
  [RESTRICT AUTOMERGE] Revert "Don't abandon child sessions (1/n)"
  [RESTRICT AUTOMERGE] Revert "Fix NPE"
2022-06-28 20:37:57 +00:00
Songchun Fan
650eb0cc65 Merge "[RESTRICT AUTOMERGE] Revert "Persist destroyed staged sessions until they are cleaned up"" into qt-dev 2022-06-28 20:37:57 +00:00
Songchun Fan
dde06fe41d [RESTRICT AUTOMERGE] Revert "Revert "Revert "[pm] remove old stage dirs on low storage"""
This reverts commit 3e28df68fa.

Reason for revert:   Reverting CVE-2021-39624 on qt-dev

Change-Id: I26c0abd06e2a49e05f45d153c4247f7c0a269897
2022-06-28 16:42:29 +00:00
Songchun Fan
6b86ed8497 [RESTRICT AUTOMERGE] Revert "Don't abandon child sessions (1/n)"
Revert submission 16575908-dont_abandon_child_qt_dev

Reason for revert:  Reverting CVE-2021-39624 on qt-dev
Reverted Changes:
I4ede6b7a4:Persist destroyed staged sessions until they are c...
Ib0ba9f378:Don't abandon child sessions (1/n)

Change-Id: I7915e3f0ba6dd8430a9b938a518aeeeb4d6b1805
2022-06-28 16:42:17 +00:00
Songchun Fan
07d74c4c28 [RESTRICT AUTOMERGE] Revert "Persist destroyed staged sessions until they are cleaned up"
Revert submission 16575908-dont_abandon_child_qt_dev

Reason for revert:  Reverting CVE-2021-39624 on qt-dev
Reverted Changes:
I4ede6b7a4:Persist destroyed staged sessions until they are c...
Ib0ba9f378:Don't abandon child sessions (1/n)

Change-Id: I50ab96061b2e0fa016a0fbdb5773ccc5f2397ac6
2022-06-28 16:37:33 +00:00
Songchun Fan
a4945fcf4b [RESTRICT AUTOMERGE] Revert "Fix NPE"
This reverts commit f562aadd77.

Reason for revert: Reverting CVE-2021-39624 on qt-dev

Change-Id: Ida84f497eb188b4923acbe8acdbe4d47427aa24e
2022-06-28 16:37:14 +00:00
Kenneth Ford
a4924eb85c Ignore tests in RecoverableKeyStoreManagerTest am: 4220de4d5b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18720703

Change-Id: I837accdc0d4f5bada34fe8da18075092dd295801
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 22:31:58 +00:00
Makoto Onuki
99ccb4e5b0 Merge "Only allow the system server to connect to sync adapters" into qt-dev 2022-06-08 18:56:23 +00:00
Adrian Roos
fa1fc20874 Merge "Restrict getInputMethodWindowVisibleHeight" into qt-dev 2022-06-08 07:21:26 +00:00
Chiachang Wang
3ac8d1dc2f Merge "Stop using invalid URL to prevent unexpected crash" into qt-dev 2022-06-08 01:30:34 +00:00
chiachangwang
6d6f410694 Stop using invalid URL to prevent unexpected crash
Verify the input PAC Uri before performing follow-up actions.

Check if the URL is a valid URL to filter some invalid URLs since
these invalid URLs could not fall into any subclass of existing
URLConnections. When the PAC Uri is other invalid URL scheme, it
will cause an UnsupportedOperationException if there is no proper
subclass that implements the openConnection() method.
A malformed URL may crash the system.

Even it's a valid URL, some subclasses(e.g. JarURLConnection)
may not have openConnection() implemented. It will also hit the
problem, so convert the possbile exception from openConnection()
to re-throw it to IOException which is handled in the existing
code.

Bug: 219498290
Test: atest FrameworksNetTests CtsNetTestCases
Test: Test with malformed URL
Merged-In: I22903414380b62051f514e43b93af992f45740b4
Merged-In: I2abff75ec59a17628ef006aad348c53fadbed076
Change-Id: I4d6cec1da9cf3f70dec0dcf4223254d3da4f30a3
(cherry picked from commit 6390b37a3b)
2022-06-06 02:03:41 +00:00
Kenneth Ford
4220de4d5b Ignore tests in RecoverableKeyStoreManagerTest
Ignores unit tests that were causing a Droidmonitor breakage.

Bug: 231667368
Test: N/A
Change-Id: I719312475264e8099edb607a941468c1c5ecb1a5
(cherry picked from commit 8721d110fd)
2022-06-02 22:21:05 +00:00
Raphael Kim
51d47ec7c8 Remove package title from notification access confirmation intent
Bug: 228178437
Test: Manually confirmed on an application
Change-Id: Idad6dc0c71d7b39de0bd9e4ad922b5e6020a6184
Merged-In: Idad6dc0c71d7b39de0bd9e4ad922b5e6020a6184
2022-06-01 22:26:34 +00:00
Makoto Onuki
7d1397a544 Only allow the system server to connect to sync adapters
Bug: 203229608
Test: Manual test with changing the check logic + debug log
Change-Id: If18009f61360564d02dcda9b1e5fa15685e3250f
(cherry picked from commit 58270527d1)
2022-06-01 20:35:21 +00:00
Julia Reynolds
38fe45b539 Move service initialization
Occasionally ILockSettings can fail to be initialized otherwise
Fixes: 232714129
Test: boot (and eventually bootstress/reboot-long)

Change-Id: I2f9f9bdba37f4ebfaea56c1a6662f0474ae8a002
Merged-In: I2f9f9bdba37f4ebfaea56c1a6662f0474ae8a002
(cherry picked from commit 8e278543bd)
2022-05-23 16:03:12 -07:00
Adrian Roos
094ea03f14 Restrict getInputMethodWindowVisibleHeight
Make sure only the app currently interacting with the IME can
query this, and restrict the API to apps targeting SDKs before T

Fixes: 204906124
Test: atest 'InputMethodManagerTest#getInputMethodWindowVisibleHeight_returnsZeroIfNotFocused'
Change-Id: If1da19a3dd8c29542afc970b4b201d87547c27a9
Merged-In: If1da19a3dd8c29542afc970b4b201d87547c27a9
2022-05-20 18:11:19 +02:00
Manjeet Rulhania
b22a6d7372 Merge "Fix duplicate permission privilege escalation" into qt-dev 2022-05-16 16:13:01 +00:00
Manjeet Rulhania
31bd425bb6 Fix duplicate permission privilege escalation
Duplicate permissions definition with different group allows
privilege permission escalation to a different permission group.

Android studio and gradle plugin does not allow duplicate
permissions with different attributes, these tools only allow
if duplicate permissions are exact copies.

Also platform stores permissions in map at multiple places with
permission name as key. This suggests that we can disallow
duplicate permissions during package install/update.

Bug: 213323615
Test: manual
Change-Id: I6f44e740897305e7a0553c1cf6c3af37faf02a2e
Merged-In: I1910dca44104e35a57eba4acfa8188cd9b8626ac
Merged-In: I34120fff2ec2a158dfa55779d2afd4bbd49487ff
Merged-In: I9bc839836786a0876e67fd73c05f8944bb532249
2022-05-16 02:06:24 +00:00
TreeHugger Robot
e7da6dd26e Merge "DO NOT MERGE Crash invalid FGS notifications" into qt-dev 2022-05-12 19:50:55 +00:00
Wenhao Wang
248bbf2dca Merge "DO NOT MERGE Suppress notifications when device enter lockdown" into qt-dev 2022-04-28 19:44:46 +00:00
Wenhao Wang
85c00b98a6 DO NOT MERGE Suppress notifications when device enter lockdown
This CL makes the following modifcations:
1. Add LockPatternUtils.StrongAuthTracker to monitor
the lockdown mode status of the phone.
2. Call mListeners.notifyRemovedLocked with all the
notifications in the mNotificationList when entering
the lockdown mode.
3. Call mListeners.notifyPostedLocked with all the
notifications in the mNotificationList when exiting
the lockdown mode.
4. Dismiss the function calls of notifyPostedLocked,
notifyRemovedLocked, and notifyRankingUpdateLocked
during the lockdown mode.

The CL also adds corresponding tests.

Bug: 173721373
Test: atest NotificationManagerServiceTest
Test: atest NotificationListenersTest
Test: manually verify the paired device cannot receive
notifications when the host phone is in lockdown mode.
Ignore-AOSP-First: pending fix for a security issue.

Change-Id: I7e83544863eeadf8272b6ff8a9bb8136d6466203
Merged-In: I7e83544863eeadf8272b6ff8a9bb8136d6466203
(cherry picked from commit 3cb6842a05)
2022-04-25 15:29:35 -07:00
Eric Biggers
a318c254f7 Merge changes from topic "unencrypted-dirs-q" into qt-dev
* changes:
  [RESTRICT AUTOMERGE] Log to EventLog on prepareUserStorage failure
  [RESTRICT AUTOMERGE] Ignore errors preparing user storage for existing users
  [RESTRICT AUTOMERGE] UserDataPreparer: reboot to recovery for system user only
  [RESTRICT AUTOMERGE] UserDataPreparer: reboot to recovery if preparing user storage fails
  [RESTRICT AUTOMERGE] StorageManagerService: don't ignore failures to prepare user storage
  Check user unlocked before write to /data/system_ce/0/snapshots
2022-04-25 17:11:39 +00:00
Julia Reynolds
b6b2906ea6 DO NOT MERGE Crash invalid FGS notifications
Test: CTS, ActivityManagerProcessStateTest
Fixes: 191981182
Change-Id: I13a0202b25c8118db47edba11a93c1939c94b392
Merged-In: I13a0202b25c8118db47edba11a93c1939c94b392
(cherry picked from commit 6f657f8f5b)
2022-04-20 18:16:44 +00:00
Tyler Gunn
08f8988bc3 Merge "limit TelecomManager#registerPhoneAccount to 10; api doc update" into qt-dev 2022-04-06 22:58:29 +00:00
TreeHugger Robot
9bc1facf00 Merge "[qt] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning." into qt-dev 2022-04-06 20:17:35 +00:00
Jonathan Scott
c5037ec63c [qt] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning.
Test: atest android.devicepolicy.cts.DevicePolicyManagerTest
Bug: 210469972
Change-Id: I2de99f9ccd8b27ffdc2562fa451f132e73d54317
2022-04-06 09:23:04 +00:00
JW Wang
f562aadd77 Fix NPE
NPE happens when there is an orphaned session which we've
tried to prevent in all cases.

Log an error message if this situation happens.

Bug: 227342978
Test: atest CtsRootPackageInstallerHostTestCases
Change-Id: Ia21323926bd9db1a6f05461904deb45b4c3dd0bc
(cherry picked from commit 07e31dfb1e)
Merged-In: Ia21323926bd9db1a6f05461904deb45b4c3dd0bc
2022-04-05 19:50:59 +00:00