Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e11565a authored by Evan Chen's avatar Evan Chen Committed by Automerger Merge Worker
Browse files

Merge "Fix system crash when unpair app" into sc-dev am: 891f3034 am: 03edd604

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14903799

Change-Id: I0435b051086ae59a82cd03b79c0a1685974afa0b
parents 9792a7c0 03edd604
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -789,9 +789,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(
@@ -823,16 +833,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) {