Commit Graph

40 Commits

Author SHA1 Message Date
Hieu Dang
420a8474db Merge "Show Bluetooth dialog in a specific case" am: e1e657dac3
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2424645

Change-Id: I9e231ac0e16c8e8217be53cc89335758b14be6a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 02:02:08 +00:00
My Name
2e552331e9 Show Bluetooth dialog in a specific case
If the application that initiate the bonding with
BluetoothDevice#createBond is in foreground, then should dialog only
instead of showing the notification & dialog

Bug: 175931562
Tag: #refactor
Test: manual
Change-Id: I3673a0b58cbf9caabf62c951b84b49e17cfb13b8
2023-02-10 08:31:34 +00:00
William Escande
723df89aaa Fetch currently loaded bluetooth name
Test: m
ROBOTEST_FILTER="BluetoothMaxConnectedAudioDevicesPreferenceControllerTest"
RunSettingsRoboTests -j40

Test: m ROBOTEST_FILTER="com.android.settings.bluetooth" RunSettingsRoboTests
Test: Open developer settings
Bug: 257158801
Change-Id: Ib40a6264d8d6908103d76b6401ddcfd3ffa7dd88
2022-11-04 03:05:41 +00:00
Oriol Prieto Gasco
f528e7de49 Use com.android.bluetooth as the BT stack APK
Test: TH
Bug: 236187653, 236192423
Change-Id: Ia86d195780a4994607b5533420cb72bd458d4f9a
2022-06-19 23:06:06 +00:00
Roopa Sattiraju
64f9d41ee3 Changing apk name in the manifest and the corresponding packages.
BUG: 226403247
Test: TH
Change-Id: I49ad1169899ffbb76ad00f7d5d02f815ace295e7
2022-03-24 10:30:03 -07:00
Hugh Chen
a08897bcb3 Delete useless parameters of string
Bug: 211766972
Test: build pass
Change-Id: I83969753a5d2f632182e0dd241905474899f1c6d
2021-12-24 03:58:46 +00:00
Jeff Sharkey
7025a83f39 Update to modern Bluetooth permissions.
The Settings app offers several Bluetooth intents, and they need to
be updated to enforce the new "Nearby devices" runtime permission
model, since the old BLUETOOTH and BLUETOOTH_ADMIN permissions have
been deprecated.

Bug: 191174082
Test: TH
Change-Id: I0d812f486bc3dadc517d5b04d3082d4f56f60ef4
2021-06-23 08:53:05 -06:00
Hugh Chen
10e4599219 Fix phishing attacks over Bluetooth due to unclear warning message
This CL add more prompts presented for users to avoid phishing attacks.

Screenshot:
https://screenshot.googleplex.com/p5PZbphN46ddPFV.png
https://screenshot.googleplex.com/6Q2wKfPbNQmTtx8.png
https://screenshot.googleplex.com/987VpYgNUZL2K4T.png
https://screenshot.googleplex.com/9eVg6SAGScVXU8U.png

Bug: 167403112
Test: manually test
Change-Id: Iadec059b662fd91754ad573bbe688702cdd3c9af
2021-06-03 16:42:09 +08:00
Hugh Chen
8adedc6249 Fix bluetooth settings will broadcast to anywhere when some cases
BluetoothPermissionActivity and DevicePickerFragment will send
broadcast to return the result to calling apps. As this broadcast
intent is from Settings with uid 1000, it will be sent to any
protected BroadcastReceivers in the device. It can make an attacker
send broadcast to protected BroadcastReceivers like factory reset intent
(android/com.android.server.MasterClearReceiver) via
BluetoothPermissionActivity or DevicePickerFragment.

This CL will not allow to set package name and class name to avoid
the attacker.

Bug: 179386960
Bug: 179386068
Test: make -j42 RunSettingsRoboTests and use test apk to manually test
to verify factory reset not started and no system UI notification.

Change-Id: Id27a78091ab578077853b8fbb97a4422cff0a158
2021-04-12 14:10:42 +08:00
Hugh Chen
802cb176d0 Revert "Fix bluetooth settings will broadcast to anywhere when some cases"
This reverts commit 9d00364da4.

Reason for revert: This fix have a regression, for not blocking b/183344112 revert it.

