VisualBench: Make the Android SDL app start without cmdline arguments
authorkkinnunen <kkinnunen@nvidia.com>
Thu, 14 Jan 2016 19:54:13 +0000 (11:54 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 14 Jan 2016 19:54:13 +0000 (11:54 -0800)
Make the Android SDL VisualBench start even if it is started without
command-line arguments.

Also makes it start when started by pressing the icon.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1573913008

Review URL: https://codereview.chromium.org/1573913008

platform_tools/android/apps/visualbenchsdl/src/main/java/com/skia/VisualBenchActivity.java

index f54b7d9..894a9b3 100644 (file)
@@ -13,10 +13,10 @@ import android.content.Intent;
 
 public class VisualBenchActivity extends SDLActivity {
   protected String[] getArguments() {
-    // intent get intent extras if triggered from the command line
-    Intent intent = this.getIntent();
-    String flags = intent.getStringExtra("cmdLineFlags");
-    
-    return flags.split("\\s+");
+    String flags = this.getIntent().getStringExtra("cmdLineFlags");
+    if (flags != null && !flags.isEmpty()) {
+       return flags.split("\\s+");
+    }
+    return new String[0];
   }
 }