Merge "123197896: The last-released API file is the wrong one"
am: 2a9aff1db5

Change-Id: Icf6a888fcd196b53b350c1a4380daf404fc7c373
diff --git a/Android.bp b/Android.bp
index 607e8c1..aa82d70 100644
--- a/Android.bp
+++ b/Android.bp
@@ -32,7 +32,7 @@
     srcs: [
         "*/public/api/android.txt",
     ],
-    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-api.txt",
+    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -t/ -k3 -n | tail -1) $(genDir)/last-released-api.txt",
     out: [
         "last-released-api.txt",
     ],
@@ -43,7 +43,7 @@
     srcs: [
         "*/system/api/android.txt",
     ],
-    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -1) $(genDir)/last-released-api.txt",
+    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -t/ -k3 -n | tail -1) $(genDir)/last-released-api.txt",
     out: [
         "last-released-api.txt",
     ],
@@ -54,7 +54,7 @@
     srcs: [
         "*/public/api/android.txt",
     ],
-    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -n | tail -2 | head -1) $(genDir)/last-released-api.txt",
+    cmd: "cp -f $$(echo $(in) | tr \" \" \"\\n\" | sort -t/ -k3 -n | tail -2 | head -1) $(genDir)/last-released-api.txt",
     out: [
         "last-released-api.txt",
     ],