Check location permission for ConnDiags last.
This CL updates ConnectivityService to check location permissions for ConnectivityDiagnostics callbacks last in the permission check process. This minimizes misattribution of location access for networks that an app is not administering. This CL also updates ConnectivityDiagnosticsManager documentation to clearly state that location permissions are required in order to receive callbacks. Bug: 187310575 Test: atest ConnectivityDiagnosticsManagerTest Test: atest ConnectivityServiceTest Change-Id: I2dbeddac6273e2392ccaeae51a1c7776d6d3da75
This commit is contained in:
@@ -713,7 +713,9 @@ public class ConnectivityDiagnosticsManager {
|
||||
* <p>Callbacks registered by apps not meeting the above criteria will not be invoked.
|
||||
*
|
||||
* <p>If a registering app loses its relevant permissions, any callbacks it registered will
|
||||
* silently stop receiving callbacks.
|
||||
* silently stop receiving callbacks. Note that registering apps must also have location
|
||||
* permissions to receive callbacks as some Networks may be location-bound (such as WiFi
|
||||
* networks).
|
||||
*
|
||||
* <p>Each register() call <b>MUST</b> use a ConnectivityDiagnosticsCallback instance that is
|
||||
* not currently registered. If a ConnectivityDiagnosticsCallback instance is registered with
|
||||
|
||||
Reference in New Issue
Block a user