Fix system crash when unpair app
No need to restartBleScan after each unbind serviceSelector restart ble scan after update the associations Also, move unbind serviceSelector before the permission revoke since permission revoking caused app crashed. Fix: 190506983 Test: Manual test Change-Id: Icc2a19f56295be4000155a4ccd6650a30e7c9b66
This commit is contained in:
@@ -759,9 +759,19 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
|
||||
}
|
||||
return notMatch;
|
||||
}));
|
||||
restartBleScan();
|
||||
}
|
||||
|
||||
void onAssociationPreRemove(Association association) {
|
||||
if (association.isNotifyOnDeviceNearby()) {
|
||||
ServiceConnector<ICompanionDeviceService> serviceConnector =
|
||||
mDeviceListenerServiceConnectors.forUser(association.getUserId())
|
||||
.get(association.getPackageName());
|
||||
if (serviceConnector != null) {
|
||||
serviceConnector.unbind();
|
||||
}
|
||||
}
|
||||
|
||||
String deviceProfile = association.getDeviceProfile();
|
||||
if (deviceProfile != null) {
|
||||
Association otherAssociationWithDeviceProfile = find(
|
||||
@@ -793,16 +803,6 @@ 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();
|
||||
restartBleScan();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSpecialAccessPermissionForAssociatedPackage(Association association) {
|
||||
|
||||
Reference in New Issue
Block a user