Change-Id: Ic4366b51e07b43c8d64d2e145563d8a30cb0fc60
2021-04-01 02:24:51 +00:00
Hugh Chen
9d00364da4 Fix bluetooth settings will broadcast to anywhere when some cases
BluetoothPermissionActivity and DevicePickerFragment will send
broadcast to return the result to calling apps. As this broadcast
intent is from Settings with uid 1000, it will be sent to any
protected BroadcastReceivers in the device. It can make an attacker
send broadcast to protected BroadcastReceivers like factory reset intent
(android/com.android.server.MasterClearReceiver) via
BluetoothPermissionActivity or DevicePickerFragment.

This CL will compare to calling package name with launch package name.
If they are not equal, the broadcast will not send to launch package name.

Bug: 179386960
Bug: 179386068
Test: make -j42 RunSettingsRoboTests and use test apk to manually test
to verify factory reset not started and no system UI notification.

Change-Id: Ib8a5acde663e875912d300dd4912c4e9416f02f1
2021-03-12 14:56:57 +08:00
TreeHugger Robot
852a19b7a6 Merge "Fix phishing attacks over Bluetooth due to unclear warning message" 2020-12-17 08:46:03 +00:00
Hugh Chen
db9175015a Fix phishing attacks over Bluetooth due to unclear warning message
Before this CL, there is a possible phishing attack allowing a malicious
BT device to acquire permissions based on insufficient information
presented to the user in the consent dialog. This could lead to local
escalation of privilege with no additional execution privileges needed.
User interaction is needed for exploitation.

This CL add more prompts presented for users to avoid phishing attacks.

Bug: 167403112
Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests
Change-Id: Idc6ef558b692115bb82ea58cf223f5919b618633
2020-12-17 11:29:31 +08:00
TreeHugger Robot
6172a98b2b Merge "Add bluetooth package to permission request intent" into oc-mr1-dev am: 504b96d76c am: 2117006bc6 am: cfdae774cd am: 635029b87f am: f49e9d2196 am: 423bcb4fbe
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13088581

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I01cfff4403d6e3499ae2608e34b9184b6358097f
2020-12-09 14:31:49 +00:00
TreeHugger Robot
cfdae774cd Merge "Add bluetooth package to permission request intent" into oc-mr1-dev am: 504b96d76c am: 2117006bc6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13088581

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If3605d2b4dbad8b7b4979b644c89352ee8449ba1
2020-12-09 12:17:08 +00:00
Chris Manton
1951d27669 Add bluetooth package to permission request intent
Limit the component that may resolve this intent to the
bluetooth package.

Bug: 158219161
Test: Security Fix
Tag: #security
Change-Id: If732f940a7aa256f5975349118e8eb6cf5584676
2020-11-19 10:20:24 +00:00
Hugh Chen
40d4e47b05 Add the explicitly mutable flag for creating a PendingIntent
- Android S+ to specify explicitly either FLAG_MUTABLE or FLAG_IMMUTABLE
  when creating a PendingIntent.
- Suggest to use the FLAG_IMMUTABLE as default. Change it to
  FLAG_MUTABLE while errors occur.

Fixes: 172207262
Fixes: 172207195
Fixes: 172205385
Fixes: 172204525
Fixes: 172205897
Test: build pass, manual test to paring blutooth device and doing
seamless transfer

Change-Id: Ic37b37bdbe6de6bdbad741985d3a920334240d80
2020-11-04 10:59:34 +08:00
hughchen
ab1bc299d8 Use BluetoothDevice.ACCESS_* instead of CachedBluetoothDevice.ACCESS_*
1. Use BluetoothDevice.ACCESS_* instead of CachedBluetoothDevice.ACCESS_*
2. Use BluetoothDevice.setPhonebookAccessPermission() directly.
3. Use BluetoothDevice.setMessageAccessPermission() directly.
4. Use BluetoothDevice.getPhonebookAccessPermission() directly.
5. Use BluetoothDevice.getMessageAccessPermission() directly.
6. Use BluetoothDevice.getSimAccessPermission() directly.

