From da8c037c8b3b36d2edc42595cbf3a18d345c1489 Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Wed, 14 May 2014 16:17:26 +0100 Subject: [PATCH] Avoid supported ABI list containing "unknown". If one of the ABI list system properties is undefined/empty (as ro.product.cpu.abilist64 is on a 32-bit only device), getString returns "unknown", which ends up creating a 1-element array with "unknown" as a member. Fix this to instead just get the empty string and split that into a 0-element array. Change-Id: I0d0a54eb06bb04427bcf0487e2a16d4180b81116 --- core/java/android/os/Build.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index 1bddc7ade314c..a61c4f350cf07 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -83,7 +83,8 @@ public class Build { * * @hide */ - public static final String[] SUPPORTED_ABIS = getString("ro.product.cpu.abilist").split(","); + public static final String[] SUPPORTED_ABIS = SystemProperties.get("ro.product.cpu.abilist") + .split(","); /** * An ordered list of 32 bit ABIs supported by this device. The most preferred ABI @@ -93,8 +94,8 @@ public class Build { * * @hide */ - public static final String[] SUPPORTED_32_BIT_ABIS = getString("ro.product.cpu.abilist32") - .split(","); + public static final String[] SUPPORTED_32_BIT_ABIS = + SystemProperties.get("ro.product.cpu.abilist32").split(","); /** * An ordered list of 64 bit ABIs supported by this device. The most preferred ABI @@ -104,8 +105,8 @@ public class Build { * * @hide */ - public static final String[] SUPPORTED_64_BIT_ABIS = getString("ro.product.cpu.abilist64") - .split(","); + public static final String[] SUPPORTED_64_BIT_ABIS = + SystemProperties.get("ro.product.cpu.abilist64").split(","); /** Various version strings. */