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

Commit c373adb8 authored by Andreas Gampe's avatar Andreas Gampe Committed by Android (Google) Code Review
Browse files

Merge "Follow-up to Switch to the latest version of Caliper"

parents e004a4af 0fe2de95
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -20,11 +20,13 @@ import android.util.AttributeSet;
import android.util.Xml;
import android.util.Xml;


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


import org.xmlpull.v1.XmlPullParser;
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 AssetManager mAsset;
    private Resources mRes;
    private Resources mRes;
@@ -34,7 +36,7 @@ public class ResourcesBenchmark extends SimpleBenchmark {
    private int mIntegerId;
    private int mIntegerId;
    private int mLayoutId;
    private int mLayoutId;


    @Override
    @BeforeExperiment
    protected void setUp() {
    protected void setUp() {
        mAsset = new AssetManager();
        mAsset = new AssetManager();
        mAsset.addAssetPath("/system/framework/framework-res.apk");
        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");
        mLayoutId = mRes.getIdentifier("two_line_list_item", "layout", "android");
    }
    }


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