Search in sources :

Example 1 with AppTask

use of android.app.ActivityManager.AppTask in project android_frameworks_base by ResurrectionRemix.

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;
}
Also used : AppTask(android.app.ActivityManager.AppTask) Intent(android.content.Intent) Uri(android.net.Uri) Nullable(android.support.annotation.Nullable)

Example 2 with AppTask

use of android.app.ActivityManager.AppTask in project android_frameworks_base by DirtyUnicorns.

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;
}
Also used : AppTask(android.app.ActivityManager.AppTask) Intent(android.content.Intent) Uri(android.net.Uri) Nullable(android.support.annotation.Nullable)

Example 3 with AppTask

use of android.app.ActivityManager.AppTask in project android_frameworks_base by AOSPA.

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;
}
Also used : AppTask(android.app.ActivityManager.AppTask) Intent(android.content.Intent) Uri(android.net.Uri) Nullable(android.support.annotation.Nullable)

Example 4 with AppTask

use of android.app.ActivityManager.AppTask in project android_frameworks_base by crdroidandroid.

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;
}
Also used : AppTask(android.app.ActivityManager.AppTask) Intent(android.content.Intent) Uri(android.net.Uri) Nullable(android.support.annotation.Nullable)

Example 5 with AppTask

use of android.app.ActivityManager.AppTask in project android_packages_apps_Settings by LineageOS.

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();
    }
}
Also used : AppTask(android.app.ActivityManager.AppTask) AppTask(android.app.ActivityManager.AppTask) ActivityManager(android.app.ActivityManager)

Aggregations

AppTask (android.app.ActivityManager.AppTask)22 ActivityManager (android.app.ActivityManager)11 Intent (android.content.Intent)7 Test (org.junit.Test)6 Uri (android.net.Uri)5 Nullable (android.support.annotation.Nullable)5 TargetApi (android.annotation.TargetApi)3 RecentTaskInfo (android.app.ActivityManager.RecentTaskInfo)2 Context (android.content.Context)2 Activity (android.app.Activity)1 PackageManager (android.content.pm.PackageManager)1 HashSet (java.util.HashSet)1 Config (org.robolectric.annotation.Config)1