use of android.app.ActivityManager.AppTask in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ChooseLockGenericTest method finishAllAppTasks.
private void finishAllAppTasks() {
final ActivityManager activityManager = getTargetContext().getSystemService(ActivityManager.class);
final List<AppTask> appTasks = activityManager.getAppTasks();
for (ActivityManager.AppTask task : appTasks) {
task.finishAndRemoveTask();
}
}
use of android.app.ActivityManager.AppTask in project platform_frameworks_base by android.
the class LauncherActivity method findTask.
@Nullable
private Intent findTask(ActivityManager activities) {
List<AppTask> tasks = activities.getAppTasks();
for (AppTask task : tasks) {
Intent intent = task.getTaskInfo().baseIntent;
Uri uri = intent.getData();
if (isLaunchUri(uri)) {
return intent;
}
}
return null;
}
use of android.app.ActivityManager.AppTask in project android_packages_apps_Dialer by LineageOS.
the class InCallActivityCommon method setExcludeFromRecents.
public void setExcludeFromRecents(boolean exclude) {
List<AppTask> tasks = inCallActivity.getSystemService(ActivityManager.class).getAppTasks();
int taskId = inCallActivity.getTaskId();
for (int i = 0; i < tasks.size(); i++) {
ActivityManager.AppTask task = tasks.get(i);
try {
if (task.getTaskInfo().id == taskId) {
task.setExcludeFromRecents(exclude);
}
} catch (RuntimeException e) {
LogUtil.e("InCallActivityCommon.setExcludeFromRecents", "RuntimeException when excluding task from recents.", e);
}
}
}
use of android.app.ActivityManager.AppTask in project android_packages_apps_Settings by DirtyUnicorns.
the class ChooseLockGenericTest method finishAllAppTasks.
private void finishAllAppTasks() {
final ActivityManager activityManager = getTargetContext().getSystemService(ActivityManager.class);
final List<AppTask> appTasks = activityManager.getAppTasks();
for (ActivityManager.AppTask task : appTasks) {
task.finishAndRemoveTask();
}
}
use of android.app.ActivityManager.AppTask in project AndroidChromium by JackyAndroid.
the class WebappDirectoryManager method getBaseIntentsForAllTasks.
/**
* Returns a Set of Intents for all Chrome tasks currently known by the ActivityManager.
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
protected Set<Intent> getBaseIntentsForAllTasks() {
Set<Intent> baseIntents = new HashSet<Intent>();
Context context = ContextUtils.getApplicationContext();
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (AppTask task : manager.getAppTasks()) {
Intent intent = DocumentUtils.getBaseIntentFromTask(task);
if (intent != null)
baseIntents.add(intent);
}
return baseIntents;
}
Aggregations