Commit Graph

83772 Commits

Author SHA1 Message Date
Valentin Iftime
623d966fac Validate ringtone URIs before setting am: 7ba175eaeb am: 236f1a0f17
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24956689

Change-Id: Ifcec90852c0369ee58dabfd2fb9cf4f45fc2e2c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 20:13:12 +00:00
Valentin Iftime
236f1a0f17 Validate ringtone URIs before setting am: 7ba175eaeb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24956689

Change-Id: Id2d5f2423cacd7e4bb06fe46e1773b512a79fc29
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-08 19:22:51 +00:00
Valentin Iftime
7ba175eaeb Validate ringtone URIs before setting
Add checks URIs for content from other users.
 Fail for users that are not profiles of the current user.

Test: atest DefaultRingtonePreferenceTest
Bug: 299614635
Change-Id: Ib266b285a3a1c6c5265ae2321159e61e08e349f6
Merged-In: Ib266b285a3a1c6c5265ae2321159e61e08e349f6
2023-10-09 12:55:39 +00:00
Eric Biggers
aa93927b87 [automerger skipped] RESTRICT AUTOMERGE: Catch exceptions from setLockCredential() am: 5f07aba150 -s ours am: 733d83d27b -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24298399

Change-Id: Iee3107d98140efd520924ba05c7f592d54b6e8d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 01:56:39 +00:00
Eric Biggers
733d83d27b [automerger skipped] RESTRICT AUTOMERGE: Catch exceptions from setLockCredential() am: 5f07aba150 -s ours
am skip reason: Merged-In I48b9119c19fb6378b1f88d36433ee4f4c8501d76 with SHA-1 b30cf4e8cb is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24298399

Change-Id: I102d20d2e914a442e768ca7446601bfa51eac20d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 01:36:53 +00:00
Eric Biggers
d1a31c8619 [automerger skipped] RESTRICT AUTOMERGE: Catch exceptions from setLockCredential() am: b30cf4e8cb -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24301340

Change-Id: I100f99e9a0c7495f733b97d9f93decfe905ba7a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-08 01:34:09 +00:00
Eric Biggers
5f07aba150 RESTRICT AUTOMERGE: Catch exceptions from setLockCredential()
When LockPatternUtils#setLockCredential() fails, it can either return
false or throw an exception.  Catch the exception and treat it the same
way as a false return value, to prevent crashing com.android.settings.

Bug: 253043065
Test: Tried setting lockscreen credential while in secure FRP mode using
      smartlock setup activity launched by intent via adb.  Verified
      that com.android.settings no longer crashes due to the exception
      from LockPatternUtils#setLockCredential().
Change-Id: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
(cherry picked from commit 05f1eff1c9)
(moved change into ChooseLockPassword.java and ChooseLockPattern.java,
 which are merged into SaveAndFinishWorker.java on udc-qpr-dev and main)
Merged-In: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
2023-08-02 23:44:37 +00:00
Eric Biggers
b30cf4e8cb RESTRICT AUTOMERGE: Catch exceptions from setLockCredential()
When LockPatternUtils#setLockCredential() fails, it can either return
false or throw an exception.  Catch the exception and treat it the same
way as a false return value, to prevent crashing com.android.settings.

Bug: 253043065
Test: Tried setting lockscreen credential while in secure FRP mode using
      smartlock setup activity launched by intent via adb.  Verified
      that com.android.settings no longer crashes due to the exception
      from LockPatternUtils#setLockCredential().
Change-Id: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
(cherry picked from commit 05f1eff1c9)
(moved change into ChooseLockPassword.java and ChooseLockPattern.java,
 which are merged into SaveAndFinishWorker.java on udc-qpr-dev and main)
Merged-In: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
2023-08-02 23:44:09 +00:00
Eric Biggers
50cb0a35c9 RESTRICT AUTOMERGE: Catch exceptions from setLockCredential()
When LockPatternUtils#setLockCredential() fails, it can either return
false or throw an exception.  Catch the exception and treat it the same
way as a false return value, to prevent crashing com.android.settings.

Bug: 253043065
Test: Tried setting lockscreen credential while in secure FRP mode using
      smartlock setup activity launched by intent via adb.  Verified
      that com.android.settings no longer crashes due to the exception
      from LockPatternUtils#setLockCredential().
