VisualBench: Make the Android SDL app start without cmdline arguments

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
This commit is contained in:
kkinnunen 2016-01-14 11:54:13 -08:00 committed by Commit bot
parent f074e70749
commit 721772ec49

View File

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