From 7091e2fdc016932e497223f09eab1287aa8bbd0b Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Sat, 29 Oct 2016 11:01:23 -0700 Subject: [PATCH] DeviceInfoUtils: support clang kernel version Test: view settings Bug: 32455817 Change-Id: Iaaf8021fa743c74c8052b6a3352ef15b40cc4974 --- .../src/com/android/settingslib/DeviceInfoUtils.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/DeviceInfoUtils.java b/packages/SettingsLib/src/com/android/settingslib/DeviceInfoUtils.java index b04948b7de5f1..ebb5d19eb6bbd 100644 --- a/packages/SettingsLib/src/com/android/settingslib/DeviceInfoUtils.java +++ b/packages/SettingsLib/src/com/android/settingslib/DeviceInfoUtils.java @@ -82,11 +82,10 @@ public class DeviceInfoUtils { final String PROC_VERSION_REGEX = "Linux version (\\S+) " + /* group 1: "3.0.31-g6fb96c9" */ - "\\((\\S+?)\\) " + /* group 2: "x@y.com" (kernel builder) */ - "(?:\\(gcc.+? \\)) " + /* ignore: GCC version information */ - "(#\\d+) " + /* group 3: "#1" */ - "(?:.*?)?" + /* ignore: optional SMP, PREEMPT, and any CONFIG_FLAGS */ - "((Sun|Mon|Tue|Wed|Thu|Fri|Sat).+)"; /* group 4: "Thu Jun 28 11:02:39 PDT 2012" */ + "\\((\\S+)\\)" + /* group 2: "x@y.com" (kernel builder) */ + ".*(#\\d+)" + /* group 3: "#1" */ + /* group 4: "Thu Jun 28 11:02:39 PDT 2012" */ + ".*((?:Sun|Mon|Tue|Wed|Thu|Fri|Sat).+)"; Matcher m = Pattern.compile(PROC_VERSION_REGEX).matcher(rawKernelVersion); if (!m.matches()) {