Commit Graph

24 Commits

Author SHA1 Message Date
Hugh Chen
208e32af9f RESTRICT AUTOMERGE 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
(cherry picked from commit 8adedc6249)
2021-04-26 03:42:48 +00:00
Hugh Chen
8ecca02ece RESTRICT AUTOMERGE 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.

Merge Conflict Notes:
There were a number of entries in strings.xml that did not exist on this
branch. However, as the CL only adds new entries rather than modifying
old ones this should not cause a problem. There were no merge conflicts
in the java files.

Bug: 167403112
Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests
Change-Id: Idc6ef558b692115bb82ea58cf223f5919b618633
2020-12-30 18:34:43 -08:00
Jakub Pawlowski
4f7edf692f Prevent overlay drawing on top of Bluetooth activity dialog
Bug: 168504491
Change-Id: I04ebe580db2b299af2bd5e44e0b0f20bd42f8535
2020-11-19 13:47:53 +01:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Chienyuan
10b21a605b Always save message permission choice
For current design, message sharing option only display when
mapPermisson != CachedBluetoothDevice.ACCESS_UNKNOWN. MAP permisson only
saved when user reject requset twice or accept request, if user just
reject once, permission will be ACCESS_UNKNOWN and message sharing
option will not display. This patch remove the check of
MessageRejectionCount and always save message permission choice.

Bug: 120291728
Test: reject message access request and check device details page
Change-Id: I071491d3c4134ed348e195f054b6557e397cdd6a
2018-12-06 19:19:21 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00: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
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07: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
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Casper Bonde
faadcd60e7 Settings UI for SIM access profile (1/2)
Change-Id: Iff14295ac0eb65561a2097f25c70e8b5f8be5003
2015-05-05 16:59:17 +00: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
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
Alan Viverette
54ccaf6f77 Remove dialog icons
BUG: 16493564
Change-Id: I35ec0a8fc6ce3148b5bf469bfd2b56d0ae6d95ee
2014-07-22 18:40:48 -07:00
Zhihai Xu
9998639a65 BT keeps on asking me if I want to allow car to do stuff
We can remember it as a non persist global value when user click no.
This value won't be saved when power down.
We will restore the permission choice
when we are disconnected with the remote device.
So the "no" choice selected by user will only take effect
until we are disconnected with the remote device.

bug:11176511
Change-Id: Ic0c0829587cf7a812b5fa96fbd381921f67c186f
2013-10-11 12:15:19 -07:00
Edward Jee
46c746551f Once the user allows PBAP phonebook access, do not ask again.
Bug: 9876209
Change-Id: I8d9dcfa03e8d85577af4c4664fa34b3830e3d8f6
2013-09-23 15:21:27 -07: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
Ganesh Ganapathi Batta
40b77fe04b Fix NPE in bluetooth Permission Activity
This fixes a NPE by ensuring that cached device  list has
a cached device associated with a given BDA before accessing
the cached device
Bug:5964529

Change-Id: Ib2c3596e6e008c78f9f1137134e421ca710e1217
2012-09-10 12:50:05 -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