Commit Graph

53 Commits

Author SHA1 Message Date
Joy Babafemi
7f91676147 UWB: Add getAdapterState System API
Test: Updated tests for AdapterStateListener.java
Bug: 183254940
Change-Id: I9a7472be2c7cf835cda8910261ba641bf2345b27
2021-04-23 19:14:10 +00:00
Joy Babafemi
49511145e9 UWB: Add setUwbEnabled System API.
Test: Test updated for AdapterStateListener.java
Bug: 183254940

Change-Id: I269d24c995d8064f8e62c80a1566fa0646e96580
2021-04-21 05:55:58 +00:00
TreeHugger Robot
1027fb5c21 Merge "Fix oneway error on IUwbRangingCallbacks calls" into sc-dev 2021-04-21 05:47:36 +00:00
Mat Bevilacqua
29ad8e6798 Fix oneway error on IUwbRangingCallbacks calls
Bug: 185948331
Test: atest android.uwb.cts.UwbManagerTest
Test: atest android.uwb
Change-Id: Ifd35f7cced39937c8e0766be6a1efde655c014fb
2021-04-20 18:55:09 -07:00
Roshan Pius
3ec33a7ef6 UwbService: Enforce UWB_RANGING runtime permission
i. Use the provided AttributionSource for runtime permission checks.
ii. Check for preflight permissions when the callbacks are registered
during openRanging.
iii. Check for data delivery permission when the callback is providing
a new ranging result.

Bug: 183904955
Test: Compiles
Change-Id: I8f3b42d865ac0d33d579ad4558b3aad6470bba94
2021-04-13 20:28:00 -07:00
Roshan Pius
27e1a87a48 Uwb: Create a new Uwb system service
This thin AOSP service layer will trampoline all API calls to the vendor
UWB service.

In follow up CL's,
i. The AOSP service will perform all the permission checks
necessary for this API surface before forwarding the call to the vendor
UWB service.
ii. Similarly, it will perform necessary permission checks +
noteOp before forwarding the ranging callbacks from the vendor service
back to the apps.

Bug: 183904955
Test: atest android.uwb.cts.UwbManagerTest
Test: atest com.android.server.uwb
Change-Id: I2b367d1b6accc2f4e075cacb5c8e3c51f1faf5db
2021-04-13 08:47:31 -07:00
Thierry Strudel
e7edb005c5 Merge "UWB: Add Reason to onRangingStop()" into sc-dev 2021-04-08 16:20:12 +00:00
Harpreet "Eli" Sangha
bfc70149cf Merge "UWB: Annotate DistanceMeasurement Parameters" am: 159a635593 am: b2a10a7811 am: a647964125
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1666840

Change-Id: I893fbffddc10e92c9cd902f14fa91a288f4d7fdd
2021-04-08 07:56:25 +00:00
Harpreet "Eli" Sangha
ad30565793 Merge "UWB: Remove Unused RTSU Constants" am: f617f30ee0 am: bb579654f9 am: d0a00f0bd9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1666999

Change-Id: I31ee24ac7aee38fe047166ac0f7bd4e7abaae9b7
2021-04-08 07:51:24 +00:00
Harpreet "Eli" Sangha
159a635593 Merge "UWB: Annotate DistanceMeasurement Parameters" 2021-04-08 06:04:54 +00:00
Harpreet Eli Sangha
dd0543f051 UWB: Add Reason to onRangingStop()
Bug: 184689372
Test: atest android.uwb
Signed-off-by: Harpreet Eli Sangha <eliptus@google.com>
Change-Id: Iff880ac6d8343df784fb8cb830ec830749351820
2021-04-07 12:46:35 +09:00
Harpreet Eli Sangha
b99c5b61ad UWB: Annotate DistanceMeasurement Parameters
Bug: 184204591
Test: Build
Signed-off-by: Harpreet Eli Sangha <eliptus@google.com>
Change-Id: Ifabfef88773db111cc119e4376183281f0ef3970
2021-04-07 12:45:34 +09:00
Harpreet Eli Sangha
64d44e2a4b UWB: Remove Unused RTSU Constants
Bug: 184691885
Test: Build
Signed-off-by: Harpreet Eli Sangha <eliptus@google.com>
Change-Id: I92a3b5ec96bd152544b9b46dfacfdd970e5b7d1f
2021-04-07 12:11:03 +09:00
Roshan Pius
a88aa31269 UwbManager: Use AttributionSource for runtime permission enforcement
This attribution source is going to be used by Gmscore to proxy
the blame for uwb_ranging runtime permission check (since Gmscore which
is the direct caller of this surface is in most cases proxying the
request from 1p/3p apps).

