I am experiencing the same issue here - I need to find the latest patched version of the Android 5.1.1 source code with all of relevant security patches included. The latest version of the 5.1.1 source code I found on
https://android.googlesource.com (r38) seem to be quite outdated (it is only up to date until mid 2016). Even the master version doesn't seem to have all of the security patches included (for example, to patch to this
bug doesn't seem to be included in the master version of the source code).
Any help is much appreciated.
Kind regards.