Android系统启动后,需要隐藏某些App。可以修改以下几个文件,实现效果。
QSSI.13/packages/apps/Launcher3/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java
QSSI.13/packages/apps/Launcher3/src/com/android/launcher3/AppFilter.java
public class AppFilter {
//the apps for disable to show
public static String[] filters =new String[]{"my.tests.snapdragonsdktest","11222111","com.qlog","com.qualcomm.qti.connmgr"};
private final Set<ComponentName> mFilteredComponents;
private final Set<String> noShow = new HashSet<String>();
public AppFilter(Context context) {
for(String v : filters) {
noShow.add(v);
}
mFilteredComponents = Arrays.stream(
context.getResources().getStringArray(R.array.filtered_components))
.map(ComponentName::unflattenFromString)
.collect(Collectors.toSet());
}
public boolean shouldShowApp(ComponentName app) {
String clzName = app.getClassName();
String pkgName = app.getPackageName();
// Log.e("AppFilter","clzName :===========: "+clzName);
// Log.e("AppFilter","pkgName :===========: "+pkgName);
if(pkgName.contains(pkgName)){
return false;
}
return !mFilteredComponents.contains(app);
}
}
QSSI.13/packages/apps/Settings/src/com/android/settings/applications/manageapplications/ManageApplications.java
不知道该隐藏的App的参数是什么?
可以在BubbleTextView里打Log。
Launcher3里的
com.android.launcher3.BubbleTextView
@UiThread
public void applyFromApplicationInfo(AppInfo info) {
applyIconAndLabel(info);
// We don't need to check the info since it's not a WorkspaceItemInfo
setItemInfo(info);
//
Log.e(TAG," title ================ "+info.title);
Log.e(TAG," title ================ "+info.componentName.getPackageName());
Log.e(TAG," title ================ "+info.componentName.getClassName());
// Verify high res immediately
verifyHighRes();
if ((info.runtimeStatusFlags & ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK) != 0) {
applyProgressLevel();
}
applyDotState(info, false /* animate */);
setDownloadStateContentDescription(info, info.getProgressLevel());
}
引用:
https://blog.csdn.net/GG15625686299/article/details/132779824