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

Commit 545ac3a0 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 970

* changes:
  fix the bug of testStartupTime in MediaPlayerPerformance test throws exception for an existing table
parents 2d23cbfc 568d91bd
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ import android.media.MediaMetadataRetriever;
 */
public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<MediaFrameworkTest> {

    private String TAG = "MediaFrameworkPerformance";
    private String TAG = "MediaPlayerPerformance";

    private SQLiteDatabase mDB;
    private SurfaceHolder mSurfaceHolder = null;
@@ -80,9 +80,11 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi

    public void createDB() {
        mDB = SQLiteDatabase.openOrCreateDatabase("/sdcard/perf.db", null);
        mDB.execSQL("CREATE TABLE perfdata (_id INTEGER PRIMARY KEY," + 
        mDB.execSQL("CREATE TABLE IF NOT EXISTS perfdata (_id INTEGER PRIMARY KEY," + 
                "file TEXT," + "setdatatime LONG," + "preparetime LONG," +
                "playtime LONG" + ");");
        //clean the table before adding new data
        mDB.execSQL("DELETE FROM perfdata");
    }

    public void audioPlaybackStartupTime(String[] testFile) {
@@ -141,6 +143,10 @@ public class MediaPlayerPerformance extends ActivityInstrumentationTestCase<Medi
        audioPlaybackStartupTime(MediaNames.MP3FILES);
        audioPlaybackStartupTime(MediaNames.AACFILES);

        //close the database after all transactions
        if (mDB.isOpen()) {
            mDB.close();
        }
    }

    public void wmametadatautility(String[] testFile) {