Add option to ignore SIGINT when running DM on Android.

Bug: skia:6856
Change-Id: Iaaad2c22988cf8058304b7396c7d24eacd2f3edb
Reviewed-on: https://skia-review.googlesource.com/24745
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
diff --git a/dm/DM.cpp b/dm/DM.cpp
index ef048a4..06ad765 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -89,6 +89,8 @@
 DEFINE_pathrenderer_flag;
 #endif
 
+DEFINE_bool(ignoreSigInt, false, "ignore SIGINT signals during test execution");
+
 using namespace DM;
 using sk_gpu_test::GrContextFactory;
 using sk_gpu_test::GLTestContext;
@@ -278,6 +280,10 @@
         for (int sig : kSignals) {
             previous_handler[sig] = signal(sig, crash_handler);
         }
+
+        if (FLAGS_ignoreSigInt) {
+            signal(SIGINT, SIG_IGN);
+        }
     }
 #endif