Loading src/com/android/launcher3/InstallShortcutReceiver.java +3 −4 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ public class InstallShortcutReceiver extends BroadcastReceiver { public static final int FLAG_ACTIVITY_PAUSED = 1; public static final int FLAG_LOADER_RUNNING = 2; public static final int FLAG_DRAG_AND_DROP = 4; public static final int FLAG_BULK_ADD = 4; // Determines whether to defer installing shortcuts immediately until // processAllPendingInstalls() is called. Loading Loading @@ -110,8 +109,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver { @WorkerThread private static void flushQueueInBackground(Context context) { LauncherModel model = LauncherAppState.getInstance(context).getModel(); if (model.getCallback() == null) { if (Launcher.ACTIVITY_TRACKER.getCreatedActivity() == null) { // Launcher not loaded return; } Loading Loading @@ -146,7 +144,8 @@ public class InstallShortcutReceiver extends BroadcastReceiver { } prefs.edit().remove(APPS_PENDING_INSTALL).apply(); if (!installQueue.isEmpty()) { model.addAndBindAddedWorkspaceItems(installQueue); LauncherAppState.getInstance(context).getModel() .addAndBindAddedWorkspaceItems(installQueue); } } Loading src/com/android/launcher3/testing/TestInformationHandler.java +2 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.allapps.AllAppsStore; Loading Loading @@ -173,8 +172,8 @@ public class TestInformationHandler implements ResourceBasedOverride { } protected boolean isLauncherInitialized() { final LauncherModel model = LauncherAppState.getInstance(mContext).getModel(); return model.getCallback() == null || model.isModelLoaded(); return Launcher.ACTIVITY_TRACKER.getCreatedActivity() == null || LauncherAppState.getInstance(mContext).getModel().isModelLoaded(); } private static void runGcAndFinalizersSync() { Loading tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +3 −11 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ import androidx.test.uiautomator.Until; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherSettings; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager; Loading Loading @@ -183,7 +182,7 @@ public abstract class AbstractLauncherUiTest { public void verifyLauncherState() { try { // Limits UI tests affecting tests running after them. waitForModelLoaded(); mLauncher.waitForLauncherInitialized(); } catch (Throwable t) { Log.e(TAG, "Couldn't deinit after a test, exiting tests, see logs for failures that " Loading Loading @@ -222,14 +221,7 @@ public abstract class AbstractLauncherUiTest { } catch (Throwable t) { throw new IllegalArgumentException(t); } waitForModelLoaded(); } protected void waitForModelLoaded() { waitForLauncherCondition("Launcher model didn't load", launcher -> { final LauncherModel model = LauncherAppState.getInstance(mTargetContext).getModel(); return model.getCallback() == null || model.isModelLoaded(); }); mLauncher.waitForLauncherInitialized(); } /** Loading Loading @@ -258,7 +250,7 @@ public abstract class AbstractLauncherUiTest { // Launch the home activity mDevice.pressHome(); waitForModelLoaded(); mLauncher.waitForLauncherInitialized(); } /** Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +1 −1 Original line number Diff line number Diff line Loading @@ -495,7 +495,7 @@ public final class LauncherInstrumentation { } } private void waitForLauncherInitialized() { public void waitForLauncherInitialized() { for (int i = 0; i < 100; ++i) { if (getTestInfo( TestProtocol.REQUEST_IS_LAUNCHER_INITIALIZED). Loading Loading
src/com/android/launcher3/InstallShortcutReceiver.java +3 −4 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ public class InstallShortcutReceiver extends BroadcastReceiver { public static final int FLAG_ACTIVITY_PAUSED = 1; public static final int FLAG_LOADER_RUNNING = 2; public static final int FLAG_DRAG_AND_DROP = 4; public static final int FLAG_BULK_ADD = 4; // Determines whether to defer installing shortcuts immediately until // processAllPendingInstalls() is called. Loading Loading @@ -110,8 +109,7 @@ public class InstallShortcutReceiver extends BroadcastReceiver { @WorkerThread private static void flushQueueInBackground(Context context) { LauncherModel model = LauncherAppState.getInstance(context).getModel(); if (model.getCallback() == null) { if (Launcher.ACTIVITY_TRACKER.getCreatedActivity() == null) { // Launcher not loaded return; } Loading Loading @@ -146,7 +144,8 @@ public class InstallShortcutReceiver extends BroadcastReceiver { } prefs.edit().remove(APPS_PENDING_INSTALL).apply(); if (!installQueue.isEmpty()) { model.addAndBindAddedWorkspaceItems(installQueue); LauncherAppState.getInstance(context).getModel() .addAndBindAddedWorkspaceItems(installQueue); } } Loading
src/com/android/launcher3/testing/TestInformationHandler.java +2 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.allapps.AllAppsStore; Loading Loading @@ -173,8 +172,8 @@ public class TestInformationHandler implements ResourceBasedOverride { } protected boolean isLauncherInitialized() { final LauncherModel model = LauncherAppState.getInstance(mContext).getModel(); return model.getCallback() == null || model.isModelLoaded(); return Launcher.ACTIVITY_TRACKER.getCreatedActivity() == null || LauncherAppState.getInstance(mContext).getModel().isModelLoaded(); } private static void runGcAndFinalizersSync() { Loading
tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +3 −11 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ import androidx.test.uiautomator.Until; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherSettings; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager; Loading Loading @@ -183,7 +182,7 @@ public abstract class AbstractLauncherUiTest { public void verifyLauncherState() { try { // Limits UI tests affecting tests running after them. waitForModelLoaded(); mLauncher.waitForLauncherInitialized(); } catch (Throwable t) { Log.e(TAG, "Couldn't deinit after a test, exiting tests, see logs for failures that " Loading Loading @@ -222,14 +221,7 @@ public abstract class AbstractLauncherUiTest { } catch (Throwable t) { throw new IllegalArgumentException(t); } waitForModelLoaded(); } protected void waitForModelLoaded() { waitForLauncherCondition("Launcher model didn't load", launcher -> { final LauncherModel model = LauncherAppState.getInstance(mTargetContext).getModel(); return model.getCallback() == null || model.isModelLoaded(); }); mLauncher.waitForLauncherInitialized(); } /** Loading Loading @@ -258,7 +250,7 @@ public abstract class AbstractLauncherUiTest { // Launch the home activity mDevice.pressHome(); waitForModelLoaded(); mLauncher.waitForLauncherInitialized(); } /** Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +1 −1 Original line number Diff line number Diff line Loading @@ -495,7 +495,7 @@ public final class LauncherInstrumentation { } } private void waitForLauncherInitialized() { public void waitForLauncherInitialized() { for (int i = 0; i < 100; ++i) { if (getTestInfo( TestProtocol.REQUEST_IS_LAUNCHER_INITIALIZED). Loading