Home
last modified time | relevance | path

Searched refs:metrics (Results 1 – 23 of 23) sorted by relevance

/cts/tests/leanbackjank/src/android/cts/leanbackjank/
DCtsJankTestBase.java34 private void printIntValueWithKey(String source, Bundle metrics, String key, in printIntValueWithKey() argument
36 if (!metrics.containsKey(key)) { in printIntValueWithKey()
39 mLog.printValue(source, key, metrics.getInt(key), resultType, resultUnit); in printIntValueWithKey()
42 private void printDoubleValueWithKey(String source, Bundle metrics, String key, in printDoubleValueWithKey() argument
44 if (!metrics.containsKey(key)) { in printDoubleValueWithKey()
47 mLog.printValue(source, key, metrics.getDouble(key), resultType, resultUnit); in printDoubleValueWithKey()
51 public void afterTest(Bundle metrics) { in afterTest() argument
53 printDoubleValueWithKey(source, metrics, WindowContentFrameStatsMonitor.KEY_AVG_FPS, in afterTest()
55 printDoubleValueWithKey(source, metrics, in afterTest()
58 printIntValueWithKey(source, metrics, WindowContentFrameStatsMonitor.KEY_MAX_NUM_JANKY, in afterTest()
[all …]
/cts/tests/tests/util/src/android/util/cts/
DDisplayMetricsTest.java47 DisplayMetrics metrics = new DisplayMetrics(); in testDisplayMetricsOp() local
48 metrics.setTo(outMetrics); in testDisplayMetricsOp()
49 assertEquals(display.getHeight(), metrics.heightPixels); in testDisplayMetricsOp()
50 assertEquals(display.getWidth(), metrics.widthPixels); in testDisplayMetricsOp()
52 assertTrue((0.1 <= metrics.density) && (metrics.density <= 4)); in testDisplayMetricsOp()
53 assertTrue((0.1 <= metrics.scaledDensity) && (metrics.scaledDensity <= 4)); in testDisplayMetricsOp()
54 assertTrue(0 < metrics.xdpi); in testDisplayMetricsOp()
55 assertTrue(0 < metrics.ydpi); in testDisplayMetricsOp()
/cts/tests/tests/dpi/src/android/dpi/cts/
DConfigurationTest.java38 DisplayMetrics metrics = new DisplayMetrics(); in testScreenConfiguration() local
39 display.getMetrics(metrics); in testScreenConfiguration()
41 double xInches = (double) metrics.widthPixels / metrics.xdpi; in testScreenConfiguration()
42 double yInches = (double) metrics.heightPixels / metrics.ydpi; in testScreenConfiguration()
52 double density = 160.0d * metrics.density; in testScreenConfiguration()
69 + allowedDensities, allowedDensities.contains(metrics.densityDpi)); in testScreenConfiguration()
71 assertEquals(metrics.density, in testScreenConfiguration()
72 (float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT, in testScreenConfiguration()
DAspectRatioTest.java66 DisplayMetrics metrics = new DisplayMetrics(); in getRealAspectRatio() local
67 display.getRealMetrics(metrics); in getRealAspectRatio()
69 int max = Math.max(metrics.widthPixels, metrics.heightPixels); in getRealAspectRatio()
70 int min = Math.min(metrics.widthPixels, metrics.heightPixels); in getRealAspectRatio()
DConfigurationScreenLayoutTest.java99 DisplayMetrics metrics = new DisplayMetrics(); in reduceScreenLayout() local
100 display.getMetrics(metrics); in reduceScreenLayout()
102 int max = Math.max(metrics.widthPixels, metrics.heightPixels); in reduceScreenLayout()
103 int min = Math.min(metrics.widthPixels, metrics.heightPixels); in reduceScreenLayout()
104 int longSize = (int) (max / metrics.density); in reduceScreenLayout()
105 int shortSize = (int) (min / metrics.density); in reduceScreenLayout()
/cts/hostsidetests/theme/app/src/android/theme/app/
DDisplayInfoActivity.java40 DisplayMetrics metrics = new DisplayMetrics(); in onCreate() local
41 display.getMetrics(metrics); in onCreate()
48 text.setText(getString(R.string.display_info_text, metrics.densityDpi, in onCreate()
49 getScreenDensityBucket(metrics), width, height)); in onCreate()
52 private static String getScreenDensityBucket(DisplayMetrics metrics) { in getScreenDensityBucket() argument
53 switch (metrics.densityDpi) { in getScreenDensityBucket()
88 return "" + metrics.densityDpi; in getScreenDensityBucket()
/cts/tests/leanbackjank/app/src/android/cts/jank/leanback/
DUtils.java89 DisplayMetrics metrics = new DisplayMetrics(); in overScan() local
90 activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); in overScan()
91 int w = (int) (metrics.widthPixels * MediaDimensions.MEDIA_WIDTH); in overScan()
92 int h = (int) (metrics.heightPixels * MediaDimensions.MEDIA_HEIGHT); in overScan()
93 int marginLeft = (int) (metrics.widthPixels * MediaDimensions.MEDIA_LEFT_MARGIN); in overScan()
94 int marginTop = (int) (metrics.heightPixels * MediaDimensions.MEDIA_TOP_MARGIN); in overScan()
95 int marginRight = (int) (metrics.widthPixels * MediaDimensions.MEDIA_RIGHT_MARGIN); in overScan()
96 int marginBottom = (int) (metrics.heightPixels * MediaDimensions.MEDIA_BOTTOM_MARGIN); in overScan()
/cts/suite/cts/deviceTests/jank2/src/android/cts/jank/
DCtsJankTestBase.java34 public void afterTest(Bundle metrics) { in afterTest() argument
37 metrics.getDouble(WindowContentFrameStatsMonitor.KEY_AVG_FPS), in afterTest()
40 metrics.getDouble(WindowContentFrameStatsMonitor.KEY_AVG_LONGEST_FRAME), in afterTest()
43 metrics.getInt(WindowContentFrameStatsMonitor.KEY_MAX_NUM_JANKY), in afterTest()
46 metrics.getDouble(WindowContentFrameStatsMonitor.KEY_AVG_NUM_JANKY), in afterTest()
/cts/tests/tests/text/src/android/text/cts/
DBoringLayoutTest.java198 BoringLayout.Metrics metrics = new BoringLayout.Metrics(); in testIsBoringString() local
199 metrics.width = 100; in testIsBoringString()
200 assertNotNull(BoringLayout.isBoring("hello android", paint, metrics)); in testIsBoringString()
278 final BoringLayout.Metrics metrics = new BoringLayout.Metrics(); in createMetrics() local
280 metrics.top = top; in createMetrics()
281 metrics.ascent = ascent; in createMetrics()
282 metrics.descent = descent; in createMetrics()
283 metrics.bottom = bottom; in createMetrics()
284 metrics.width = width; in createMetrics()
285 metrics.leading = leading; in createMetrics()
[all …]
/cts/tools/tradefed-host/src/com/android/cts/tradefed/result/
DIssueReporter.java146 private void setDeviceMetrics(Map<String, String> metrics) { in setDeviceMetrics() argument
147 if (metrics.containsKey(BUILD_ID_KEY)) { in setDeviceMetrics()
148 mBuildId = metrics.get(BUILD_ID_KEY); in setDeviceMetrics()
150 if (metrics.containsKey(BUILD_TYPE_KEY)) { in setDeviceMetrics()
151 mBuildType = metrics.get(BUILD_TYPE_KEY); in setDeviceMetrics()
153 if (metrics.containsKey(PRODUCT_NAME_KEY)) { in setDeviceMetrics()
154 mProductName = metrics.get(PRODUCT_NAME_KEY); in setDeviceMetrics()
DDeviceInfoResult.java136 private String getMetric(Map<String, String> metrics, String metricName ) { in getMetric() argument
137 String value = metrics.remove(metricName); in getMetric()
345 public void populateMetrics(Map<String, String> metrics) { in populateMetrics() argument
348 mMetrics.putAll(metrics); in populateMetrics()
352 metrics); in populateMetrics()
367 private void combineMetrics(Map<String, String> metrics, String... keysToCombine) { in combineMetrics() argument
370 String valueToAdd = metrics.remove(combineKey); in combineMetrics()
389 private void checkMetrics(Map<String, String> metrics, String... keysToCheck) { in checkMetrics() argument
392 for (Map.Entry<String, String> metricEntry : metrics.entrySet()) { in checkMetrics()
DTestPackageResult.java234 public void populateMetrics(Map<String, String> metrics) { in populateMetrics() argument
235 String name = metrics.get(CtsTest.PACKAGE_NAME_METRIC); in populateMetrics()
239 String abi = metrics.get(CtsTest.PACKAGE_ABI_METRIC); in populateMetrics()
243 String digest = metrics.get(CtsTest.PACKAGE_DIGEST_METRIC); in populateMetrics()
247 mMetrics.putAll(metrics); in populateMetrics()
/cts/tools/device-setup/TestDeviceSetup/src/android/tests/getinfo/
DDeviceInfoInstrument.java86 DisplayMetrics metrics = new DisplayMetrics(); in onStart() local
90 d.getRealMetrics(metrics); in onStart()
91 addResult(RESOLUTION, String.format("%sx%s", metrics.widthPixels, metrics.heightPixels)); in onStart()
92 addResult(SCREEN_DENSITY, metrics.density); in onStart()
93 addResult(SCREEN_X_DENSITY, metrics.xdpi); in onStart()
94 addResult(SCREEN_Y_DENSITY, metrics.ydpi); in onStart()
96 String screenDensityBucket = getScreenDensityBucket(metrics); in onStart()
221 private String getScreenDensityBucket(DisplayMetrics metrics) { in getScreenDensityBucket() argument
222 switch (metrics.densityDpi) { in getScreenDensityBucket()
239 return "" + metrics.densityDpi; in getScreenDensityBucket()
/cts/tests/tests/app/src/android/app/cts/
DActivityManagerMemoryClassTest.java132 DisplayMetrics metrics = new DisplayMetrics(); in getScreenDensity() local
133 display.getMetrics(metrics); in getScreenDensity()
134 return metrics.densityDpi; in getScreenDensity()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/
DTestResultsBackupHelper.java124 byte[] metrics = new byte[metricsDataSize]; in restoreEntity()
125 dataInput.readFully(metrics); in restoreEntity()
126 values[i].put(TestResultsProvider.COLUMN_TEST_METRICS, metrics); in restoreEntity()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/projection/
DProjectionActivity.java65 … DisplayMetrics metrics = ProjectionActivity.this.getResources().getDisplayMetrics();
67 … mService.startRendering(mSurface, mWidth, mHeight, metrics.densityDpi, mType.ordinal());
/cts/tests/tests/text/src/android/text/method/cts/
DTouchTest.java111 DisplayMetrics metrics = mActivity.getResources().getDisplayMetrics(); in testOnTouchEvent() local
112 int screenWidth = metrics.widthPixels; in testOnTouchEvent()
/cts/tests/tests/graphics/src/android/graphics/cts/
DBitmapTest.java969 DisplayMetrics metrics = new DisplayMetrics(); in testGetScaledHeight2() local
970 metrics = getContext().getResources().getDisplayMetrics(); in testGetScaledHeight2()
971 int scaledHeight = scaleFromDensity(ret.getHeight(), ret.getDensity(), metrics.densityDpi); in testGetScaledHeight2()
972 assertEquals(scaledHeight, ret.getScaledHeight(metrics)); in testGetScaledHeight2()
996 DisplayMetrics metrics = new DisplayMetrics(); in testGetScaledWidth2() local
997 metrics = getContext().getResources().getDisplayMetrics(); in testGetScaledWidth2()
998 int scaledWidth = scaleFromDensity(ret.getWidth(), ret.getDensity(), metrics.densityDpi); in testGetScaledWidth2()
999 assertEquals(scaledWidth, ret.getScaledWidth(metrics)); in testGetScaledWidth2()
/cts/tests/tests/content/src/android/content/res/cts/
DResourcesTest.java121 final DisplayMetrics metrics = new DisplayMetrics(); in getResources() local
124 d.getMetrics(metrics); in getResources()
131 metrics.widthPixels = width; in getResources()
132 metrics.heightPixels = height; in getResources()
133 return new Resources(assmgr, metrics, config); in getResources()
/cts/tests/tests/webkit/src/android/webkit/cts/
DWebViewTest.java1408 DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
1409 int dimension = Math.max(metrics.widthPixels, metrics.heightPixels);
1435 DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
1436 int dimension = Math.max(metrics.widthPixels, metrics.heightPixels);
1574 DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
1575 int dimension = 2 * Math.max(metrics.widthPixels, metrics.heightPixels);
1691 DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
1692 final int dimension = 10 * Math.max(metrics.widthPixels, metrics.heightPixels);
2108 DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
2109 final int dimension = 2 * Math.max(metrics.widthPixels, metrics.heightPixels);
/cts/tools/tradefed-host/src/com/android/cts/tradefed/testtype/
DCtsTest.java1166 Map<String, String> metrics = new HashMap<>(3); in forwardPackageDetails() local
1167 metrics.put(PACKAGE_NAME_METRIC, def.getName()); in forwardPackageDetails()
1168 metrics.put(PACKAGE_ABI_METRIC, def.getAbi().getName()); in forwardPackageDetails()
1169 metrics.put(PACKAGE_DIGEST_METRIC, def.getDigest()); in forwardPackageDetails()
1171 listener.testRunEnded(0, metrics); in forwardPackageDetails()
/cts/tests/tests/view/src/android/view/cts/
DViewGroupTest.java526 DisplayMetrics metrics = new DisplayMetrics(); in testDispatchTouchEvent() local
529 d.getMetrics(metrics); in testDispatchTouchEvent()
530 int screenWidth = metrics.widthPixels; in testDispatchTouchEvent()
531 int screenHeight = metrics.heightPixels; in testDispatchTouchEvent()
/cts/tests/tests/widget/src/android/widget/cts/
DTextViewTest.java398 DisplayMetrics metrics = mActivity.getResources().getDisplayMetrics(); in testAccessTextSize() local
402 assertEquals(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, 20f, metrics), in testAccessTextSize()
406 assertEquals(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20f, metrics), in testAccessTextSize()
410 assertEquals(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 20f, metrics), in testAccessTextSize()
415 assertEquals(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 20f, metrics), in testAccessTextSize()
419 assertEquals(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 200f, metrics), in testAccessTextSize()