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

Commit bdd4491b authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Gracefully handle long fingerprints.

Otherwise derived fingerprints longer than the maximum system property
size put the device into a crash loop.

Bug: 13983493
Change-Id: I8a88e71b1fd396f1cd63b414e3a62bb25010430c
parent 5568772e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.os;

import android.text.TextUtils;
import android.util.Slog;

import com.android.internal.telephony.TelephonyProperties;

@@ -24,6 +25,8 @@ import com.android.internal.telephony.TelephonyProperties;
 * Information about the current build, extracted from system properties.
 */
public class Build {
    private static final String TAG = "Build";

    /** Value used for when a build property is unknown. */
    public static final String UNKNOWN = "unknown";

@@ -541,7 +544,11 @@ public class Build {
     */
    public static void ensureFingerprintProperty() {
        if (TextUtils.isEmpty(SystemProperties.get("ro.build.fingerprint"))) {
            try {
                SystemProperties.set("ro.build.fingerprint", FINGERPRINT);
            } catch (IllegalArgumentException e) {
                Slog.e(TAG, "Failed to set fingerprint property", e);
            }
        }
    }