mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
adjust factory image identification
Adjust the way to identify factory bootloader to decide whether SW is factory SW version. When device in factory mode may be identified as factory version in previous implementation. Change-Id: I38b4fe9ea12d70b8e07416110c2d7e8a5bbf994a Signed-off-by: yanyh2 <yanyh2@motorola.com> Reviewed-on: https://gerrit.mot.com/1616461 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhenxin Xi <xizx@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
46549afa7c
commit
7e2ed631f2
1 changed files with 10 additions and 5 deletions
|
|
@ -1349,6 +1349,7 @@ static bool mmi_factory_check(int type)
|
|||
bool factory = false;
|
||||
const char *bootargs = NULL;
|
||||
char *bl_version = NULL;
|
||||
char *end = NULL;
|
||||
|
||||
if (!np)
|
||||
return factory;
|
||||
|
|
@ -1359,12 +1360,16 @@ static bool mmi_factory_check(int type)
|
|||
"mmi,factory-cable");
|
||||
break;
|
||||
case MMI_FACTORY_BUILD:
|
||||
if (!of_property_read_string(np,
|
||||
"bootargs", &bootargs)) {
|
||||
bl_version = strstr(bootargs,
|
||||
"androidboot.bootloader=");
|
||||
if (bl_version && strstr(bl_version, "factory"))
|
||||
if (!of_property_read_string(np, "bootargs", &bootargs)) {
|
||||
bl_version = strstr(bootargs, "androidboot.bootloader=");
|
||||
if (bl_version) {
|
||||
end = strpbrk(bl_version, " ");
|
||||
bl_version = strpbrk(bl_version, "=");
|
||||
}
|
||||
if (bl_version && end > bl_version &&
|
||||
strnstr(bl_version, "factory", end - bl_version)) {
|
||||
factory = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue