Address CDM API feedback

Fixes: 181175212
Test: atest CompanionDeviceManagerTest
Change-Id: I33c5b2ddaedd09a9f4fae29b247f42e2351b1a0f
This commit is contained in:
Eugene Susla
2021-02-24 17:38:44 -08:00
parent f6ed5fc57c
commit 41d85c3ea1
3 changed files with 11 additions and 2 deletions

View File

@@ -9734,7 +9734,7 @@ package android.companion {
public interface DeviceFilter<D extends android.os.Parcelable> extends android.os.Parcelable {
}
public class DeviceNotAssociatedException extends java.lang.Exception {
public class DeviceNotAssociatedException extends java.lang.RuntimeException {
}
public final class WifiDeviceFilter implements android.companion.DeviceFilter<android.net.wifi.ScanResult> {

View File

@@ -23,7 +23,7 @@ import android.annotation.Nullable;
* An exception for a case when a given device was not
* {@link CompanionDeviceManager#associate associated} to the calling app.
*/
public class DeviceNotAssociatedException extends Exception {
public class DeviceNotAssociatedException extends RuntimeException {
/** @hide */
public DeviceNotAssociatedException(@Nullable String deviceName) {
super("Device not associated with the current app: " + deviceName);

View File

@@ -747,6 +747,15 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
}
}
}
if (association.isNotifyOnDeviceNearby()) {
ServiceConnector<ICompanionDeviceService> serviceConnector =
mDeviceListenerServiceConnectors.forUser(association.getUserId())
.get(association.getPackageName());
if (serviceConnector != null) {
serviceConnector.unbind();
}
}
}
private void updateSpecialAccessPermissionForAssociatedPackage(Association association) {