MediaMetricsManagerService: Unify logSessionId representation

Use 96 bit integer / 16 char BaseURL representation.

Test: atest AudioTrackTest#testSetLogSessionId
Test: atest AudioRecordTest#testSetLogSessionId
Test: atest MediaRecorderTest#testSetGetLogSessionId
Test: atest MediaDrmTest#testPlaybackComponent
Bug: 193164585
Change-Id: I99a070f4ca4efb03416dff770c2a3a90d7ad2c58
This commit is contained in:
Andy Hung
2021-07-08 09:58:26 -07:00
parent 576c548b3c
commit 47233309c0

View File

@@ -195,7 +195,7 @@ public final class MediaMetricsManagerService extends SystemService {
}
private String getSessionIdInternal(int userId) {
byte[] byteId = new byte[16]; // 128 bits
byte[] byteId = new byte[12]; // 96 bits (128 bits when expanded to Base64 string)
mSecureRandom.nextBytes(byteId);
String id = Base64.encodeToString(
byteId, Base64.NO_PADDING | Base64.NO_WRAP | Base64.URL_SAFE);