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

Commit d170c5c7 authored by Eugene Susla's avatar Eugene Susla
Browse files

Nullcheck device profile when re-granting on package change

Test: presubmit
Fixes: 176250389
Change-Id: I9c4e071b12335fdfc1177ab60e03002ae2704cc3
parent 65144f2e
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -867,6 +867,7 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
    }

    private void grantDeviceProfile(Association association) {
        if (association.getDeviceProfile() != null) {
            mRoleManager.addRoleHolderAsUser(
                    association.getDeviceProfile(),
                    association.getPackageName(),
@@ -882,6 +883,7 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
                        }
                    });
        }
    }

    void onDeviceDisconnected(String address) {
        mCurrentlyConnectedDevices.remove(address);