Change-Id: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
(cherry picked from commit 05f1eff1c9)
(moved change into ChooseLockPassword.java and ChooseLockPattern.java,
 which are merged into SaveAndFinishWorker.java on udc-qpr-dev and main)
Merged-In: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
2023-08-02 23:43:54 +00:00
Weng Su
72784b097a [automerger skipped] [RESTRICT AUTOMERGE] Restrict ApnEditor settings am: 5c2d727b8f am: f869bfa55f -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24025008

Change-Id: I65ed5a2db7bc34112ddcd8f819b7ab995e571c30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-27 00:56:13 +00:00
Weng Su
f869bfa55f [RESTRICT AUTOMERGE] Restrict ApnEditor settings am: 5c2d727b8f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24025008

Change-Id: Ia2f6bfa237d211be6b884c56d831c84d0c437210
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-27 00:13:52 +00:00
Weng Su
5c2d727b8f [RESTRICT AUTOMERGE] Restrict ApnEditor settings
- Finish ApnEditor settings if user is not an admin

- Finish ApnEditor settings if user has DISALLOW_CONFIG_MOBILE_NETWORKS restriction

Bug: 279902472
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=ApnEditorTest

Change-Id: Iecdbbff7e21dfb11e3ba385858747a220cfd3e04
2023-07-12 11:30:45 +00:00
Weng Su
e3b554b296 [RESTRICT AUTOMERGE] Restrict ApnEditor settings
- Finish ApnEditor settings if user is not an admin

- Finish ApnEditor settings if user has DISALLOW_CONFIG_MOBILE_NETWORKS restriction

Bug: 279902472
Test: manual test
atest -c ApnEditorTest

Change-Id: Iecdbbff7e21dfb11e3ba385858747a220cfd3e04
2023-07-11 08:35:17 +00:00
Treehugger Robot
2291d2e8ea [automerger skipped] Merge "DO NOT MERGE: Prevent non-system IME from becoming device admin" into rvc-dev am: 6976a3137c am: 4e41118949 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23541011

Change-Id: Ic2e68d6bcc91727727ffb322f0887f478b688a97
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06 23:18:30 +00:00
Taran Singh
5a4bdbb9cf [automerger skipped] DO NOT MERGE: Prevent non-system IME from becoming device admin am: 0ee3b96e59 am: fc05ca8c35 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23541011

Change-Id: Ic718037264ca162bfe9d3151ab7d79b9cf133664
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06 23:18:26 +00:00
Treehugger Robot
4e41118949 Merge "DO NOT MERGE: Prevent non-system IME from becoming device admin" into rvc-dev am: 6976a3137c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23541011

Change-Id: I1ec46164b68454a9275e17b55c1ea1f84b8f5dea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06 22:31:35 +00:00
Taran Singh
fc05ca8c35 DO NOT MERGE: Prevent non-system IME from becoming device admin am: 0ee3b96e59
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23541011

Change-Id: Ie8996d74ad457caf5cb22126b11a6ede817ac7a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06 22:31:30 +00:00
Treehugger Robot
6976a3137c Merge "DO NOT MERGE: Prevent non-system IME from becoming device admin" into rvc-dev 2023-07-06 21:55:15 +00:00
Treehugger Robot
78d86e927c [automerger skipped] Merge "DO NOT MERGE: Prevent non-system IME from becoming device admin" into rvc-qpr-dev am: 6cf9c58fa5 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23603846

Change-Id: If0574725dc2bec4837c1554351fffc9419a6723c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06 21:49:29 +00:00
Taran Singh
c07555d438 [automerger skipped] DO NOT MERGE: Prevent non-system IME from becoming device admin am: 0564ec25bb -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23603846

Change-Id: I1ce4bda4ba2ba024a6d1228df1ee0cf105c51854
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06 21:49:26 +00:00
Treehugger Robot
9fa4b1e0a6 Merge "DO NOT MERGE: Prevent non-system IME from becoming device admin" into sc-dev 2023-07-06 21:18:12 +00:00
Treehugger Robot
6cf9c58fa5 Merge "DO NOT MERGE: Prevent non-system IME from becoming device admin" into rvc-qpr-dev 2023-07-06 21:15:44 +00:00
Matías Hernández
9eb2824be8 [automerger skipped] Settings: don't try to allow NLSes with too-long component names am: f1af8c5292 am: 42bd4d88c2 -s ours
am skip reason: Merged-In Ifc048311746c027e3683cdcf65f1079d04cf7c56 with SHA-1 f0367c98d0 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23726246

