1. before downloading android source,you need to install the source management tools "repo".
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
2.config the git with you google accout.(optical)
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
3.use domestic proxy server to download source code.
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.0.0_r17
repo sync
ref
android source development project
AOSP(Android) 镜像使用帮助