use of com.android.launcher3.model.AppLaunchTracker in project android_packages_apps_Trebuchet by LineageOS.
the class AbstractLauncherUiTest method setUp.
@Before
public void setUp() throws Exception {
Log.d(TAG, "Before disabling battery defender");
mDevice.executeShellCommand("setprop vendor.battery.defender.disable 1");
Log.d(TAG, "Before enabling stay awake");
mDevice.executeShellCommand("settings put global stay_on_while_plugged_in 3");
for (int i = 0; i < 10 && hasSystemUiObject("keyguard_status_view"); ++i) {
Log.d(TAG, "Before unlocking the phone");
mDevice.executeShellCommand("input keyevent 82");
mDevice.waitForIdle();
}
Assert.assertTrue("Keyguard still visible", mDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000));
Log.d(TAG, "Keyguard is not visible");
final String launcherPackageName = mDevice.getLauncherPackageName();
try {
final Context context = InstrumentationRegistry.getContext();
final PackageManager pm = context.getPackageManager();
final PackageInfo launcherPackage = pm.getPackageInfo(launcherPackageName, 0);
if (!launcherPackage.versionName.equals("BuildFromAndroidStudio")) {
Assert.assertEquals("Launcher version doesn't match tests version", pm.getPackageInfo(context.getPackageName(), 0).getLongVersionCode(), launcherPackage.getLongVersionCode());
}
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(e);
}
mLauncherPid = 0;
// Disable app tracker
AppLaunchTracker.INSTANCE.initializeForTesting(new AppLaunchTracker());
mTargetContext = InstrumentationRegistry.getTargetContext();
mTargetPackage = mTargetContext.getPackageName();
mLauncherPid = mLauncher.getPid();
UserManager userManager = mTargetContext.getSystemService(UserManager.class);
if (userManager != null) {
for (UserHandle userHandle : userManager.getUserProfiles()) {
if (!userHandle.isSystem()) {
mDevice.executeShellCommand("pm remove-user " + userHandle.getIdentifier());
}
}
}
}
use of com.android.launcher3.model.AppLaunchTracker in project android_packages_apps_Trebuchet by LineageOS.
the class AppPredictionsUITests method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
List<LauncherActivityInfo> activities = mTargetContext.getSystemService(LauncherApps.class).getActivityList(null, Process.myUserHandle());
mSampleApp1 = activities.get(0);
mSampleApp2 = activities.get(1);
mSampleApp3 = activities.get(2);
// Disable app tracker
AppLaunchTracker.INSTANCE.initializeForTesting(new AppLaunchTracker());
PredictionUiStateManager.INSTANCE.initializeForTesting(null);
mCallback = PredictionUiStateManager.INSTANCE.get(mTargetContext).appPredictorCallback(Client.HOME);
mDevice.setOrientationNatural();
}
use of com.android.launcher3.model.AppLaunchTracker in project Neo-Launcher by NeoApplications.
the class AppPredictionsUITests method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
List<LauncherActivityInfo> activities = LauncherAppsCompat.getInstance(mTargetContext).getActivityList(null, Process.myUserHandle());
mSampleApp1 = activities.get(0);
mSampleApp2 = activities.get(1);
mSampleApp3 = activities.get(2);
// Disable app tracker
AppLaunchTracker.INSTANCE.initializeForTesting(new AppLaunchTracker());
PredictionUiStateManager.INSTANCE.initializeForTesting(null);
mCallback = PredictionUiStateManager.INSTANCE.get(mTargetContext).appPredictorCallback(Client.HOME);
mDevice.setOrientationNatural();
}
use of com.android.launcher3.model.AppLaunchTracker in project Neo-Launcher by NeoApplications.
the class AbstractLauncherUiTest method setUp.
@Before
public void setUp() throws Exception {
// Disable app tracker
AppLaunchTracker.INSTANCE.initializeForTesting(new AppLaunchTracker());
mTargetContext = InstrumentationRegistry.getTargetContext();
mTargetPackage = mTargetContext.getPackageName();
}
Aggregations