Google is not charity, it's always good to remember that.
Google is not giving away the source code of Android for philanthropic reasons, it's just part of the business model, i.e. the process of money making to pay the employees and the shareholders.
Oh and Apple is definitely not putting arbitrary restrictions to anything, all the restrictions have a reason - that you might or might not agree to but definitely not random. In case you want to bypass Apple and run a code on your iPhone, you can do it by compiling it and installing it personally.
I think EU will investigate the companies that have large enough marketshare that they can abuse their position.