Source:
java.lang.String getContents ( ) throws java.io.IOException , java.lang.IllegalArgumentException , java.lang.IllegalStateException { java.io.ByteArrayOutputStream outputStream = new java.io.ByteArrayOutputStream ( ) ; org.xmlpull.v1.XmlSerializer xml = android.util.Xml.newSerializer ( ) ; xml.setOutput ( outputStream , "utf-8" ) ; xml.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; xml.startDocument ( "utf-8" , true ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_REPORT_TAG ) ; xml.attribute ( null , "report-version" , java.lang.Integer.toString ( com.android.cts.verifier.TestResultsReport.REPORT_VERSION ) ) ; xml.attribute ( null , "creation-time" , com.android.cts.verifier.TestResultsReport.DATE_FORMAT.format ( new java.util.Date ( ) ) ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.VERIFIER_INFO_TAG ) ; xml.attribute ( null , "version-name" , com.android.cts.verifier.Version.getVersionName ( mContext ) ) ; xml.attribute ( null , "version-code" , java.lang.Integer.toString ( com.android.cts.verifier.Version.getVersionCode ( mContext ) ) ) ; xml.attribute ( null , "build" , com.android.cts.verifier.Version.getBuildNumber ( mContext ) ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.VERIFIER_INFO_TAG ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.DEVICE_INFO_TAG ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.BUILD_INFO_TAG ) ; xml.attribute ( null , "board" , Build.BOARD ) ; xml.attribute ( null , "brand" , Build.BRAND ) ; xml.attribute ( null , "device" , Build.DEVICE ) ; xml.attribute ( null , "display" , Build.DISPLAY ) ; xml.attribute ( null , "fingerprint" , Build.FINGERPRINT ) ; xml.attribute ( null , "id" , Build.ID ) ; xml.attribute ( null , "model" , Build.MODEL ) ; xml.attribute ( null , "product" , Build.PRODUCT ) ; xml.attribute ( null , "release" , Build.VERSION.RELEASE ) ; xml.attribute ( null , "sdk" , java.lang.Integer.toString ( Build.VERSION.SDK_INT ) ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.BUILD_INFO_TAG ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.DEVICE_INFO_TAG ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_TAG ) ; int count = mAdapter.getCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { com.android.cts.verifier.TestListAdapter.TestListItem item = mAdapter.getItem ( i ) ; if ( item.isTest ( ) ) { xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_TAG ) ; xml.attribute ( null , "title" , item.title ) ; xml.attribute ( null , "class-name" , item.testName ) ; xml.attribute ( null , "result" , getTestResultString ( mAdapter.getTestResult ( i ) ) ) ; java.lang.String details = mAdapter.getTestDetails ( i ) ; if ( ! ( android.text.TextUtils.isEmpty ( details ) ) ) { xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_DETAILS_TAG ) ; xml.text ( details ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_DETAILS_TAG ) ; } com.android.compatibility.common.util.ReportLog reportLog = mAdapter.getReportLog ( i ) ; if ( reportLog != null ) { com.android.compatibility.common.util.MetricsXmlSerializer metricsXmlSerializer = new com.android.compatibility.common.util.MetricsXmlSerializer ( xml ) ; metricsXmlSerializer.serialize ( reportLog ) ; } xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_TAG ) ; } } xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_TAG ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_REPORT_TAG ) ; xml.endDocument ( ) ; return outputStream.toString ( "utf-8" ) ; }

Target:
java.lang.String getContents ( ) throws java.io.IOException , java.lang.IllegalArgumentException , java.lang.IllegalStateException { java.io.ByteArrayOutputStream outputStream = new java.io.ByteArrayOutputStream ( ) ; org.xmlpull.v1.XmlSerializer xml = android.util.Xml.newSerializer ( ) ; xml.setOutput ( outputStream , "utf-8" ) ; xml.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; xml.startDocument ( "utf-8" , true ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_REPORT_TAG ) ; xml.attribute ( null , "report-version" , java.lang.Integer.toString ( com.android.cts.verifier.TestResultsReport.REPORT_VERSION ) ) ; xml.attribute ( null , "creation-time" , com.android.cts.verifier.TestResultsReport.DATE_FORMAT.format ( new java.util.Date ( ) ) ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.VERIFIER_INFO_TAG ) ; xml.attribute ( null , "version-name" , com.android.cts.verifier.Version.getVersionName ( mContext ) ) ; xml.attribute ( null , "version-code" , java.lang.Integer.toString ( com.android.cts.verifier.Version.getVersionCode ( mContext ) ) ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.VERIFIER_INFO_TAG ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.DEVICE_INFO_TAG ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.BUILD_INFO_TAG ) ; xml.attribute ( null , "board" , Build.BOARD ) ; xml.attribute ( null , "brand" , Build.BRAND ) ; xml.attribute ( null , "device" , Build.DEVICE ) ; xml.attribute ( null , "display" , Build.DISPLAY ) ; xml.attribute ( null , "fingerprint" , Build.FINGERPRINT ) ; xml.attribute ( null , "id" , Build.ID ) ; xml.attribute ( null , "model" , Build.MODEL ) ; xml.attribute ( null , "product" , Build.PRODUCT ) ; xml.attribute ( null , "release" , Build.VERSION.RELEASE ) ; xml.attribute ( null , "sdk" , java.lang.Integer.toString ( Build.VERSION.SDK_INT ) ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.BUILD_INFO_TAG ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.DEVICE_INFO_TAG ) ; xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_TAG ) ; int count = mAdapter.getCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { com.android.cts.verifier.TestListAdapter.TestListItem item = mAdapter.getItem ( i ) ; if ( item.isTest ( ) ) { xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_TAG ) ; xml.attribute ( null , "title" , item.title ) ; xml.attribute ( null , "class-name" , item.testName ) ; xml.attribute ( null , "result" , getTestResultString ( mAdapter.getTestResult ( i ) ) ) ; java.lang.String details = mAdapter.getTestDetails ( i ) ; if ( ! ( android.text.TextUtils.isEmpty ( details ) ) ) { xml.startTag ( null , com.android.cts.verifier.TestResultsReport.TEST_DETAILS_TAG ) ; xml.text ( details ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_DETAILS_TAG ) ; } com.android.compatibility.common.util.ReportLog reportLog = mAdapter.getReportLog ( i ) ; if ( reportLog != null ) { com.android.compatibility.common.util.MetricsXmlSerializer metricsXmlSerializer = new com.android.compatibility.common.util.MetricsXmlSerializer ( xml ) ; metricsXmlSerializer.serialize ( reportLog ) ; } xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_TAG ) ; } } xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_TAG ) ; xml.endTag ( null , com.android.cts.verifier.TestResultsReport.TEST_RESULTS_REPORT_TAG ) ; xml.endDocument ( ) ; return outputStream.toString ( "utf-8" ) ; }