4import android.content.res.AssetManager;
6import android.support.v7.app.AppCompatActivity;
7import android.support.v7.widget.Toolbar;
10import java.io.IOException;
12public class SkQPActivity extends AppCompatActivity implements Runnable {
14 protected void onCreate(Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState);
16 setContentView(
R.layout.activity_skqp);
17 Toolbar toolbar = (Toolbar) findViewById(
R.id.toolbar);
18 setSupportActionBar(toolbar);
30 Context context = getApplicationContext();
31 String outputDirPath =
"/sdcard/Android/data/" + context.getPackageName();
35 File outputDir =
new File(outputDirPath);
38 }
catch (IOException
e) {
43 AssetManager assetManager = context.getResources().getAssets();
44 impl.
nInit(assetManager, outputDirPath);
46 for (
int unitTest = 0; unitTest < impl.
mUnitTests.length; unitTest++) {
64 private static void ensureEmptyDirectory(File
f)
throws IOException {
69 throw new IOException(
"Unable to create directory:" +
f.getAbsolutePath());
73 private static void delete(File
f)
throws IOException {
74 if (
f.isDirectory()) {
75 for (File
s :
f.listFiles()) {
76 SkQPActivity.delete(
s);
80 throw new IOException(
"Unable to delete:" +
f.getAbsolutePath());
void onCreate(Bundle savedInstanceState)
native void nMakeReport()
static final String LOG_PREFIX
native String[] nExecuteUnitTest(int test)
native void nInit(AssetManager assetManager, String dataDir)
const uint8_t uint32_t uint32_t GError ** error
void Log(const char *format,...) SK_PRINTF_LIKE(1