Stop using the __ANDROID_API_x__ constants.

Historically we've made a few mistakes where they haven't matched the
right number. And most non-Googlers are much more familiar with the
numbers, so it seems to make sense to rely more on them. Especially in
header files, which we actually expect real people to have to read from
time to time.

Test: treehugger
Change-Id: I0d4a97454ee108de1d32f21df285315c5488d886
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 3534287..da2d03c 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -264,12 +264,12 @@
 
   if (header_.e_shentsize != sizeof(ElfW(Shdr))) {
     // Fail if app is targeting Android O or above
-    if (get_application_target_sdk_version() >= __ANDROID_API_O__) {
+    if (get_application_target_sdk_version() >= 26) {
       DL_ERR_AND_LOG("\"%s\" has unsupported e_shentsize: 0x%x (expected 0x%zx)",
                      name_.c_str(), header_.e_shentsize, sizeof(ElfW(Shdr)));
       return false;
     }
-    DL_WARN_documented_change(__ANDROID_API_O__,
+    DL_WARN_documented_change(26,
                               "invalid-elf-header_section-headers-enforced-for-api-level-26",
                               "\"%s\" has unsupported e_shentsize 0x%x (expected 0x%zx)",
                               name_.c_str(), header_.e_shentsize, sizeof(ElfW(Shdr)));
@@ -278,12 +278,12 @@
 
   if (header_.e_shstrndx == 0) {
     // Fail if app is targeting Android O or above
-    if (get_application_target_sdk_version() >= __ANDROID_API_O__) {
+    if (get_application_target_sdk_version() >= 26) {
       DL_ERR_AND_LOG("\"%s\" has invalid e_shstrndx", name_.c_str());
       return false;
     }
 
-    DL_WARN_documented_change(__ANDROID_API_O__,
+    DL_WARN_documented_change(26,
                               "invalid-elf-header_section-headers-enforced-for-api-level-26",
                               "\"%s\" has invalid e_shstrndx", name_.c_str());
     add_dlwarning(name_.c_str(), "has invalid ELF header");
@@ -392,7 +392,7 @@
   }
 
   if (pt_dynamic_offset != dynamic_shdr->sh_offset) {
-    if (get_application_target_sdk_version() >= __ANDROID_API_O__) {
+    if (get_application_target_sdk_version() >= 26) {
       DL_ERR_AND_LOG("\"%s\" .dynamic section has invalid offset: 0x%zx, "
                      "expected to match PT_DYNAMIC offset: 0x%zx",
                      name_.c_str(),
@@ -400,7 +400,7 @@
                      pt_dynamic_offset);
       return false;
     }
-    DL_WARN_documented_change(__ANDROID_API_O__,
+    DL_WARN_documented_change(26,
                               "invalid-elf-header_section-headers-enforced-for-api-level-26",
                               "\"%s\" .dynamic section has invalid offset: 0x%zx "
                               "(expected to match PT_DYNAMIC offset 0x%zx)",
@@ -411,7 +411,7 @@
   }
 
   if (pt_dynamic_filesz != dynamic_shdr->sh_size) {
-    if (get_application_target_sdk_version() >= __ANDROID_API_O__) {
+    if (get_application_target_sdk_version() >= 26) {
       DL_ERR_AND_LOG("\"%s\" .dynamic section has invalid size: 0x%zx, "
                      "expected to match PT_DYNAMIC filesz: 0x%zx",
                      name_.c_str(),
@@ -419,7 +419,7 @@
                      pt_dynamic_filesz);
       return false;
     }
-    DL_WARN_documented_change(__ANDROID_API_O__,
+    DL_WARN_documented_change(26,
                               "invalid-elf-header_section-headers-enforced-for-api-level-26",
                               "\"%s\" .dynamic section has invalid size: 0x%zx "
                               "(expected to match PT_DYNAMIC filesz 0x%zx)",
@@ -635,11 +635,11 @@
       int prot = PFLAGS_TO_PROT(phdr->p_flags);
       if ((prot & (PROT_EXEC | PROT_WRITE)) == (PROT_EXEC | PROT_WRITE)) {
         // W + E PT_LOAD segments are not allowed in O.
-        if (get_application_target_sdk_version() >= __ANDROID_API_O__) {
+        if (get_application_target_sdk_version() >= 26) {
           DL_ERR_AND_LOG("\"%s\": W+E load segments are not allowed", name_.c_str());
           return false;
         }
-        DL_WARN_documented_change(__ANDROID_API_O__,
+        DL_WARN_documented_change(26,
                                   "writable-and-executable-segments-enforced-for-api-level-26",
                                   "\"%s\" has load segments that are both writable and executable",
                                   name_.c_str());