ANDROID: Append BUILD_NUMBER to KERNELRELEASE

If building on Android infrastructure, the BUILD_NUMBER variable will be
set to indicate a unique build ID for this build. Add it to the kernel
version, which is used by UTS_RELEASE and various other build steps.

Bug: 137521202
Bug: 159842160
Bug: 194209519
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I44ab12ad16439c7e518b878af03153822447a4b2
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index cacf8b4..bfb4e15 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -163,4 +163,9 @@
 	res="$res${scm:++}"
 fi
 
+# finally, add the abXXX number if BUILD_NUMBER is set
+if test -n "${BUILD_NUMBER}"; then
+	res="$res-ab${BUILD_NUMBER}"
+fi
+
 echo "$res"