Merge "Avoid a NullPointerException in getDevicesMatchingConnectionStates"