chore(#Magnification): adjust field scale in metric MagnificationUsageReported

In metric MagnificationUsageReported, to fix privacy concern and keep readability, we make 10% as bucket size for field magnification scale.

Bug: 284253529
Test: m statsd_testdrive & statsd_testdrive 345
Change-Id: I0cd6385c9c82506b50a27eeb7bef769f968c6374
This commit is contained in:
Roy Chou
2023-05-25 07:32:41 +00:00
parent f69664925d
commit c6a963e97d

View File

@@ -258,6 +258,10 @@ public final class AccessibilityStatsLogUtils {
}
private static int convertToLoggingMagnificationScale(float scale) {
return (int) (scale * 100);
// per b/269366674, we make every 10% a bucket for both privacy and readability concern.
// For example
// 1. both 2.30f(230%) and 2.36f(236%) would return 230 as bucket id.
// 2. bucket id 370 means scale range in [370%, 379%]
return ((int) (scale * 10)) * 10;
}
}