Commit Graph

61326 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Jack Yu
0e57ff90cd Only primary user is allowed to control secure nfc
Bug: 238298970
Test: manual
Merged-In: I945490ef1e62af479a732c9a260ed94bdd8bc313
Change-Id: I945490ef1e62af479a732c9a260ed94bdd8bc313
2023-01-31 07:41:49 +00:00
Yanting Yang
86914bedc8 Add DISALLOW_APPS_CONTROL check into uninstall app for all users
Settings App info page supports a "Uninstall for all users" function
when multiple users are enabled. It bypasses the restriction of
DISALLOW_APPS_CONTROL which breaks the user isolation guideline.

To fix this vulnerability, we should check the DISALLOW_APPS_CONTROL
restriction to provide the "Uninstall for all users" function.

Bug: 258653813
Test: manual & robotests
Change-Id: I5d3bbcbaac439c4f7a1e6a9ade7775ff4f2f2ec6
Merged-In: I5d3bbcbaac439c4f7a1e6a9ade7775ff4f2f2ec6
2023-01-04 18:59:18 +00:00
Tsung-Mao Fang
ff5bfb40c8 [DO NOT MERGE] FRP bypass defense in the settings app
Over the last few years, there have been a number of
Factory Reset Protection bypass bugs in the SUW flow.
It's unlikely to defense all points from individual apps.

Therefore, we decide to block some critical pages when
user doesn't complete the SUW flow.

Test: Can't open the certain pages in the suw flow.
Bug: 258422561
Fix: 200746457
Bug: 202975040
Fix: 213091525
Fix: 213090835
Fix: 201561699
Fix: 213090827
Fix: 213090875
Change-Id: Ia18f367109df5af7da0a5acad7702898a459d32e
Merged-In: Ia18f367109df5af7da0a5acad7702898a459d32e
2022-12-07 03:09:30 +00:00
changbetty
3cc8db3c58 RESTRICT AUTOMERGE Make bluetooth switch not discoverable via SliceDeepLinkTrampoline
Bug: 244423101
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothSwitchPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDashboardFragmentTest
Test: manual test by test apk

Change-Id: I13562d227e06627fac33239a9d21fd405a18d012
2022-11-09 06:37:27 +00:00
Oli Lan
ff5b6611cf Prevent exfiltration of system files via avatar picker. am: f70e351d1a am: 05ea36ddc5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19745058

Change-Id: I8cc4562420648436abb478b686adb96c28d8163b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 19:39:55 +00:00
Oli Lan
05ea36ddc5 Prevent exfiltration of system files via avatar picker. am: f70e351d1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19745058

Change-Id: If9321bf1035c0492396adf4ce3b6579dfe31c66b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 19:01:32 +00:00
Oli Lan
f70e351d1a Prevent exfiltration of system files via avatar picker.
This adds mitigations to prevent system files being exfiltrated
via the settings content provider when a content URI is provided
as a chosen user image.

The mitigations are:

1) Copy the image to a new URI rather than the existing takePictureUri
prior to cropping.

2) Only allow a system handler to respond to the CROP intent.

This is a fixed version of ag/17003629, to address b/239513606.

Bug: 187702830
Test: build and check functionality
Merged-In: I15e15ad88b768a5b679de32c5429d921d850a3cb
Change-Id: I98eea867f926c508456ec9bc654e24eeeffa0e54
2022-08-26 19:46:02 +01:00
Oli Lan
03b1a52977 Merge "Revert "Prevent exfiltration of system files via user image settings."" into qt-dev am: b9bafa0d3d am: 05031cc574
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19449016

Change-Id: I5a78c2328f8c68fb5bf15799a69479a82b8e7af7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 15:03:51 +00:00
Oli Lan
05031cc574 Merge "Revert "Prevent exfiltration of system files via user image settings."" into qt-dev am: b9bafa0d3d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19449016

Change-Id: Icfcf27040f9402b736306cf19178feee9f2a774b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 14:46:20 +00:00
Oli Lan
b9bafa0d3d Merge "Revert "Prevent exfiltration of system files via user image settings."" into qt-dev 2022-08-22 14:27:57 +00:00
Yuri Lin
316cd96b28 Merge "Validate config activities with their rule owners" into rvc-dev 2022-08-11 01:32:32 +00:00
Julia Reynolds
8fada38f9e [automerger skipped] Validate config activities with their rule owners am: 65b18b5e69 am: cc3edfd2c7 -s ours
am skip reason: skipped by user yurilin

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

Change-Id: Id6c1135838a71faecce17ba959a2dcccb0a8cbac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 22:20:44 +00:00
Julia Reynolds
cc3edfd2c7 Validate config activities with their rule owners am: 65b18b5e69
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19194215

