Merge "MediaMetrics: Cleanup the formatting of session ID" into sc-dev

This commit is contained in:
Shubang Lu
2021-06-13 08:09:30 +00:00
committed by Android (Google) Code Review

View File

@@ -98,7 +98,8 @@ public final class MediaMetricsManagerService extends SystemService {
private String getSessionIdInternal(int userId) {
byte[] byteId = new byte[16]; // 128 bits
mSecureRandom.nextBytes(byteId);
String id = Base64.encodeToString(byteId, Base64.DEFAULT);
String id = Base64.encodeToString(
byteId, Base64.NO_PADDING | Base64.NO_WRAP | Base64.URL_SAFE);
return id;
}