DeviceInfoUtils: support clang kernel version

Test: view settings
Bug: 32455817
Change-Id: Iaaf8021fa743c74c8052b6a3352ef15b40cc4974
This commit is contained in:
Nick Desaulniers
2016-10-29 11:01:23 -07:00
parent 99449eea6c
commit 7091e2fdc0

View File

@@ -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()) {