use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by AOSPA.
the class LauncherAccessibilityDelegate method getSupportedActions.
/**
* Returns all the accessibility actions that can be handled by the host.
*/
public static List<LauncherAction> getSupportedActions(Launcher launcher, View host) {
if (host == null || !(host.getTag() instanceof ItemInfo)) {
return Collections.emptyList();
}
PopupContainerWithArrow container = PopupContainerWithArrow.getOpen(launcher);
LauncherAccessibilityDelegate delegate = container != null ? container.getAccessibilityDelegate() : launcher.getAccessibilityDelegate();
List<LauncherAction> result = new ArrayList<>();
delegate.getSupportedActions(host, (ItemInfo) host.getTag(), result);
return result;
}
use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by AOSPA.
the class WorkModeSwitch method onClick.
@Override
public void onClick(View view) {
if (Utilities.ATLEAST_P && isEnabled()) {
setFlag(FLAG_PROFILE_TOGGLE_ONGOING);
Launcher launcher = Launcher.getLauncher(getContext());
launcher.getStatsLogManager().logger().log(LAUNCHER_TURN_OFF_WORK_APPS_TAP);
launcher.getAppsView().getWorkManager().setWorkProfileEnabled(false);
}
}
use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsLauncher3 method runIconLaunchFromAllAppsTest.
public static void runIconLaunchFromAllAppsTest(AbstractLauncherUiTest test, AllApps allApps) {
allApps.freeze();
try {
final AppIcon app = allApps.getAppIcon("TestActivity7");
assertNotNull("AppIcon.launch returned null", app.launch(getAppPackageName()));
test.executeOnLauncher(launcher -> assertTrue("Launcher activity is the top activity; expecting another activity to be the " + "top " + "one", test.isInBackground(launcher)));
} finally {
allApps.unfreeze();
}
}
use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsLauncher3 method testPressBack.
@Ignore("b/205027405")
@Test
@PortraitLandscape
public void testPressBack() throws Exception {
mLauncher.getWorkspace().switchToAllApps();
mLauncher.pressBack();
mLauncher.getWorkspace();
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
} finally {
allApps.unfreeze();
}
mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
mLauncher.pressBack();
mLauncher.getWorkspace();
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
}
use of com.android.launcher3.Launcher in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsLauncher3 method testDragAppIcon.
@Test
@PortraitLandscape
public void testDragAppIcon() throws Throwable {
// 1. Open all apps and wait for load complete.
// 2. Drag icon to homescreen.
// 3. Verify that the icon works on homescreen.
final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
} finally {
allApps.unfreeze();
}
executeOnLauncher(launcher -> assertTrue("Launcher activity is the top activity; expecting another activity to be the top " + "one", isInBackground(launcher)));
}
Aggregations