Why is not every Android Modification Open Source? Ok, this might sound a bit weird, but I am really wondering why not every manufacturer like Samsung or Oneplus has to make it ROM public under the GPL license? At least the kernel would have to be under the GPL 2 license because it is a Linux modification and the license includes that anybody has to make the changes public to anyone. Also the Apache license under which android is published should make it legal to edit and redistribute code, but you also have to give the source and state which changes are from you. So, my question is: Why is not every Android System sourcecode public to anybody?
Generally, most of the OEMs share the kernel source but there are some cases when they don't (XIOMI). The reason for not sharing it is present in the xda link.



  I want to specify one last thing for those readers who are not familiar with the distinction: GPL is a license and not a contract. Some jurisdictions see key distinctions between these two, as contracts are enforceable by contract law and licenses fall under copyright. So breaking a license’s term is still judicable. The distributors who don’t accept GPL’s terms and conditions can’t copy and distribute GPL software under law.


So OEM who are not in American market does this more often.


Every part of the code cannot be kept publically available. Because it contains many patents bounded by the non-disclosure agreement e.g. Camera Software. Some developer friendly companies publish the binary blob for such parts so that it can be used in any custom rom for the device e.g One Plus provide dash charge firmware and probably camera too as a blob.