Bug: 112517004
Test: make -j42 RunSettingsRoboTests
Change-Id: Ibe6b207b891b9bd2b328a2e2c7264a9a78cb498f
2018-08-23 11:27:49 +08:00
timhypeng
f5c0145912 Remove LocalBluetoothAdapter from CachedBluetoothDeviceManager::addDevice()
Bug: 111815935
Test: make -j50 RunSettingsRoboTests

Change-Id: I5294439853ce35bccd883ed2aa21b33802d76cb1
2018-08-15 03:52:52 +00:00
Chienyuan
20002d0309 Remove obsolete parameter from addDevice
Bug: 111966655
Test: build pass
Change-Id: I2f9475ad6b7588946421e852f0724ae616b107ba
2018-07-30 20:22:40 +08:00
Marie Janssen
3cc4522cbc Merge "Bluetooth: Make notifications local-only" am: 348a7085fa
am: 620fe71520

Change-Id: I3df0a009c7fc6184ea1176f6953748c5031d76cd
2017-06-22 15:41:55 +00:00
Marie Janssen
426903d155 Bluetooth: Make notifications local-only
This will prevent them from showing up on external devices where they
would be less than useful.

Test: connect to watch and pair a device
Bug: 34612389
Change-Id: I8b02c20200ce78a73967b8121cf7d5653b68f356
2017-06-19 16:11:33 -07:00
Hemant Gupta
7bec5bf895 Settings: Convert notifications to use NotificationChannel (2/2)
Test Setup:
===========
HW DUT: Pixel O
Remote: MecApp (PBAP Client, MAP Client, SAP Client)

Steps:
=====
1. Enable BT on DUT and bond with Remote.
2. Connect from MecApp for PBAP, MAP, SAP and observe if
   connection goes through fine.

Reproducibility:
===============
5/5

Observation:
============
MAP, PBAP and SAP cannot be connected.

Root cause:
In Android O, notifications are hidden by default.
This must be changed to use notification channels so that the
priority of the notifications can be updated.

Test: PBAP/MAP/SAP connection works fine with MecApp.

Bug: 38331825
Change-Id: I51de0ea303037bf88773352d99f092673acda2e3
(cherry picked from commit bd9f532013f0397879101f68f21ac8841fec344b)
2017-05-19 23:33:29 +00:00
Marie Janssen
68a414e86c Merge "Bluetooth: leave screen off for permission request" am: 172b01035d am: 09f5638b92
am: 895ac35f4d

Change-Id: I9e162f37b76ad8e7adc438d082d8352720916df0
2017-03-15 23:02:23 +00:00
Marie Janssen
14ef1e4417 Bluetooth: leave screen off for permission request
Test: pair to a carkit, disable pbap, reconnect from carkit
Bug: 32555940
Change-Id: I06d6cc0873f9f991e68f1de9b629dbe3a7bb7701
2017-03-10 09:57:03 -08:00
Robin Lee
788671647c Eliminate useless 'isManagedProfile' utils method
This exists in UserManager now

Change-Id: If35326a1fe0de3c7bfde842c5c170899dc5d819b
2016-09-12 16:25:28 +09:00
Fan Zhang
97ca78975a Use same fallback bt name in Settings and notification.
Bug: 30126659
Change-Id: Id1432b459a4368bae9af6067307c4da0008f94aa
2016-08-08 14:48:24 -07:00
Michael Wright
dab743b95c Always show pairing dialog for device-specific keyboard.
Bug: 22876536
Change-Id: Ief9f6343d435747050bb7910f934e4777f5116de
2015-09-17 15:23:46 +01:00
Hemant Gupta
b8df8a29bf Bluetooth: Acquire wakelock to turn on LCD for MAP authorization
This patch acquires a wakelock to turn on the LCD display if the screen
is off during an access request for MAP. Without this patch it was
observed that if the screen was off, the LCD remained off for incoming
connection access request from remote devices and the user only heard
the notification sound without the LDC being lit up.