Note: This CL just adds the skeletal API to start the API reviews. The
actual implementation needs a major refactor of the stack which is WIP.

Bug: 183904955
Test: atest android.uwb
Change-Id: Ia0338b573306f44c493bf1c136e68b4f46877816
2021-04-05 17:31:31 -07:00
Harpreet Eli Sangha
1bf9cb029b UWB: Annotate AngleMeasurement Parameters
Bug: 180395817
Test: Build
Signed-off-by: Harpreet Eli Sangha <eliptus@google.com>
Change-Id: Ic4ea2049086ba7593021dbbc2ef7b8f6283d8540
2021-03-24 18:37:01 +09:00
Brian Stack
1f84a50fc6 Pass SessionHandle to UWB Service when opening a session
Instead of having the UWB Service generate a SessionHandle for each
call to IUwbAdapter#openRanging, now the framework must select and
pass in a SessionHandle. This helps to improve consistency across the
API surface and simplifies the implementation of
IUwbAdapter#openRanging.

Bug: 179273688
Test: atest UwbManagerTests
Change-Id: Ie08216638c8a5bf7260fff8752a46aad06f53fcb
Merged-In: Ie08216638c8a5bf7260fff8752a46aad06f53fcb
2021-03-10 12:10:18 -08:00
Brian Stack
23d41b8f0f Return CancellationSignal when opening UWB session
Returns a CancellationSignal instead of an AutoCloseable when calling
UwbManager#openRangingSession per API feedback.

Bug: 180396069
Test: atest UwbManagerTests CtsUwbTestCases
Change-Id: I74482c56d1a3686b570c90e7d3c11e45ec2f0adc
Merged-In: I74482c56d1a3686b570c90e7d3c11e45ec2f0adc
2021-03-10 12:10:11 -08:00
Brian Stack
78bce9af5b Address UWB API feedback
Update AngleOfArrivalMeasurement and AngleMeasurement to address
feedback received on API surface.

Bug: 180395817
Test: atest UwbManagerTests CtsUwbTestCases
Change-Id: Iec572ed9df22440a5b068d9e7fbf73026970d5d3
Merged-In: Iec572ed9df22440a5b068d9e7fbf73026970d5d3
2021-03-10 12:10:04 -08:00
Brian Stack
752aee7e04 Merge "Remove unnecessary UWB functions" 2021-02-25 19:16:03 +00:00
Brian Stack
9b23577b77 Remove unnecessary UWB functions
The removed functions provided no added benefit to the current UWB
API. For instance, the supported channels for an individual protocol
may be different than what UwbManager#getSupportedChannelsNumbers
would return. Instead, the supported channels are provided through the
UwbManager#getSpecificationInfo API which allows a client to easily
see which channels (and other parameters) a particular protocol
supports.

