Commit Graph

483219 Commits

Author SHA1 Message Date
Songchun Fan
fcdc62081c [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-13 18:06:07 +00:00
Iván Budnik
f8f07e22f1 Merge "Revert "Enforce ComponentName belongs to caller app"" into rvc-dev 2022-09-12 18:45:04 +00:00
Iván Budnik
094e9f8046 Revert "Enforce ComponentName belongs to caller app"
This reverts commit ff7be9912f.

Reason for revert: b/241798893. Note: this fix is not the root cause of the breakage. It just exposes a previously unknown bug. See linked bug.

Change-Id: I7da45dfedace793085da06697976d189e8e7fbdb
Merged-In: Ibabff26c5a54e89c5dbe3a577f4c7739be6e2709
2022-09-09 16:30:46 +00:00
Yuri Lin
4bc4a7d756 [automerger skipped] Merge "Fix system zen rules by using owner package name if caller is system" into qt-dev am: 3fe8fdc4dc am: 85d0cb310c -s ours
am skip reason: Merged-In Id69b671592396ac3304862dadbe73de328a8e27a with SHA-1 0b262d0ae5 is already in history

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

Change-Id: I110a9f6329cb24f3791845ab5463d3e8a9cd1d1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 18:58:44 +00:00
Yuri Lin
85d0cb310c Merge "Fix system zen rules by using owner package name if caller is system" into qt-dev am: 3fe8fdc4dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19868480

Change-Id: Ibcf7736667abc27920b1b86fab2499ee0f723628
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 18:33:19 +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
Yuri Lin
06377249c0 Merge "Fix system zen rules by using owner package name if caller is system" into rvc-dev 2022-09-07 18:09:31 +00:00
TreeHugger Robot
3a946e8c95 [automerger skipped] Merge "[RESTRICT AUTOMERGE] Check permission for VoiceInteraction" into qt-dev am: cef7f19369 am: 14246ca9b8 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ie309bfd32236a795ab7be66e5ffafc86c90dcca9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 04:16:38 +00:00
Ivan Chiang
ee0f678dcf [automerger skipped] [RESTRICT AUTOMERGE] Check permission for VoiceInteraction am: e4e77f4570 am: 8862cac366 -s ours
am skip reason: subject contains skip directive

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

Change-Id: I82d2826418c2587c5082923a00cc7481c9ce7d4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 04:16:18 +00:00
TreeHugger Robot
14246ca9b8 Merge "[RESTRICT AUTOMERGE] Check permission for VoiceInteraction" into qt-dev am: cef7f19369
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18803236

Change-Id: I6820bac07063783295faf02f47dde9578197ef81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 03:39:17 +00:00
Ivan Chiang
8862cac366 [RESTRICT AUTOMERGE] Check permission for VoiceInteraction am: e4e77f4570
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18803236

Change-Id: Ifddc01d108d8a056617725cb88ff47d14651bd94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 03:39:13 +00:00
TreeHugger Robot
cef7f19369 Merge "[RESTRICT AUTOMERGE] Check permission for VoiceInteraction" into qt-dev 2022-09-07 03:10:24 +00:00
TreeHugger Robot
5f0da27aab Merge "[RESTRICT AUTOMERGE] Check permission for VoiceInteraction" into rvc-dev 2022-09-07 02:47:41 +00:00
Yuri Lin
ae6b8569a3 [automerger skipped] Merge "Trim any long string inputs that come in to AutomaticZenRule" into qt-dev am: 380ec03dee am: e5fdd7f0de -s ours
am skip reason: Merged-In I110172a43f28528dd274b3b346eb29c3796ff2c6 with SHA-1 1fcd99f5aa is already in history

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

Change-Id: I71ba5bc53522d3c80e897925677efbc7aeb5ef60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 00:14:23 +00:00
Yuri Lin
e5fdd7f0de Merge "Trim any long string inputs that come in to AutomaticZenRule" into qt-dev am: 380ec03dee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19816794

Change-Id: I86c52b898436188c231a44b342c0ccd1672e07dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 23:34:37 +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
6df0223ee6 Merge "Trim any long string inputs that come in to AutomaticZenRule" into rvc-dev 2022-09-06 22:59:43 +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
Yuri Lin
0b262d0ae5 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:19:57 +00:00
TreeHugger Robot
ef2a1d60be [conflict] Merge "Validate package name passed to setApplicationRestrictions." into qt-dev am: 0b5ceb8cd2 am: 9f864c4b23
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19747771

Bug: 239701237
Change-Id: I8959a73760101a265c0796f8f262cecf40d0acdf
Merged-In: I1ab2b7228470f10ec26fe3a608ae540cfc9e9a96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 17:41:59 +00:00
TreeHugger Robot
9f864c4b23 Merge "Validate package name passed to setApplicationRestrictions." into qt-dev am: 0b5ceb8cd2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19747771

Change-Id: Ie6bc78bc892b8ae40b1acb095cbb2a49ee3d0452
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 15:34:43 +00:00
TreeHugger Robot
0b5ceb8cd2 Merge "Validate package name passed to setApplicationRestrictions." into qt-dev 2022-09-06 15:05:26 +00:00
Yuri Lin
8cfe99d2e5 [automerger skipped] Check rule package name in ZenModeHelper.addAutomaticRule am: fcc640c578 am: b5e74c1c7e -s ours
am skip reason: Merged-In Ic7f350618c26a613df455a4128c9195f4b424a4d with SHA-1 3201baad70 is already in history

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

Change-Id: Ic6e48f2ddef80822f1d4c97eda75fbf665fc35c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-01 23:10:52 +00:00
Yuri Lin
b5e74c1c7e Check rule package name in ZenModeHelper.addAutomaticRule am: fcc640c578
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19744482

Change-Id: I256726db11f0af20fbf9fe506c63280a42b3343a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-01 22:46:01 +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
Yuri Lin
1fcd99f5aa 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:01 +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
Yuri Lin
3201baad70 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:09 +00:00
Ganesh Olekar
1ee3c74d2e Merge "DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q" into rvc-dev 2022-08-24 20:46:33 +00:00
Oli Lan
35868459ce [automerger skipped] Merge "RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps." into qt-dev am: adafc9cb0f am: 02101eec31 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ib26ed490a4e9432ed48db06edf478b6dbccfe65f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 14:53:06 +00:00
Oli Lan
4523b61a18 [automerger skipped] RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps. am: 7fdc96aef4 am: 4c5aaf952b -s ours
am skip reason: subject contains skip directive

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

Change-Id: I78acf86f8897a697068ea610e2382aae25c9df09
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 14:52:39 +00:00
Oli Lan
02101eec31 Merge "RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps." into qt-dev am: adafc9cb0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19532979

Change-Id: Ibdc5b1a989999ce369329158227f766ac7c0e1f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 14:25:50 +00:00
Oli Lan
4c5aaf952b RESTRICT AUTOMERGE Prevent non-admin users from deleting system apps. am: 7fdc96aef4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19532979

Change-Id: I57b5bdc0fe501fd27516f3f9ea3c156aa6da6c0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 14:25:46 +00:00
Oli Lan
71fad59e5e Merge "Prevent non-admin users from deleting system apps." into rvc-dev 2022-08-24 13:37:19 +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
7d9c55fd15 [automerger skipped] Limit the size of NotificationChannel and NotificationChannelGroup am: c2d264989a am: f1c5754b97 -s ours
am skip reason: Merged-In I0925583ab54d6c81c415859618f6b907ab7baada with SHA-1 6d417539d7 is already in history

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

Change-Id: I6ca536a1e387ab2df802df9bfb4ed2e504154ddc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-23 19:01:51 +00:00
Julia Reynolds
f1c5754b97 Limit the size of NotificationChannel and NotificationChannelGroup am: c2d264989a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19696126

Change-Id: Ida57571c08e6c1be93b7b70adff8fce3759c109a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-23 18:44:15 +00:00
Julia Reynolds
04ccf69df1 Merge "Limit the size of NotificationChannel and NotificationChannelGroup" into rvc-dev 2022-08-23 18:41:17 +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
87755b712a [automerger skipped] [conflict] Merge "Do not send AccessibilityEvent if notification is for different user." into qt-dev am: dedf573b23 am: a8fe3a8f50 -s ours
am skip reason: Merged-In I62a875e26e214847ec72ce3c41b4f2fa8e597e07 with SHA-1 a367c0a16a is already in history

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

Change-Id: I5de4f2f5b016828231f035aa045a8faf3849d805
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 21:30:32 +00:00
Julia Reynolds
6d417539d7 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
(cherry picked from commit 3850857cb0)
2022-08-22 17:27:35 +00:00
TreeHugger Robot
a8fe3a8f50 [conflict] Merge "Do not send AccessibilityEvent if notification is for different user." into qt-dev am: dedf573b23
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19607760

Change-Id: I62ba986987ba4f490177e2e5bc4c981a8f4a8fe7
Merged-In: I62a875e26e214847ec72ce3c41b4f2fa8e597e07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 17:22:44 +00:00
Iván Budnik
c4d258d8b1 Merge "Enforce ComponentName belongs to caller app" into rvc-dev 2022-08-22 12:07:16 +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
Daniel Norman
f914ec1768 Merge "Do not send AccessibilityEvent if notification is for different user." into rvc-dev 2022-08-19 21:35:32 +00:00
Ganesh Olekar
26f72ff555 [automerger skipped] DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q am: e37a0ac9f8 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Id9581db45a6bbf1233af5b30be6dfc0ec1b2feec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 11:24:20 +00:00
Ganesh Olekar
e37a0ac9f8 DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q
Test: Manually install app apks targeting Q and verifying that AR permission is not auto-granted
Test: atest ActivityRecognitionPermissionTest
Bug: 210065877
Change-Id: I90adf45a6611ab8bc953765c72af77a6a4f7aae8
(cherry picked from commit 84b1160cfc)
2022-08-15 10:47:16 +00:00
Ganesh Olekar
0f8fc1a47e [automerger skipped] Merge "DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q" into qt-dev am: e893eff6f2 am: dc45b9fed3 -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ic974d67a09adfde7137fac9d90b67d69f38133a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 09:55:28 +00:00
Ganesh Olekar
6732f3304f [automerger skipped] [conflict] DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q am: 84b1160cfc am: 0a761a9510 -s ours
am skip reason: subject contains skip directive

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

Change-Id: If7d552e9ede491bff1daf95515eea4d5b04e7cf1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 09:55:04 +00:00