Add Android viewer to GN

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3761

Change-Id: If971e275ed377cd733d01f62622d408479632465
Reviewed-on: https://skia-review.googlesource.com/3761
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index a3b7857..21ea7aa 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -928,8 +928,7 @@
     if (!is_android) {
       sources += [ "src/views/SkWindow.cpp" ]
     }
-    if (is_android) {
-    } else if (is_linux) {
+    if (is_linux) {
       public_include_dirs += [ "src/views/unix" ]
       sources += [
         "src/views/unix/SkOSWindow_Unix.cpp",
@@ -1197,7 +1196,15 @@
       ]
       libs = []
 
-      if (is_linux) {
+      if (is_android) {
+        sources += [
+          "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
+          "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
+          "tools/viewer/sk_app/android/Window_android.cpp",
+          "tools/viewer/sk_app/android/main_android.cpp",
+          "tools/viewer/sk_app/android/surface_glue_android.cpp",
+        ]
+      } else if (is_linux) {
         sources += [
           "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
           "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
@@ -1222,7 +1229,11 @@
 
       if (skia_use_vulkan) {
         sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
-        if (is_linux) {
+        if (is_android) {
+          sources +=
+              [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
+          libs += [ "android" ]
+        } else if (is_linux) {
           sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
           libs += [ "X11-xcb" ]
         } else if (is_win) {
@@ -1241,7 +1252,9 @@
         ":views",
         "//third_party/jsoncpp",
       ]
-      if (is_mac) {
+      if (is_android) {
+        deps += [ "//third_party/native_app_glue" ]
+      } else if (is_mac) {
         deps += [ "//third_party/libsdl" ]
       }
       testonly = true