From: Chih-Wei Huang Date: Mon, 18 Jul 2016 14:32:13 +0000 (+0800) Subject: ABIPicker: match package name by patterns X-Git-Tag: android-x86-8.1-r1~7 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=a3cd27c5dadb2b7a2229a69de3f3111ef34f43ca;p=android-x86%2Fframeworks-base.git ABIPicker: match package name by patterns PRC apps from different markets usually have different package names. This change tries to match them by patterns. To test it, install the Implosion apps from Wandoujia and CoolMarket and run them OK. --- diff --git a/core/jni/abipicker/ABIPicker.cpp b/core/jni/abipicker/ABIPicker.cpp index 3fc6bad19eca..b20f4cd2f92b 100644 --- a/core/jni/abipicker/ABIPicker.cpp +++ b/core/jni/abipicker/ABIPicker.cpp @@ -5,6 +5,7 @@ #include #include +#include namespace android { #define ARR_SIZE(x) (sizeof(x)/sizeof(x[0])) @@ -103,8 +104,8 @@ bool isInOEMWhiteList(const char* pkgName) { Vector::iterator it = cfgWhite.begin(); for (; it != cfgWhite.end(); it++) { P_LOG("whitelist : %s", *it); - if (0 == strcmp(pkgName, *it)) { - ALOGI("found %s in whitelist", pkgName); + if (0 == fnmatch(*it, pkgName, 0)) { + ALOGI("whitelist %s by %s", pkgName, *it); result = true; break; } @@ -125,8 +126,8 @@ bool isInOEMBlackList(const char* pkgName) { Vector::iterator it = cfgBlack.begin(); for (; it != cfgBlack.end(); it++) { - if (0 == strcmp(pkgName, *it)) { - ALOGI("found %s in blacklist", pkgName); + if (0 == fnmatch(*it, pkgName, 0)) { + ALOGI("blacklist %s by %s", pkgName, *it); result = true; break; }