Change-Id: Ib404f16baae58c5244ba61fe82974a1d93fa681a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 17:11:24 +00:00
Matías Hernández
42bd4d88c2 Settings: don't try to allow NLSes with too-long component names am: f1af8c5292
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23726246

Change-Id: Iaf37229e9570c29792e801446e8db162ebb3dbda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 16:25:28 +00:00
Matías Hernández
f0367c98d0 Settings: don't try to allow NLSes with too-long component names
* NotificationAccessConfirmationActivity (triggered through CompanionDeviceManager) -> Don't show the dialog, bail out early similarly to other invalid inputs.
* NotificationAccessSettings (from Special App Access) -> No changes, but use the canonical constant now.
* ApprovalPreferenceController (used in NotificationAccessDetails) -> Disable the toggle, unless the NLS was previously approved (in which case it can still be removed).

Fixes: 260570119
Fixes: 286043036
Test: atest + manually
Change-Id: Ifc048311746c027e3683cdcf65f1079d04cf7c56
Merged-In: Ifc048311746c027e3683cdcf65f1079d04cf7c56
2023-06-19 09:58:28 +00:00
Matías Hernández
f1af8c5292 Settings: don't try to allow NLSes with too-long component names
* NotificationAccessConfirmationActivity (triggered through CompanionDeviceManager) -> Don't show the dialog, bail out early similarly to other invalid inputs.
* NotificationAccessSettings (from Special App Access) -> No changes, but use the canonical constant now.
* NotificationAccessDetails -> Disable the toggle, unless the NLS was previously approved (in which case it can still be removed).

Fixes: 260570119
Fixes: 286043036
Test: atest + manually
Change-Id: Ifc048311746c027e3683cdcf65f1079d04cf7c56
Merged-In: Ifc048311746c027e3683cdcf65f1079d04cf7c56
2023-06-19 11:49:11 +02:00
Matías Hernández
78a4048eac [automerger skipped] DO NOT MERGE Don't hide approved NLSes in Settings am: 173cc267e0 am: d7608c84b4 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23563581

Change-Id: Ifee74173a3e0f410d4d76f06149b496a9ae62241
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-14 13:40:43 +00:00
Matías Hernández
d7608c84b4 DO NOT MERGE Don't hide approved NLSes in Settings am: 173cc267e0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23563581

Change-Id: I11ee7cc3bfd291f32e602eff65ce93ba57bcc407
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-14 12:52:41 +00:00
Taran Singh
0564ec25bb DO NOT MERGE: Prevent non-system IME from becoming device admin
Currently selected IME can inject KeyEvent on DeviceAdminAdd screen to
activate itself as device admin and cause various DoS attacks.

This CL ensures KeyEvent on "Activate" button can only come from system
apps.

Bug: 280793427
Test: atest DeviceAdminActivationTest
Change-Id: I6470d1684d707f4b1e86f8b456be0b4e0af5f188
(cherry picked from commit 70a501d02e)
2023-06-07 18:29:05 +00:00
Matías Hernández
ff255c6eda Don't hide approved NLSes in Settings
Note that an NLS that shouldn't be approvable (because its name is too long) but was already approved (either before the max length check was introduced, or through other means) will disappear from the list if the user revokes its access. This might be somewhat confusing, but since this is a very-edge case already it's fine.

Bug: 282932362
Test: manual
Change-Id: I4c9faea68e6d16b1a4ec7f472b5433cac1704c06
2023-06-06 19:07:58 +02:00
Matías Hernández
173cc267e0 DO NOT MERGE Don't hide approved NLSes in Settings
Note that an NLS that shouldn't be approvable (because its name is too long) but was already approved (either before the max length check was introduced, or through other means) will disappear from the list if the user revokes its access. This might be somewhat confusing, but since this is a very-edge case already it's fine.

Bug: 282932362
Test: manual
Change-Id: Iccfe7b53d643d6c9f9516f91d3cee3309b11551e
2023-06-05 17:16:48 +00:00
Taran Singh
cb2b753094 DO NOT MERGE: Prevent non-system IME from becoming device admin
Currently selected IME can inject KeyEvent on DeviceAdminAdd screen to
activate itself as device admin and cause various DoS attacks.

