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

Commit a060b5f7 authored by Kenny Root's avatar Kenny Root Committed by Android Git Automerger
Browse files

am 6dc003a7: Merge "Reduce footprint of Signature from ~7000 to ~1448" into gingerbread

Merge commit '6dc003a7' into gingerbread-plus-aosp

* commit '6dc003a7':
  Reduce footprint of Signature from ~7000 to ~1448
parents 783f14dd 6dc003a7
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.ComponentName;
import android.os.Parcel;
import android.os.Parcelable;

import java.lang.ref.SoftReference;
import java.util.Arrays;

/**
@@ -30,7 +31,7 @@ public class Signature implements Parcelable {
    private final byte[] mSignature;
    private int mHashCode;
    private boolean mHaveHashCode;
    private String mString;
    private SoftReference<String> mStringRef;

    /**
     * Create Signature from an existing raw byte array.
@@ -96,10 +97,13 @@ public class Signature implements Parcelable {
     * cached so future calls will return the same String.
     */
    public String toCharsString() {
        if (mString != null) return mString;
        String str = new String(toChars());
        mString = str;
        return mString;
        String str = mStringRef == null ? null : mStringRef.get();
        if (str != null) {
            return str;
        }
        str = new String(toChars());
        mStringRef = new SoftReference<String>(str);
        return str;
    }

    /**