Merge "Switch to HexEncoding from ByteStringUtils" into qt-dev-plus-aosp
am: 43b25f1332
Change-Id: I5e2e5d3edb29612a99ed3b14b809d34bf62823a4
This commit is contained in:
@@ -38,7 +38,6 @@ import android.os.storage.StorageManager;
|
||||
import android.provider.Settings;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.AtomicFile;
|
||||
import android.util.ByteStringUtils;
|
||||
import android.util.PackageUtils;
|
||||
import android.util.Slog;
|
||||
import android.util.SparseArray;
|
||||
@@ -52,6 +51,7 @@ import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.XmlUtils;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
import libcore.util.HexEncoding;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
@@ -66,7 +66,6 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@@ -234,7 +233,7 @@ class InstantAppRegistry {
|
||||
@UserIdInt int userId) {
|
||||
byte[] randomBytes = new byte[8];
|
||||
new SecureRandom().nextBytes(randomBytes);
|
||||
String id = ByteStringUtils.toHexString(randomBytes).toLowerCase(Locale.US);
|
||||
String id = HexEncoding.encodeToString(randomBytes, false /* upperCase */);
|
||||
File appDir = getInstantApplicationDir(packageName, userId);
|
||||
if (!appDir.exists() && !appDir.mkdirs()) {
|
||||
Slog.e(LOG_TAG, "Cannot create instant app cookie directory");
|
||||
|
||||
@@ -26,7 +26,6 @@ import android.os.FileUtils;
|
||||
import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.os.storage.StorageManager;
|
||||
import android.util.ByteStringUtils;
|
||||
import android.util.EventLog;
|
||||
import android.util.PackageUtils;
|
||||
import android.util.Slog;
|
||||
@@ -38,6 +37,8 @@ import com.android.server.pm.Installer.InstallerException;
|
||||
import com.android.server.pm.dex.PackageDynamicCodeLoading.DynamicCodeFile;
|
||||
import com.android.server.pm.dex.PackageDynamicCodeLoading.PackageDynamicCode;
|
||||
|
||||
import libcore.util.HexEncoding;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@@ -153,7 +154,7 @@ public class DynamicCodeLogger {
|
||||
|
||||
// Valid SHA256 will be 256 bits, 32 bytes.
|
||||
if (hash != null && hash.length == 32) {
|
||||
message = message + ' ' + ByteStringUtils.toHexString(hash);
|
||||
message = message + ' ' + HexEncoding.encodeToString(hash);
|
||||
} else {
|
||||
Slog.d(TAG, "Got no hash for " + filePath);
|
||||
// File has probably been deleted.
|
||||
|
||||
Reference in New Issue
Block a user