Change-Id: I844f7e5eeefced63bca9d9baf7b41d1f9b7ac277
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 21:26:47 +00:00
Julia Reynolds
b161a3b850 Validate config activities with their rule owners
Test: RoboTests
Bug: 189332346
Bug: 235823407
Change-Id: Iee1b1caca4d6eb2729feb872c3e4954b6c16519c
Merged-In: Iee1b1caca4d6eb2729feb872c3e4954b6c16519c
2022-08-10 14:20:22 +00:00
Julia Reynolds
65b18b5e69 Validate config activities with their rule owners
Test: RoboTests
Bug: 189332346
Bug: 235823407
Change-Id: Iee1b1caca4d6eb2729feb872c3e4954b6c16519c
Merged-In: Iee1b1caca4d6eb2729feb872c3e4954b6c16519c
2022-08-10 14:19:14 +00:00
Oli Lan
c0742e745d Revert "Prevent exfiltration of system files via user image settings."
This reverts commit 8950a90024.

Reason for revert: regression if multiple crop system crop handlers are present

Change-Id: Ib83dbb2f1109d26b7e85192379291bffef187e77
Merged-In: I15e15ad88b768a5b679de32c5429d921d850a3cb
2022-07-28 12:14:14 +00:00
Raphael Kim
84bafc9fda Merge "Extract app label from component name in notification access confirmation UI" into qt-dev am: 94683c61b1 am: 839ce544aa
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18670793

Change-Id: I13426af81ec5970befc29118f883a08d28c8a986
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-05 02:32:26 +00:00
Raphael Kim
839ce544aa Merge "Extract app label from component name in notification access confirmation UI" into qt-dev am: 94683c61b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18670793

Change-Id: Ic145c489bd89fbc822ee48bfc14193c62321d355
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-05 02:14:41 +00:00
Raphael Kim
94683c61b1 Merge "Extract app label from component name in notification access confirmation UI" into qt-dev 2022-06-05 01:54:28 +00:00
Arc Wang
4b96cb9339 [automerger skipped] Merge changes from topic "presubmit-am-93b3a992dd6c4622a633bca394ada8e5-qt-dev" into qt-dev am: 5eabdc88f0 am: cb82328fac -s ours
am skip reason: Merged-In I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad with SHA-1 32145cc362 is already in history

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

Change-Id: Ia651809cfc726bcf9317b8b085e323b453489195
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:44:35 +00:00
Tsung-Mao Fang
2224883488 [automerger skipped] [DO NOT MERGE] Fix can't change notification sound for work profile. am: edf4416177 am: 99a7a61ba9 -s ours
am skip reason: subject contains skip directive

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

Change-Id: If7f8fbefcef3c152fd924f5dd3305a75b47ce4cd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:44:32 +00:00
Arc Wang
1e688667ba [automerger skipped] [DO NOT MERGE] Fix Settings crash when setting a null ringtone am: d94b73b304 am: 58880a0bef -s ours
am skip reason: subject contains skip directive

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

Change-Id: Ie868f286a337b9c1612820424d0bdc8f2c488c70
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:44:28 +00:00
Arc Wang
cb82328fac Merge changes from topic "presubmit-am-93b3a992dd6c4622a633bca394ada8e5-qt-dev" into qt-dev am: 5eabdc88f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18704664

Change-Id: I537b89e15e11438da0c19671795c911645eee790
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:20:37 +00:00
Tsung-Mao Fang
99a7a61ba9 [DO NOT MERGE] Fix can't change notification sound for work profile. am: edf4416177
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18704664

Change-Id: I97954b12a7385a4cd5caabb19c030744ae6895f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:20:36 +00:00
Arc Wang
58880a0bef [DO NOT MERGE] Fix Settings crash when setting a null ringtone am: d94b73b304
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18356598

Change-Id: Id5b31b30de1883d7d673fc0de60419fca7a22e86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-04 00:20:35 +00:00
Arc Wang
5eabdc88f0 Merge changes from topic "presubmit-am-93b3a992dd6c4622a633bca394ada8e5-qt-dev" into qt-dev
* changes:
  [DO NOT MERGE] Fix can't change notification sound for work profile.
  [DO NOT MERGE] Fix Settings crash when setting a null ringtone
2022-06-03 23:27:16 +00:00
Arc Wang
481113b6a3 Merge changes from topic "presubmit-am-93b3a992dd6c4622a633bca394ada8e5-rvc-dev" into rvc-dev
* changes:
  [DO NOT MERGE] Fix can't change notification sound for work profile.
  [DO NOT MERGE] Fix Settings crash when setting a null ringtone
2022-06-03 23:27:07 +00:00
Lin Yuan
02ca401236 [automerger skipped] Merge "RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning" into qt-dev am: d765af048a am: 36069908ce -s ours
am skip reason: subject contains skip directive

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

