Android4.4 应用在近期任务列表中不显示修改系统源码详解RecentsActivity与RecentTasksLoader
来源:互联网 发布:淘宝拍照专用手机 编辑:程序博客网 时间:2024/06/08 18:04
android4.4\frameworks\base\packages\SystemUI\src\com\android\systemui\recent\RecentsActivity.java
此函数是打开最近应用点击空闲地方跳转
public void dismissAndGoHome() {
if (mRecentsPanel != null) {
Intent homeIntent = new Intent(Intent.ACTION_MAIN, null);
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
startActivityAsUser(homeIntent, new UserHandle(UserHandle.USER_CURRENT));//这里是跳转到系统最高Launch 里面
}
}
//记录最近应用在这里面
android4.4\frameworks\base\packages\SystemUI\src\com\android\systemui\recent\RecentTasksLoader.java
protected Void doInBackground(Void... params) {
// We load in two stages: first, we update progress with just the first screenful
// of items. Then, we update with the rest of the items
final int origPri = Process.getThreadPriority(Process.myTid());
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
final PackageManager pm = mContext.getPackageManager();
final ActivityManager am = (ActivityManager)
mContext.getSystemService(Context.ACTIVITY_SERVICE);
final List<ActivityManager.RecentTaskInfo> recentTasks =
am.getRecentTasks(MAX_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE);
int numTasks = recentTasks.size();
ActivityInfo homeInfo = new Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_HOME).resolveActivityInfo(pm, 0);
boolean firstScreenful = true;
ArrayList<TaskDescription> tasks = new ArrayList<TaskDescription>();
// skip the first task - assume it's either the home screen or the current activity.
final int first = 0;
for (int i = first, index = 0; i < numTasks && (index < MAX_TASKS); ++i) {
if (isCancelled()) {
break;
}
final ActivityManager.RecentTaskInfo recentInfo = recentTasks.get(i);
Intent intent = new Intent(recentInfo.baseIntent);
if (recentInfo.origActivity != null) {
intent.setComponent(recentInfo.origActivity);
}
//关键代码
// Don't load the current home activity.
if (isCurrentHomeActivity(intent.getComponent(), homeInfo)) {//这里是屏蔽了系统最高launch 不记录在最近应用的栈中
continue;
}
// 手动增加需要的包名
if (intent.getComponent().getPackageName().equals(“要屏蔽的包名”)) {
continue;
}
// Don't load ourselves
if (intent.getComponent().getPackageName().equals(mContext.getPackageName())) {
continue;
}
TaskDescription item = createTaskDescription(recentInfo.id,
recentInfo.persistentId, recentInfo.baseIntent,
recentInfo.origActivity, recentInfo.description);
if (item != null) {
while (true) {
try {
tasksWaitingForThumbnails.put(item);
break;
} catch (InterruptedException e) {
}
}
tasks.add(item);
if (firstScreenful && tasks.size() == mNumTasksInFirstScreenful) {
publishProgress(tasks);
tasks = new ArrayList<TaskDescription>();
firstScreenful = false;
//break;
}
++index;
}
}
if (!isCancelled()) {
publishProgress(tasks);
if (firstScreenful) {
// always should publish two updates
publishProgress(new ArrayList<TaskDescription>());
}
}
while (true) {
try {
tasksWaitingForThumbnails.put(new TaskDescription());
break;
} catch (InterruptedException e) {
}
}
Process.setThreadPriority(origPri);
return null;
}
};
mTaskLoader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
loadThumbnailsAndIconsInBackground(tasksWaitingForThumbnails);
}
- Android4.4 应用在近期任务列表中不显示修改系统源码详解RecentsActivity与RecentTasksLoader
- android4.4 如何让应用程序不显示在“最近应用程序”的列表中 .
- Android--- 应用程序设置是否出现在近期任务列表中
- Android--- 应用程序设置是否出现在近期任务列表中
- android4.4对于系统的桌面日历显示日期不随日期改变的修改
- Android中如何让任务列表不显示我们的应用
- 不显示在任务栏上,在按Ctrl+Alt+Del出现的任务列表中也不显示
- 解决Android程序退出后不显示在近期任务里
- 解决Android程序退出后不显示在近期任务里
- 应用不出现在最近任务列表问题
- 近期学习任务列表
- Android如何修改app不在多任务列表中显示
- 隐藏应用,在应用列表里不显示
- Android4.2.2 动态显示隐藏屏幕底部的导航栏(对系统源码进行修改)
- Android 让应用不显示在recent列表中的方法
- 在MyEclipse配置的WebLogic上发布的应用,修改了页面源码后,应用前台怎么刷新、清缓存都不显示修改效果
- 有关WebCalendar.js在日期显示中,与星期数不相符的修改
- 屏蔽关机全屏应用在recent列表中显示
- 同步FIFO实现
- apache2开启重写模块
- 数据结构操作与运算-CvPoint相关数据结构
- node中的路径解析
- 黑马程序员——Java集合框架—Queue—PriorityQueue
- Android4.4 应用在近期任务列表中不显示修改系统源码详解RecentsActivity与RecentTasksLoader
- 十条建议,让你的简历脱颖而出
- 字符串包含问题
- 【数值积分】 ZOJ 2369 Two Cylinders
- java 进程间通讯的有几种方法?
- oralce中exists not exists in not in对于NULL的处理
- mysql使用索引优化order排序
- oralce中exists not exists in not in对于NULL的处理
- QPainter类参考