Bug: 180533171
Test: atest UwbManagerTests CtsUwbTestCases
Change-Id: I81675429d73486f0b002e76acabaa4883990ab11
Merged-In: I81675429d73486f0b002e76acabaa4883990ab11
2021-02-24 16:12:26 +00:00
Brian Stack
494aad3c8d Merge "Update UWB OWNERS" 2021-02-18 16:31:59 +00:00
Brian Stack
be1df1fed9 Update UWB OWNERS
Bug: 180514254
Test: N/A
Change-Id: I5998d024976ce4c171421a0c84d951914ccd5403
2021-02-17 10:42:54 -08:00
Brian Stack
996b7150ec Move UWB Tests to CTS
Bug: 179961516
Test: atest UwbManagerTests
Change-Id: I3bebae28e543e6931578488a75bfa30b4171b6ae
2021-02-17 09:20:36 -08:00
Brian Stack
613b8c890b Merge "Add new android.permission.UWB_PRIVILEGED" 2021-02-17 16:27:50 +00:00
Brian Stack
7d487f4001 Implement SessionHandle.hashCode()
Bug: 178807258
Test: atest UwbManagerTests
Change-Id: Ib3d518c136282393f4f3bb06388404f76fad5b73
2021-02-08 20:59:31 +00:00
Brian Stack
797aa2e1bb Fix log message errors in RangingManager
Bug: 179492073
Test: atest UwbManagerTests
Change-Id: I0fc429cc95e52bb16e40a6d24900bc657fefc9d3
2021-02-05 09:58:25 -08:00
Brian Stack
eb88ced71d Add new android.permission.UWB_PRIVILEGED
Bug: 170323306
Bug: 179051092
Test: atest UwbManagerTests
Change-Id: I79803ea71c706da558dbac11a075e65d1eece813
2021-02-02 11:56:35 -08:00
Brian Stack
4b2df3970c Add UWB APIs to SystemApi
Bug: 170323306
Test: atest UwbManagerTests
Change-Id: Id05accd44918ac6b9f11e78ee742fbd007896f7a
2021-01-21 09:41:39 -08:00
Brian Stack
674c30d330 Add control functions to RangingSession
Adds start, stop and reconfigure functions to UWB's RangingSession
along with associated callbacks in RangingSession.Callback.

This change also modifies the UwbManager.openRangingSession function
to only open a ranging session and not actively start ranging. In
order to start ranging, use RangingSession.start() once
RangingSession.Callback.onRangingOpened has been called.

The Ranging Session API now consists of:
  UwbManager.openRangingSession
  RangingSession.start
  RangingSession.stop
  RangingSession.reconfigure
  RangingSession.close

Bug: 173799002
Bug: 170323306
Test: atest UwbManagerTests
Change-Id: I4cc7fbc1bb1cd3b0e75aa9cc57a1ad59d39d6f50
2021-01-07 13:25:39 -08:00
Brian Stack
b279293d3b Implements UWB RangingManager and RangingSession
Bug: 170323306
Test: atest UwbManagerTests
Test: New RangingManagerTest and RangingSessionTest pass

Change-Id: I544cca2dc80c68c18994584247bb5e831bb734a2
2020-12-15 16:05:14 -08:00
Brian Stack
0070e26a5e Merge "Ensure UWB conforms to API guidelines" 2020-12-16 00:01:26 +00:00
Brian Stack
bf2f411e26 Add OWNERS to UWB
Bug: 175698723
Test: Manual
Change-Id: Ia1982ed3864bbffcce5f4f9192a3cb681085e387
2020-12-15 10:26:49 -08:00
Brian Stack
a3f2c14a7a Ensure UWB conforms to API guidelines
Adds the necessarily @NonNull and @hide annotations to the UWB classes
to be in alignment with API guidelines. Also ensures that getters and
setters for the same values have consistent names.

Bug: 170323306
Test: atest UwbManagerTests

Change-Id: I26ce17c9ef1eaa63261d83fa341451e04b164970
2020-12-04 11:46:43 -08:00
Brian Stack
93964f8f80 Implement UWB AdapterStateListener
The AdapterStateListener registers with the underlying UWB Service for
UWB Adapter state changes and notifies registered client callbacks.

Bug: 170323306
Test: atest UwbManagerTests
Change-Id: Ie8ba8208909652b98ee2df15e08433627542f28b
2020-12-03 17:45:51 -08:00
Brian Stack
8cc2de8ccd Implement UwbManager functions
Provides implementations for the basic UwbManager functions that
directly query the UWB Service.

Bug: 170323306
Test: atest UwbManagerTests
Change-Id: Ic45aa87ce90c414642e3186890f6ef08e1fd8486
2020-12-03 16:55:41 -08:00
Brian Stack
3163bf0d35 Expose UwbManager through Context.getSystemService
Bug: 170323306
Test: atest UwbManagerTests
Change-Id: I04c1263a191fcfeee5824be5d6d1944354819d02
Merged-In: I04c1263a191fcfeee5824be5d6d1944354819d02
2020-12-02 13:58:28 -08:00
Brian Stack
06ed05563c Add UWB AIDL
Adds the UWB AIDL interface used to communicate with the UWB Service

