Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43b25f13 authored by Neil Fuller's avatar Neil Fuller Committed by Android (Google) Code Review
Browse files

Merge "Switch to HexEncoding from ByteStringUtils" into qt-dev-plus-aosp

parents a000d4f9 c3dfd089
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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");
+3 −2
Original line number Diff line number Diff line
@@ -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.