summaryrefslogtreecommitdiff
path: root/core/java/android/companion/CompanionDeviceManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Add a new association request failure codeEvan Chen2022-03-211-0/+50
| | | | | | | | | | | | | | | | | | | | | 1. Add the new association request failure codes RESULT_USER_REJECTED, RESULT_DISCOVERY_TIMEOUT RESULT_INTERNAL_ERROR 2. Add the new association failure reason: REASON_CANCELED, REASON_DISCOVERY_TIMEOUT, REASON_USER_REJECTED The change helps to identify user's action that the association request explicitly declined by the user Test: atest CtsCompanionDeviceManagerCoreTestCases atest CtsCompanionDeviceManagerUiAutomationTestCases atest CtsOsTestCases:CompanionDeviceManagerTest Bug: 223706865 Fix: 224559263 Change-Id: I50fe40780a977c5bbe0aac5b67e1925ea75058bb
* Use property instead of meta-data for primary CDM serviceEvan Chen2022-02-091-3/+3
| | | | | | | | | | Meta-data will increase the system server ram consumption. So we decide to use property instead of meta-data to indicate the primary cdm service. Test: atest CtsCompanionDeviceManagerCoreTestCases:SelfPresenceReportingTest Fix: 217953124 Change-Id: I91ebe374bba392d14d693d3c6a36433b5af7cf2a
* Introduce COMPANION_COMPUTER profile for Phone HubEvan Chen2022-01-261-0/+3
| | | | | | Bug: 216213933 Test: atest CtsCompanionDeviceManagerCoreTestCases:DeviceProfilesTest Change-Id: I2cd6cfc5e2b9df3708fae3e4db8164e36fc9717a
* Companion App Manages Connectivity State InterfacesEvan Chen2021-12-101-0/+45
| | | | | | | | | | | | | | Created two new APIs in CompanionDeviceManager: notifyDeviceAppeared and notifyDeviceDisappeared for companion apps report connectivity. Create a new callback method for user to override when device is connected and disconnected Bug: 199435613 Test: atest CtsCompanionDevicesTestCases Change-Id: I6884d085cf810fdd42466d620e888b07367c9b94
* Refresh CompanionDeviceManager's API surfaceSergey Nikolaienkov2021-11-241-131/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the AssociationInfo and DeviceId classes public. Deprecate the existing public associate() method that take a callback based on onDeviceFound(), and introduce a new one that takes an AssociationRequestCallback. Deprecate the existing public disassociate() method that takes a MAC address, and introduce another one that takes an associationId. Deprecate the existing public getAssociations() method that returns a list of MAC addresses, and introduce a new public method getMyAssociations() that retuns a list of AssociationInfo objects. Introduce new system API to retrieve list of all associations for a user: getAllAssociations(). Introduce new system APIs for monitoring changes to the existing associations: OnAssociationsChangedListener interface, and add(remove)OnAssociationsChangedListener() methods. Bug: 194301022 Test: atest CompanionDeviceManagerTest Test: atest BluetoothInstrumentationTests Test: atest SettingsRoboTests:NotificationBackendTest Change-Id: Ic0235db29b26ed1a427c71edb2eb0df76fa4dc4c
* Merge "Fix CDM memory leak for activity context" into sc-v2-dev am: ↵Guojing Yuan2021-11-081-1/+2
|\ | | | | | | | | | | | | | | 6ebf85244c am: 8e2c2f1b3f Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16201030 Change-Id: Ia9d2edd4be1cdac0247649a95261ba2f063df7e8
| * Fix CDM memory leak for activity contextGuojing Yuan2021-11-051-1/+2
| | | | | | | | | | | | | | Fix: 195968760 Test: N/A Change-Id: Ibbba40a64cd20ecc11e287c2bfd3afdb179a7a52
* | Rename CDM's Association class AssociationInfoSergey Nikolaienkov2021-10-271-2/+2
| | | | | | | | | | | | | | | | | | First step in making the Association(Info) class a part of the public API surface. Bug: 194301022 Test: make Change-Id: Ib1544ef7da471ae9fee1b9a9fabb01653454e277
* | Introduce DEVICE_PROFILE_APP_STREAMINGSergey Nikolaienkov2021-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | Introducing DEVICE_PROFILE_APP_STREAMING to CDM and a corresponding signature|privileged permission - REQUEST_COMPANION_PROFILE_APP_STREAMING. Bug: 202245486 Test: make Change-Id: I6116662ba2bb97d8e88a5df1cba3ff47a8b9c6c7
* | Rename CDM receiveMessage to dispatchMessageGuojing Yuan2021-09-271-6/+3
| | | | | | | | | | | | | | Fix: 200940347 Test: N/A Change-Id: Iea73ff7a2820f8b7711e105fc604a2e0b8901fc7
* | Add CDM data transfer interfacesGuojing Yuan2021-09-221-0/+29
| | | | | | | | | | | | | | | | | | Design: go/cdm-data-transfer-dd Fix: 198485833 Test: N/A Change-Id: I37fd8b84ceea671e76332042761d3f99f7090b98
* | Move off the deprecated Settings in CDMSergey Nikolaienkov2021-09-021-0/+5
|/ | | | | | | | | | | | Do not use Settings.Secure.ENABLED_NOTIFICATION_LISTENERS in CompanionDeviceManager. Deprecate CompanionDeviceManager(Service).hasNotificationAccess() methods. Bug: 198562936 Test: make Change-Id: I6924edee1b8d0b7409ce62349717017d1a52c610
* Update associate API by adding certificate paramGuojing Yuan2021-05-241-2/+7
| | | | | | | Fix: 184264581 Test: N/A Change-Id: Ie28a2e68826744c0f020113d1b85b5a4b2d54c7f
* Update BluetoothDevice#setAlias based on API council feedback: nowRahul Sabnis2021-05-171-3/+6
| | | | | | | | | | | | | accepts null input and returns an int (with error codes). Update CompanionDeviceManager#canPairWithoutPrompt to take a UserHandle instead of an int. Adds BluetoothStatusCodes class for all new Bluetooth error / success codes. Moved OOB and hci disconnect constants to the new BluetoothStatusCodes class. Tag: #feature Bug: 184714087 Test: atest BluetoothDeviceTest#test_setAlias_getAlias Change-Id: Ife03506f2cf68800f5824cb5fa94fec8aa34a39c
* Change associate return type to voidEugene Susla2021-04-121-5/+3
| | | | | | | | | Per API council feedback, since result wasn't meaningfully used Fixes: 184264581 Test: presubmit Change-Id: I65f2df6c2ce346c52cfc3f70d0ed8b63c41546d5
* Add clarifications to CDM javadocEugene Susla2021-04-071-0/+8
| | | | | | | | | | - clarify modes of operations for different wireless transports - add recommendation to use RPA in order to use the feature Fixes: 183984032 Test: proofread Change-Id: I7dc305890df5979278e198a25981a4876074082f
* Provide CDM API to associate without promptEugene Susla2021-03-241-0/+26
| | | | | | | | For use via FastPair(within GMSCore) Bug: 165951651 Test: atest CompanionDeviceManagerTest Change-Id: I7b94d52e59ad39e1d93360685cf64a3dc068d05e
* Makes BluetoothDevice#setAlias a public APIRahul Sabnis2021-03-221-0/+28
| | | | | | | Tag: #feature Bug: 181093329 Test: atest BluetoothDeviceTest Change-Id: Ib94bedab5d6d4c63a19096f61187f58dd8937b55
* Add @RequiresPermission for CDM watch profile useEugene Susla2021-03-051-0/+8
| | | | | | Bug: 165951651 Test: presubmit Change-Id: Id1c3b2656875de07cfc3fd936d528d0410a62aee
* API for CDM wake-up opt-inEugene Susla2020-12-101-0/+72
| | | | | | Bug: 168052577 Test: presubmit Change-Id: I1cd1728099ddf374db4cf0e59f748ea3b655e1ba
* Remove @TestApi from @SystemApi symbolsAnton Hansson2020-10-201-2/+0
| | | | | | | | | | | | | I ran these commands: cd frameworks/base grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs' grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs' Bug: 171179806 Test: m checkapi Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
* Merge "Minor grammar fix in CompanionDeviceManager javadoc." am: f052b7bf91 ↵Treehugger Robot2020-10-161-1/+1
|\ | | | | | | | | | | | | | | am: c713a670c9 am: 8bac874a53 am: b30fe6f42d Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1462962 Change-Id: If257eb57c8f6619a46cd684cc46835a263b977be
| * Minor grammar fix in CompanionDeviceManager javadoc.Taylor Bessette2020-10-151-1/+1
| | | | | | | | Change-Id: I57cd5ccc14a26ad2d97dddefa1952651a0ce7b82
* | Expose syspem API for querying CDM associationsEugene Susla2020-09-141-0/+18
|/ | | | | | | | | | We want to restrict some BT capabilities(e.g. unpair device) to only the package's associated device. Since BT will become a mainline module, this needs to be exposed as a @SystemApi Test: ateast android.os.cts.CompanionDeviceManagerTest#testGetAllAssociations Bug: 165951651 Change-Id: Iab0da9352671e0b82ac855f91a6625c810946d17
* Clarify type of EXTRA_DEVICE in javadocEugene Susla2020-06-301-0/+7
| | | | | | | | | We have this in guide but not in javadoc, but it would make sense to have it in javadoc as well. Test: presubmit Change-Id: I585248cc40c44bfa90828f04e4b5bd34694c36fd Bug: 139376317
* Update CompanionDeviceManager javadoc to include thePaul Murphy2020-03-171-4/+15
| | | | | | | | COMPANION_APPROVE_WIFI_CONNECTIONS_PERMISSION Change-Id: I07b5ea07ccd0d28e589b586dd6fbf4816f035679 Test: None, this is strictly a javadoc update Bug: 151311975
* [CDM][WIFI] Provide a permission for Wi-Fi association approval for ↵Etan Cohen2020-01-221-2/+2
| | | | | | | | | | companion apps Rename API to make it explicit to Wi-Fi. Bug: 135211972 Test: atest android.os.cts.CompanionDeviceManagerTest Change-Id: I75b6d13432407a4e2804b57dcf6956055c9cefb6
* Replace com.android.internal.util.Preconditions.checkNotNull withDaulet Zhanguzin2019-12-301-8/+6
| | | | | | | | | java.util.Objects.requireNonNull Bug: 126528330 Test: Treehugger Change-Id: I1634f81bd92d9a93ac8c8f39c218e8002cbaf497
* Add CDM system api to check for association presenceEugene Susla2019-10-301-0/+37
| | | | | | | | | | Per agreement with wifi team, wifi stack will call into CDM when wifi connection is requested, treating CDM record similarly to the previously approved networks records, i.e. skipping UI when association exists. Test: atest android.os.cts.CompanionDeviceManagerTest Fixes: 143572863 Change-Id: I28b44076e594fb9357b5a543176d285414ef06f8
* Link to CDM guide from CDM javadocEugene Susla2019-10-251-0/+4
| | | | | | | | The guide is apparently somewhat hard to find, so this adds another way to discover it. Test: presubmit Change-Id: I838d6b0ca312c46aac501b696bda1eecccef0bda
* [Companion] Don't promise call back on javadocEugene Susla2018-03-011-1/+1
| | | | | | | | | | We only stop scanning on timeout but don't limit the time the user has to select a device. So timeout != failure. Cleaning that up from javadoc to avoid confusion Fixes: 74080737 Test: proofread Change-Id: I36b2d96f85c3c15c20742b954a0b34956f23d6f8
* Merge "[Companion] Synchronize state access in CallbackProxy"TreeHugger Robot2017-08-181-23/+32
|\
| * [Companion] Synchronize state access in CallbackProxyEugene Susla2017-07-121-23/+32
| | | | | | | | | | | | Fixes: 63383044 Test: Ensure companion pairing still works Change-Id: I5493d37acbcc6f4128d2c2aaf87d0b69f491d0f6
* | Fix broken javadocs.Jeff Sharkey2017-08-061-2/+2
|/ | | | | | Bug: 64337634 Test: make -j32 doc-comment-check-docs Change-Id: I20fdd3dcddef09111d35946c41c596c7689effa6
* [Companion] Prevent NPE in CallbackProxyEugene Susla2017-07-101-2/+14
| | | | | | | Fixes: 63383044 Test: Ensure all fields of CompanionDeviceManager.CallbackProxy are null-checked in onSuccess and onFailure Change-Id: If95a46686f74d184bccfcb2d8c8195add4747a07
* Merge "[Companion] Fix notification access dialog being in new task" into oc-devTreeHugger Robot2017-06-201-2/+4
|\
| * [Companion] Fix notification access dialog being in new taskEugene Susla2017-06-191-2/+4
| | | | | | | | | | | | | | Fixes: 62678460 Test: Tap recents while the dialog is shown and ensure it's not in a separate task Change-Id: I0572ddc84d76643ac8a373939273c221ff20676f
* | [Companion] Fix NPE in associateEugene Susla2017-06-161-0/+1
|/ | | | | | | | | | The root cause of the exception was that the activity destroy listener was reacting to any activity being destroyed instead of just the one used with the CompanionDeviceManager Fixes: 62549525 Test: Ensure the attached bug no longer reproduces Change-Id: I2f977e9ac9176247f5be9d08d19b3875f2b4a703
* Annotate @SystemApi with required permissions.Jeff Sharkey2017-06-051-0/+2
| | | | | | | | | | | | | | | | | Most @SystemApi methods should be protected with system (or higher) permissions, so annotate common methods with @RequiresPermission to make automatic verification easier. Verification is really only relevant when calling into system services (where permissions checking can happen on the other side of a Binder call), so annotate managers with the new @SystemService annotation, which is now automatically documented. This is purely a docs change; no logic changes are being made. Test: make -j32 update-api && make -j32 offline-sdk-docs Bug: 62263906 Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
* Avoid activity leak via Companion callbackEugene Susla2017-05-111-19/+60
| | | | | Test: invoke associate() API and ensure it still works Change-Id: I9aedb043b4b1f0d77f076d8753cd60ff7c98a7d6
* Add javadoc about APIs requiring uses-featureEugene Susla2017-04-241-0/+15
| | | | | | Bug: 37629514 Test: Ensure no compilation error; proofread Change-Id: Ia250c95da1edb20017bc13a4504ead092eb24fff
* API for notification listener for Companioon appsEugene Susla2017-04-141-8/+35
| | | | | | | | Test: 1. Trigger the confitrmation dialog. Ensure it looks exactly like the one from settings. 2. Call an API without associating the appa first Ensure exception is thrown with a message mentioning the need to associate 1st Change-Id: I94d4116e1988db869ed445ae3fd018c50590e3f4
* Add ICompanionDeviceManager.getAssociation overload with explicit userIdEugene Susla2017-04-071-1/+1
| | | | | | | Bug: 30932767 Test: ensure getAssociations works as before Change-Id: I58dc4dac5bf7aae83fe3611890116a928e290a43 (cherry picked from commit 544d714626db38714f826a31a5483c647510a743)
* Merge "Unbind from service on app killed and dedup association requests"TreeHugger Robot2017-03-271-6/+6
|\
| * Unbind from service on app killed and dedup association requestsEugene Susla2017-03-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Listen to calling package binder death stopping the scanning on that. 2. Don't restart scanning when a request with the same values was made. Bug: 30932767 Test: 1.: - Using a test app start scanning and kill the app. - In debug mode ensure that DeviceDiscoveryService#stopScan gets triggered 2.: - Start scanning and rotate the device while device chooser is visible - Ensure no visible loss of state is happening Change-Id: If126a2c963da90172a956fbd88e6b3dcd7ac8b01
* | Fix companion device feature presence checkEugene Susla2017-03-241-1/+1
|/ | | | | | | | There was a typo causing the feature to be falsely detected as not present. Test: Ensure feature presence is now detected correctly Bug: 30932767 Change-Id: I44d137e89546596058b272e8eeaccc0a1db21aef
* Merge "Add system feature for Companion Device Manager"Eugene Susla2017-03-211-1/+31
|\
| * Add system feature for Companion Device ManagerEugene Susla2017-03-141-1/+31
| | | | | | | | | | | | | | | | Bug: 30932767 Test: Add just the feature gating first, ensure Context#getSystemSetrvice now returns null. Add feature in the configuration files, ensure companion device feature works again. Change-Id: I4ad2d52f7877eae0e951f43ddbb23881d5de8d8b
* | Support multiple filters per association requestEugene Susla2017-03-091-1/+1
|/ | | | | | | | | | | | | | | | By supporting multiple filters per one request we should be able to cover multiple kinds of use cases such as: - Letting the user select from a list of devices of more then one medium type (e.g. Bluetooth and BLE) - Allowing to provide multiple criteria for any field (e.g. filtering by more than one service UUID) Bug: 30932767 Test: Provide multiple filters and ensure that devices matching either are shown in the list to choose from. Ensure wifi SSIDs are shown in the list if wifi filter is provided Change-Id: I0a978787551a1ee5750ec5544b241d3bbfed5a7c
* Revert "Support multiple filters per association request"Hector Tellez2017-03-091-1/+1
| | | | | | This reverts commit e70e6aa62c6f3a9a79624a4f9d97df95edda0364. Change-Id: I12857cbbea0a0c74521191ab5e3713db230626ab