Bug: 170323306
Test: atest UwbManagerTests

Change-Id: I746a5b7c453a54cc3c8c34dc356d8165df20c739
2020-11-17 10:37:07 -08:00
Treehugger Robot
412a12977c Merge "Remove UWB RangingParams" 2020-11-12 02:37:44 +00:00
Brian Stack
82b760990c Fix typo in AngleOfArrivalSupportType values
Bug: 170323306
Test: Builds
Change-Id: Ic7721a7bba8fe40d57652df3a3a62abf39cf2852
2020-11-09 16:15:00 -08:00
Brian Stack
a2bac82063 Remove UWB RangingParams
Replace the RangingParams with a PersistableBundle in order to allow
parameter creation to be consolidated.

Bug: 170323306
Test: atest UwbManagerTests
Change-Id: I3d86c66acda367c819c2ad1ff884564ba8ca47c7
2020-11-04 12:29:53 -08:00
Brian Stack
1a702459c5 Add UWB Tests to verify Builders and Parcels
Bug: 170323306
Test: atest UwbManagerTests
Test: Runnng `atest` in frameworks/base/core/java/android/uwb runs
      UwbManagerTests

Change-Id: I4d46baf7886376cd0255fb9ae78fc12bc94f10a6
2020-11-03 09:15:05 -08:00
Brian Stack
3c99301acb Implement parcelable for UWB types
Make the UWB objects parcelable so that they may be re-used in AIDL
interfaces.

Bug: 170323306
Test: Builds

Change-Id: I8d3b81a581e66f2c777bedfd42a877548a51e875
2020-10-30 15:31:18 -07:00
Brian Stack
9ae9b395e0 Implement UWB Address
Bug: 170323306
Test: Builds

Change-Id: I36a6c9f1dd995e3a1d50f5eea3c4ef14d15a123e
2020-10-30 15:31:13 -07:00
Brian Stack
ff9bc76580 Implement RangingReport and Builder
Bug: 170323306
Test: Builds
Change-Id: I732f0e78c55cc0fbae46c26ba8f82b81bff3d49d
2020-10-20 09:35:30 -07:00
Brian Stack
f6fff8a75b Implement RangingMeasurement and Builder
Bug: 170323306
Test: Builds
Change-Id: I7a8f668c247ec9163ac9068ef549a88f05b7dc8b
2020-10-19 17:30:20 -07:00
Brian Stack
c19667c5ca Implement DistanceMeasurement and associated Builder
Bug: 170323306
Test: Builds
Change-Id: I1f439621afa2fac75ff4027fdba016b3862dc567
2020-10-19 17:30:20 -07:00
Brian Stack
9c1359a73a Implement AngleOfArrivalMeasurement and AngleMeasurement
Bug: 170323306
Test: Builds
Change-Id: I55122a7b0c34cc69d2b0be3fc230d45f24a18c87
2020-10-19 17:30:20 -07:00
Brian Stack
77fffb5192 Implement RangingParams and Builder
Implements the RangingParams.Builder class and implements
RangingParams functions.

Bug: 170323306
Test: Builds
Change-Id: I83c4349706c2e4426a2e349850c763e0689434ce
2020-10-19 17:30:20 -07:00
Brian Stack
5f566d6888 Add UWB RangingSession
Introduces the UWB RangingSession used to control ranging. Also
introduces a function to UwbManager to start ranging.

Bug: 170323306
Test: Builds
Change-Id: I014ebb203cff064b3009b246acb967d018833b06
2020-10-19 17:30:16 -07:00
Brian Stack
17e71839ef Add UWB RangingParameters
RangingParameters define how a UWB Ranging Session should be
performed.

Bug: 170323306
Test: Builds
Change-Id: Ie238e8e5748cfb050e0dc6560ca35a2effe09967
2020-10-15 14:51:36 -07:00