This CL ensures KeyEvent on "Activate" button can only come from system
apps.

Bug: 280793427
Test: atest DeviceAdminActivationTest
Change-Id: I6470d1684d707f4b1e86f8b456be0b4e0af5f188
(cherry picked from commit 70a501d02e)
2023-06-02 22:37:11 +00:00
Taran Singh
0ee3b96e59 DO NOT MERGE: Prevent non-system IME from becoming device admin
Currently selected IME can inject KeyEvent on DeviceAdminAdd screen to
activate itself as device admin and cause various DoS attacks.

This CL ensures KeyEvent on "Activate" button can only come from system
apps.

Bug: 280793427
Test: atest DeviceAdminActivationTest
Change-Id: I6470d1684d707f4b1e86f8b456be0b4e0af5f188
(cherry picked from commit 70a501d02e)
2023-06-02 21:58:54 +00:00
Lin Yuan
7591fff234 Fix: Bluetooth and Wifi scanning location MainSwitch page policy transparency.
When DISALLOW_CONFIG_LOCATION is set, make location service's
MainSwitchPreference pages for wifi scanning and bluetooth scanning
unavailable too, so that intent direct access is disabled.

screenshot: http://shortn/_kkK3BMTSh1

Bug: 277333746
Bug: 277333781
Test: atest SettingsRoboTests, on device
Change-Id: I52f9a11b1dd78a5e5dbb1bbde3cda7381c87ae39
2023-04-25 19:23:53 +00:00
Julia Reynolds
cfacc2acb8 [automerger skipped] Don't show NLSes with excessively long component names am: 11ac41d9b6 -s ours am: 8befc27425 -s ours
am skip reason: Merged-In I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571 with SHA-1 79cb59e618 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22290648

Change-Id: Ie11a802db36591d58289cd82956c5205f0893244
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 16:28:40 +00:00
Julia Reynolds
8befc27425 [automerger skipped] Don't show NLSes with excessively long component names am: 11ac41d9b6 -s ours
am skip reason: Merged-In I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571 with SHA-1 79cb59e618 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22290648

Change-Id: I8d1fa61e9c43c711725505554b464697f1f1ad4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 15:56:56 +00:00
Julia Reynolds
ceb2d0400a [automerger skipped] Don't show NLSes with excessively long component names am: 79cb59e618 -s ours
am skip reason: Merged-In I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571 with SHA-1 52a102cc2a is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22290647

Change-Id: I6ab06a30496dffbfc038300866d0b3ca3c1d42a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-28 20:25:32 +00:00
Julia Reynolds
52a102cc2a Don't show NLSes with excessively long component names
Test: install test app with long CN
Test: ServiceListingTest
Bug: 260570119
Change-Id: I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571
Merged-In: I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571
2023-03-28 16:56:07 +00:00
Julia Reynolds
11ac41d9b6 Don't show NLSes with excessively long component names
Test: install test app with long CN
Test: ServiceListingTest
Bug: 260570119
Change-Id: I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571
Merged-In: I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571
2023-03-27 16:14:27 +00:00
Julia Reynolds
79cb59e618 Don't show NLSes with excessively long component names
Test: install test app with long CN
Test: ServiceListingTest
Bug: 260570119
Change-Id: I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571
Merged-In: I3ffd02f6cf6bf282e7fc264fd070ed3add4d8571
2023-03-27 16:13:15 +00:00
Dmitry Dementyev
32813a2bef Convert argument to intent in AddAccountSettings. am: c7e8052b52 am: f56584cd21
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21872485

Change-Id: I859c957eb1f94bd9c5858b71c551a1e2e10b0468
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-15 19:39:21 +00:00
Dmitry Dementyev
f56584cd21 Convert argument to intent in AddAccountSettings. am: c7e8052b52
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21872485

Change-Id: I83ab1d878491552ccb3ea1545742d1915fd8a6f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-15 19:01:57 +00:00
Dmitry Dementyev
c7e8052b52 Convert argument to intent in AddAccountSettings.
Bug: 265798353
Test: manual
Change-Id: I0051e5d5fc9fd3691504cb5fbb959f701e0bce6a
2023-03-07 10:36:41 -08:00
Iavor-Valentin Iftime
91ade78763 [automerger skipped] Merge "[DO NO MERGE] Enforce INTERACT_ACROSS_USERS_FULL permission for NotificationAccessDetails" into rvc-dev am: 450cacbee4 am: e116e63a91 -s ours
am skip reason: Merged-In I875b9f2fc32c252acdcf8374a14067836e0f1ac6 with SHA-1 9a7bd79ca3 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21296639

