Both.
And simply turning off "Include online search results" doesn't change anything. Ubuntu is still partly proprietary, which means that it can send data to somewhere without you knowing it.
There will never be an 100% safe OS. Even if Ubuntu or other mobile Linux flavor doesn't send any data anywhere, there will be an app that does.