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

Commit 28eb7543 authored by Evan Chen's avatar Evan Chen Committed by Android (Google) Code Review
Browse files

Merge "Catch the IllegalArgumentException if try to disassociate a non...

Merge "Catch the IllegalArgumentException if try to disassociate a non existent associationId." into main
parents 4adb2ce4 24f42455
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -114,7 +114,17 @@ public class DisassociationProcessor {
    public void disassociate(int id, String reason) {
        Slog.i(TAG, "Disassociating id=[" + id + "]...");

        final AssociationInfo association = mAssociationStore.getAssociationWithCallerChecks(id);
        final AssociationInfo association;
        try {
            // Attempt to get the association.
            association = mAssociationStore.getAssociationWithCallerChecks(id);
        } catch (IllegalArgumentException e) {
            // The association does not exist. This is NOT an error for disassociation.
            // It means our job is already done. Log it and return successfully.
            Slog.w(TAG, "Association id=" + id + " is already disassociated.");
            return;
        }

        final int userId = association.getUserId();
        final String packageName = association.getPackageName();
        final String deviceProfile = association.getDeviceProfile();