mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Moving various nav-bar configs out of feature flags
Bug: 332588958 Test: Presubmit Flag: None Change-Id: Ia4dc5b69bcf4d461e3444b9e37bb7334bb74aae4
This commit is contained in:
@@ -48,7 +48,6 @@ import androidx.test.uiautomator.UiDevice;
|
||||
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.config.FeatureFlags.BooleanFlag;
|
||||
import com.android.launcher3.config.FeatureFlags.IntFlag;
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation;
|
||||
import com.android.launcher3.tapl.Workspace;
|
||||
import com.android.launcher3.util.rule.TestStabilityRule;
|
||||
@@ -67,7 +66,6 @@ import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.ToIntFunction;
|
||||
|
||||
public class TestUtil {
|
||||
private static final String TAG = "TestUtil";
|
||||
@@ -169,21 +167,6 @@ public class TestUtil {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility class to override a int flag during test. Note that the returned SafeCloseable
|
||||
* must be closed to restore the original state
|
||||
*/
|
||||
public static SafeCloseable overrideFlag(IntFlag flag, int value) {
|
||||
ToIntFunction<IntFlag> originalProxy = FeatureFlags.sIntReader;
|
||||
ToIntFunction<IntFlag> testProxy = f -> f == flag ? value : originalProxy.applyAsInt(f);
|
||||
FeatureFlags.sIntReader = testProxy;
|
||||
return () -> {
|
||||
if (FeatureFlags.sIntReader == testProxy) {
|
||||
FeatureFlags.sIntReader = originalProxy;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static void uninstallDummyApp() throws IOException {
|
||||
UiDevice.getInstance(getInstrumentation()).executeShellCommand(
|
||||
"pm uninstall " + DUMMY_PACKAGE);
|
||||
|
||||
Reference in New Issue
Block a user