Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fe2de95 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Follow-up to Switch to the latest version of Caliper

Translate ResourcesBenchmark to work with the new version of Caliper.

Bug: 24848946
Change-Id: If4a4e5da5cd14da83d093a418147ad6d12c170cc
parent e0b2f2e2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -20,11 +20,13 @@ import android.util.AttributeSet;
import android.util.Xml;

import com.android.internal.R;
import com.google.caliper.SimpleBenchmark;

import org.xmlpull.v1.XmlPullParser;

public class ResourcesBenchmark extends SimpleBenchmark {
import com.google.caliper.AfterExperiment;
import com.google.caliper.BeforeExperiment;

public class ResourcesBenchmark {

    private AssetManager mAsset;
    private Resources mRes;
@@ -34,7 +36,7 @@ public class ResourcesBenchmark extends SimpleBenchmark {
    private int mIntegerId;
    private int mLayoutId;

    @Override
    @BeforeExperiment
    protected void setUp() {
        mAsset = new AssetManager();
        mAsset.addAssetPath("/system/framework/framework-res.apk");
@@ -46,7 +48,7 @@ public class ResourcesBenchmark extends SimpleBenchmark {
        mLayoutId = mRes.getIdentifier("two_line_list_item", "layout", "android");
    }

    @Override
    @AfterExperiment
    protected void tearDown() {
        mAsset.close();
    }