Change-Id: I5de53e483836d8324f70aba0ac3524ec0136e570
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-06 18:16:16 +00:00
Iavor-Valentin Iftime
e116e63a91 Merge "[DO NO MERGE] Enforce INTERACT_ACROSS_USERS_FULL permission for NotificationAccessDetails" into rvc-dev am: 450cacbee4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21296639

Change-Id: I388da4ab1fed92f8afa92469e628f1324921df45
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-06 17:40:55 +00:00
Iavor-Valentin Iftime
450cacbee4 Merge "[DO NO MERGE] Enforce INTERACT_ACROSS_USERS_FULL permission for NotificationAccessDetails" into rvc-dev 2023-03-06 17:06:11 +00:00
Valentin Iftime
5fb0705664 [DO NO MERGE] Enforce INTERACT_ACROSS_USERS_FULL permission for NotificationAccessDetails
When using EXTRA_USER_HANDLE, check for INTERACT_ACROSS_USERS_FULL permission on calling package.

Bug: 259385017
Test: 1. Build a test app that creates and starts an intent to NOTIFICATION_LISTENER_DETAIL_SETTINGS while setting the intent extra  android.intent.extra.user_handle to UserHandle(secondaryUserId).
 2. Create and switch to a secondary user
Settings > System > Multiple users > Allow multiple users > Add user > Switch to New user
 3. Open Settings > Notifications > Device & app notifications and choose an app from the list (uses android.permission.BIND_NOTIFICATION_LISTENER_SERVICE). Enable Device & app notifications for selected app and disable all attributed permissions.
 4. Switch back to the Owner user.
 5. Get the userId of the secondary user: adb shell pm list users.
 6. Open the test app and enter the userId for the secondary user and the component name that uses android.permission.BIND_NOTIFICATION_LISTENER_SERVICE.
 8. In the settings window that open, enable all 4 sub-options.
 9. Switch to the secondary user and note that the all sub-options for the app are disabled.

Change-Id: I875b9f2fc32c252acdcf8374a14067836e0f1ac6
Merged-In: I875b9f2fc32c252acdcf8374a14067836e0f1ac6
2023-02-08 13:37:20 +00:00
Valentin Iftime
9a7bd79ca3 [DO NOT MERGE] Enforce INTERACT_ACROSS_USERS_FULL permission for NotificationAccessDetails
When using EXTRA_USER_HANDLE, check for INTERACT_ACROSS_USERS_FULL permission on calling package.

Bug: 259385017
Test: 1. Build a test app that creates and starts an intent to NOTIFICATION_LISTENER_DETAIL_SETTINGS while setting the intent extra  android.intent.extra.user_handle to UserHandle(secondaryUserId).
 2. Create and switch to a secondary user
Settings > System > Multiple users > Allow multiple users > Add user > Switch to New user
 3. Open Settings > Notifications > Device & app notifications and choose an app from the list (uses android.permission.BIND_NOTIFICATION_LISTENER_SERVICE). Enable Device & app notifications for selected app and disable all attributed permissions.
 4. Switch back to the Owner user.
 5. Get the userId of the secondary user: adb shell pm list users.
 6. Open the test app and enter the userId for the secondary user and the component name that uses android.permission.BIND_NOTIFICATION_LISTENER_SERVICE.
 8. In the settings window that open, enable all 4 sub-options.
 9. Switch to the secondary user and note that the all sub-options for the app are disabled.

Change-Id: I875b9f2fc32c252acdcf8374a14067836e0f1ac6
2023-02-06 14:14:12 +00:00
Jack Yu
3ccadd2c97 Only primary user is allowed to control secure nfc am: 0e57ff90cd am: c098bdcad0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21154458

Change-Id: I5690485d1cacd39b5b74316f561691bc68d48787
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-03 10:10:20 +00:00
Jack Yu
c098bdcad0 Only primary user is allowed to control secure nfc am: 0e57ff90cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21154458

Change-Id: I35c94f779d47e27c170ec3b4becafc563f077a68
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-03 09:21:04 +00:00