Change-Id: I87c296fce4cd8e0c133f74169d991eee263fed08
2015-06-02 02:24:28 -07:00
Casper Bonde
faadcd60e7 Settings UI for SIM access profile (1/2)
Change-Id: Iff14295ac0eb65561a2097f25c70e8b5f8be5003
2015-05-05 16:59:17 +00:00
Alan Viverette
55eaa96fe4 Clean up usage of theme colors, deprecated Resources.getColor* methods
Change-Id: I34e11e0773c9f8e00e3eab422781094e19a16d3d
2015-03-18 18:10:52 -07:00
Jason Monk
f2982a9ba1 Move isolatable bluetooth code to SettingsLib
Move the non-ui bluetooth control/tracking code to SettingsLib so
that it can be shared with others.

Mostly just move classes to frameworks/base/packages/SettingsLib,
however a few things had to move around.
 - Dock handling had to move back to code still in settings
 - Local preference related code had to be moved back to settings
 - Added an error flow from SettingsLib to Settings

Depends on I69fd888362c6dbb325f6113b32c4b15cc6a23a41
Bug: 19180466
Change-Id: Ie57fe26a27bbb0adc2ef69e042a05c7290c6a52a
2015-02-05 10:43:57 -05:00
Benjamin Franz
0fe3ed5ab5 Block BluetoothPermissionRequest notification on managed profiles.
This notification is triggered when a bluetooth device that supports
the PBAP protocol. On managed profiles this functionality is not yet
available and therefore the notification and resulting acvitivity
have no function.

Bug: 18782769
Change-Id: Iaea12eee8ec4727d9448f690861f8344e2296028
2015-01-02 12:54:01 +00:00
Edward Jee
ac8b5b7fd6 Migrates PBAP and MAP access permission data from Settings to Bluetooth.
Currently, users' preference in phonebook and call history or message
access per each Bluetooth-paired device is stored in Settings application's
shared preferences.

However, some privileged applications other than Settings need to access
such data. So we decided to migrate the data from Settings application's
shared preferences to Bluetooth application's.

Bug: 17158953
Change-Id: I44fde350ea35027df0de77feec1ea19c65f2f1c6
2014-09-16 01:25:47 +00:00
Selim Cinek
4ce62f3fab Added colors to system notifications
Bug: 17128331
Change-Id: I0cf0fe76a97d9dd772cd23475eddf5bdb92b2cca
2014-08-27 13:09:44 +02:00
Kim Schulz
5d2595f051 MAP 1.1 Review fixes
- Fixes to the issues found during review.
- added support for BluetoothProfile ProfileService Classes
- Added new MapProfile.java to comply with new structure
- changed ORDINAL to use BluetoothProfile.MAP directly
- Moved construction of MapProfile to LocalBluetoothProfileManager constructor
- Added support for multiple concurent permission activities and/or multiple notifications (i.e. pbap and map permission request right after each other)
- cleanup
- changed settings to use Notification.Builder
- made the notifications for map/pbab more informative
- added handling of back button + "clear all notifications"

Bug:10692365
Change-Id: I9803c9658a96b1a9c1d4734d2fdd22f1421d2827
2013-09-13 15:44:26 -07:00
Matthew Xie
5b5b1e39dd Bluetooth MAP profile - sms and mms support initial check-in
bug:10116530

Change-Id: I3f50e66420e53bf21a1ecba06aed6b8261ff3064
2013-08-09 15:47:10 -07:00
Matthew Xie
b707255a44 Remember user choice for phone book access permission dialog
Change the always-allowed checkbox to be don't-ask-again checkbox to remember
user's decision so that user will not be bothered agian if he/she checks
the don't-ask-again checkbox
bug 5099661

Change-Id: If32ab8e93313bbd33ff040553083f0cf9359b69e
2011-08-18 16:31:30 -07:00
Matthew Xie
2036ebd889 Save changed name from CachedBluetoothDevice to native storage
The change preserves the friendly name change over power cycle.
bug 5081605

Change-Id: I2b2cce5a789c72d52439511c42df369639eb0b4b
2011-07-27 17:35:48 -07:00
Matthew Xie
dbed12020c Show user dialog for BT connection and phonebook access
Show user dialog for incoming BT connection requests from unknown
devices. Move phone book access permission dialog from bluetooth to settings.
The permision dialog pops up to the screen properly instead of
always as notification. AT+CPBR will also use the permission dialog
to ask for user permission.

bug 4489572

Change-Id: Ic1e74b2a9416a462cac4f519240a313691da90c4
2011-06-29 23:33:26 -07:00