Merge "Address CDM API feedback" into sc-dev

This commit is contained in:
Eugene Susla
2021-02-25 18:28:27 +00:00
committed by Android (Google) Code Review
3 changed files with 11 additions and 2 deletions

View File

@@ -9741,7 +9741,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

@@ -742,6 +742,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) {