- 需求:设置的应用列表中不显示某个应用
- 源码路径:packages/apps/Settings/src/com/android/settings/applications/ManageApplications.java
public void rebuild(boolean eraseold) {
// 省略部分代码
ArrayList<ApplicationsState.AppEntry> entries = mSession.rebuild(filterObj, comparatorObj);
if (entries == null && !eraseold) {
// Don't have new list yet, but can continue using the old one.
return;
}
/*** add for hide app in setting-apps ****/
String marketName = SystemProperties.get("market.name");
for (ApplicationsState.AppEntry appEntry : entries) {
if (appEntry.info.packageName.equals(marketName)) {
entries.remove(appEntry);
break;
}
}
//end
mBaseEntries = entries;
if (mBaseEntries != null) {
mEntries = applyPrefixFilter(mCurFilterPrefix, mBaseEntries);
} else {
mEntries = null;
}
notifyDataSetChanged();