Change-Id: I60fb0e9e0c915cf5dd4441939efe462a53b3683b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 20:51:24 +00:00
Lin Yuan
9d3371ee23 [automerger skipped] RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning am: 9eff8f7a8d am: 4daf65ea3b -s ours
am skip reason: subject contains skip directive

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

Change-Id: I2eafef534fcd1662ca91d499fc1751b98e34fa76
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 20:51:20 +00:00
Lin Yuan
36069908ce Merge "RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning" into qt-dev am: d765af048a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18670860

Change-Id: I5e3c940b4dda8b6b6802c2c49260bbad1e661372
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 20:33:50 +00:00
Lin Yuan
4daf65ea3b RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning am: 9eff8f7a8d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18670860

Change-Id: I879d097018e3d4f99d9a8e9f788820a0729d8b99
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 20:33:48 +00:00
Lin Yuan
d765af048a Merge "RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning" into qt-dev 2022-06-02 19:59:49 +00:00
Lin Yuan
3a95e552c6 Merge "RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning" into rvc-dev 2022-06-02 19:59:42 +00:00
TreeHugger Robot
6fd7cf1993 Merge "Do not let guest user disable secuer nfc via SettingsSlice" into qt-dev am: 2f184b0ff4 am: e3bbadb7df
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18158869

Change-Id: I6c7835e9885cf02ba167a8f4ac1c564bad511e6d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 07:34:09 +00:00
TreeHugger Robot
e3bbadb7df Merge "Do not let guest user disable secuer nfc via SettingsSlice" into qt-dev am: 2f184b0ff4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18158869

Change-Id: Ia3a38063419fccfc6e1be8135180a3a433ebbd23
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 07:15:36 +00:00
TreeHugger Robot
2f184b0ff4 Merge "Do not let guest user disable secuer nfc via SettingsSlice" into qt-dev 2022-06-02 06:52:53 +00:00
Tsung-Mao Fang
edf4416177 [DO NOT MERGE] Fix can't change notification sound for work profile.
Use correct user id context to query the type,
so we won't get empty result unexpectedly.

If we get the null result, then we won't set sound sucessfully.

Bug: 233580016
Bug: 221041256
Test: Manual test and set work profile sound works.
Change-Id: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
Merged-In: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
2022-06-02 10:57:50 +08:00
Tsung-Mao Fang
32145cc362 [DO NOT MERGE] Fix can't change notification sound for work profile.
Use correct user id context to query the type,
so we won't get empty result unexpectedly.

If we get the null result, then we won't set sound sucessfully.

Bug: 233580016
Bug: 221041256
Test: Manual test and set work profile sound works.
Change-Id: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
Merged-In: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
2022-06-02 10:55:47 +08:00
Arc Wang
d94b73b304 [DO NOT MERGE] Fix Settings crash when setting a null ringtone
Ringtone picker may callback a null ringtone Uri
if users select None.

This change pass null ringtone Uri to RingtoneManager
and return.

Bug: 232502532
Bug: 221041256
Test: maunal
      Settings - Sound & Vibration -> Phone ringtone
      -> My Sounds -> None
Change-Id: I044b680871472a3c272f6264c4ef272df542112e
Merged-In: I044b680871472a3c272f6264c4ef272df542112e
2022-06-02 09:52:17 +08:00
Arc Wang
973a46134b [DO NOT MERGE] Fix Settings crash when setting a null ringtone
Ringtone picker may callback a null ringtone Uri
if users select None.

This change pass null ringtone Uri to RingtoneManager
and return.

Bug: 232502532
Bug: 221041256
Test: maunal
      Settings - Sound & Vibration -> Phone ringtone
      -> My Sounds -> None
Change-Id: I044b680871472a3c272f6264c4ef272df542112e
Merged-In: I044b680871472a3c272f6264c4ef272df542112e
2022-06-02 09:51:42 +08:00
Raphael Kim
8d749c55f4 Extract app label from component name in notification access confirmation UI
Bug: 228178437
Test: Manually tested on POC
Change-Id: I8613d9b87a53d4641c0689bca9c961c66a2e9415
Merged-In: I8613d9b87a53d4641c0689bca9c961c66a2e9415
2022-06-01 22:24:39 +00:00
Lin Yuan
78799a550a RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning
Make DISALLOW_CONFIG_LOCATION effectively disallow wifi scanning and
bluetooth scanning settings for location services.

screenshots: https://screenshot.googleplex.com/AqvEW2kTrQT2Ufp

Bug: 228315522
Bug: 228315529
Test: manually on sunfish flashed with rvc.
Change-Id: I6ef64a34764e52de7b461e87ea0af40a6d050587
2022-06-01 07:17:47 -04:00