diff options
29 files changed, 89 insertions, 86 deletions
diff --git a/res/layout/drawer_layout.xml b/res/layout/drawer_layout.xml index 0b2a81d72..74e219cbc 100644 --- a/res/layout/drawer_layout.xml +++ b/res/layout/drawer_layout.xml @@ -58,8 +58,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - <!-- Drawer edge is a dummy view used to capture hovering event - on view edge to open the drawer. (b/28345294) --> + <!-- Drawer edge is a placeholder view used to capture hovering + event on view edge to open the drawer. (b/28345294) --> <View android:id="@+id/drawer_edge" android:background="@android:color/transparent" diff --git a/src/com/android/documentsui/AbstractActionHandler.java b/src/com/android/documentsui/AbstractActionHandler.java index 0c612eddd..d2f7e41c6 100644 --- a/src/com/android/documentsui/AbstractActionHandler.java +++ b/src/com/android/documentsui/AbstractActionHandler.java @@ -745,7 +745,7 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA public void onRootLoaded(@Nullable RootInfo root) { if (root == null) { // There is no such root in the other profile. Maybe the provider is missing on - // the other profile. Create a dummy root and open it to show error message. + // the other profile. Create a placeholder root and open it to show error message. root = RootInfo.copyRootInfo(mOriginalRoot); root.userId = mSelectedUserId; } diff --git a/src/com/android/documentsui/BaseActivity.java b/src/com/android/documentsui/BaseActivity.java index 8c0d9693f..5efb9a93e 100644 --- a/src/com/android/documentsui/BaseActivity.java +++ b/src/com/android/documentsui/BaseActivity.java @@ -934,7 +934,7 @@ public abstract class BaseActivity getMainLooper().getQueue().addIdleHandler(new IdleHandler() { @Override public boolean queueIdle() { - // If startup benchmark is requested by a whitelisted testing package, then + // If startup benchmark is requested by an allowedlist testing package, then // close the activity once idle, and notify the testing activity. if (getIntent().getBooleanExtra(EXTRA_BENCHMARK, false) && BENCHMARK_TESTING_PACKAGE.equals(getCallingPackage())) { diff --git a/src/com/android/documentsui/DocsSelectionHelper.java b/src/com/android/documentsui/DocsSelectionHelper.java index b7a720c8b..956527a2e 100644 --- a/src/com/android/documentsui/DocsSelectionHelper.java +++ b/src/com/android/documentsui/DocsSelectionHelper.java @@ -37,10 +37,10 @@ public final class DocsSelectionHelper extends SelectionTracker<String> { private final DelegateFactory mFactory; - // initialize to a dummy object incase we get some input + // initialize to a stub object incase we get some input // event drive calls before we're properly initialized. // See: b/69306667. - private SelectionTracker<String> mDelegate = new DummySelectionTracker<>(); + private SelectionTracker<String> mDelegate = new StubSelectionTracker<>(); @VisibleForTesting DocsSelectionHelper(DelegateFactory factory) { diff --git a/src/com/android/documentsui/DrawerController.java b/src/com/android/documentsui/DrawerController.java index cb536162d..56b3a879f 100644 --- a/src/com/android/documentsui/DrawerController.java +++ b/src/com/android/documentsui/DrawerController.java @@ -55,7 +55,7 @@ public abstract class DrawerController implements DrawerListener { DrawerLayout layout = (DrawerLayout) activity.findViewById(R.id.drawer_layout); if (layout == null) { - return new DummyDrawerController(); + return new StubDrawerController(); } View drawer = activity.findViewById(R.id.drawer_roots); @@ -76,8 +76,8 @@ public abstract class DrawerController implements DrawerListener { /** * Returns a controller suitable for {@code Layout}. */ - static DrawerController createDummy() { - return new DummyDrawerController(); + static DrawerController createStub() { + return new StubDrawerController(); } private static int calculateDrawerWidth(Activity activity) { @@ -235,9 +235,9 @@ public abstract class DrawerController implements DrawerListener { } /* - * Dummy controller useful with clients that don't host a real drawer. + * Stub controller useful with clients that don't host a real drawer. */ - private static final class DummyDrawerController extends DrawerController { + private static final class StubDrawerController extends DrawerController { @Override public void setOpen(boolean open) {} diff --git a/src/com/android/documentsui/DummyProfileTabsAddons.java b/src/com/android/documentsui/StubProfileTabsAddons.java index 697025e23..cac175945 100644 --- a/src/com/android/documentsui/DummyProfileTabsAddons.java +++ b/src/com/android/documentsui/StubProfileTabsAddons.java @@ -17,9 +17,9 @@ package com.android.documentsui; /** - * A dummy {@ProfileTabsAddons} implementation. + * A stub {@ProfileTabsAddons} implementation. */ -public class DummyProfileTabsAddons implements ProfileTabsAddons { +public class StubProfileTabsAddons implements ProfileTabsAddons { @Override public void setEnabled(boolean enabled) { diff --git a/src/com/android/documentsui/DummySelectionTracker.java b/src/com/android/documentsui/StubSelectionTracker.java index 49b9ad918..1a392144f 100644 --- a/src/com/android/documentsui/DummySelectionTracker.java +++ b/src/com/android/documentsui/StubSelectionTracker.java @@ -26,10 +26,11 @@ import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver; import java.util.Set; /** - * A dummy SelectionTracker used by DocsSelectionHelper before a real SelectionTracker has been + * A stub SelectionTracker used by DocsSelectionHelper before a real SelectionTracker has been * initialized by DirectoryFragment. + * @param <K> Selection key type which extends {@link SelectionTracker}. */ -public class DummySelectionTracker<K> extends SelectionTracker<K> { +public class StubSelectionTracker<K> extends SelectionTracker<K> { @Override public void addObserver(SelectionObserver observer) { diff --git a/src/com/android/documentsui/base/DummyLookup.java b/src/com/android/documentsui/base/StubLookup.java index 11a637580..2a2dc9bf1 100644 --- a/src/com/android/documentsui/base/DummyLookup.java +++ b/src/com/android/documentsui/base/StubLookup.java @@ -17,8 +17,10 @@ package com.android.documentsui.base; /** * Lookup that always returns null. + * @param <K> input type (the "key") which implements {@link Lookup}. + * @param <V> output type (the "value") which implements {@link Lookup}. */ -public final class DummyLookup<K, V> implements Lookup<K, V> { +public final class StubLookup<K, V> implements Lookup<K, V> { @Override public V lookup(K key) { return null; diff --git a/src/com/android/documentsui/dirlist/DirectoryFragment.java b/src/com/android/documentsui/dirlist/DirectoryFragment.java index 8fa02ca46..91e355a1b 100644 --- a/src/com/android/documentsui/dirlist/DirectoryFragment.java +++ b/src/com/android/documentsui/dirlist/DirectoryFragment.java @@ -367,7 +367,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On mRecView.setItemAnimator(new DirectoryItemAnimator()); mInjector = mActivity.getInjector(); - // Initially, this selection tracker (delegator) uses a dummy implementation, so it must be + // Initially, this selection tracker (delegator) uses a stub implementation, so it must be // updated (reset) when necessary things are ready. mSelectionMgr = mInjector.selectionMgr; mModel = mInjector.getModel(); @@ -492,7 +492,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On this::getModelId, mRecView::findChildViewUnder, DocumentsApplication.getDragAndDropManager(mActivity)) - : DragStartListener.DUMMY; + : DragStartListener.STUB; { // Limiting the scope of the localTracker so nobody uses it. diff --git a/src/com/android/documentsui/dirlist/DocumentsAdapter.java b/src/com/android/documentsui/dirlist/DocumentsAdapter.java index 7d09d689f..41ce73c8c 100644 --- a/src/com/android/documentsui/dirlist/DocumentsAdapter.java +++ b/src/com/android/documentsui/dirlist/DocumentsAdapter.java @@ -36,8 +36,8 @@ import java.util.List; /** * DocumentsAdapter provides glue between a directory Model, and RecyclerView. We've * abstracted this a bit in order to decompose some specialized support - * for adding dummy layout objects (@see SectionBreakDocumentsAdapter). Handling of the - * dummy layout objects was error prone when interspersed with the core mode / adapter code. + * for adding stub layout objects (@see SectionBreakDocumentsAdapter). Handling of the + * stub layout objects was error prone when interspersed with the core mode / adapter code. * * @see ModelBackedDocumentsAdapter * @see DirectoryAddonsAdapter diff --git a/src/com/android/documentsui/dirlist/DragStartListener.java b/src/com/android/documentsui/dirlist/DragStartListener.java index 8fe087229..0adddcca8 100644 --- a/src/com/android/documentsui/dirlist/DragStartListener.java +++ b/src/com/android/documentsui/dirlist/DragStartListener.java @@ -48,7 +48,7 @@ import javax.annotation.Nullable; */ interface DragStartListener { - static final DragStartListener DUMMY = new DragStartListener() { + DragStartListener STUB = new DragStartListener() { @Override public boolean onDragEvent(MotionEvent event) { return false; diff --git a/src/com/android/documentsui/files/FilesActivity.java b/src/com/android/documentsui/files/FilesActivity.java index 1afb38eac..232f29809 100644 --- a/src/com/android/documentsui/files/FilesActivity.java +++ b/src/com/android/documentsui/files/FilesActivity.java @@ -37,7 +37,6 @@ import com.android.documentsui.ActionModeController; import com.android.documentsui.BaseActivity; import com.android.documentsui.DocsSelectionHelper; import com.android.documentsui.DocumentsApplication; -import com.android.documentsui.DummyProfileTabsAddons; import com.android.documentsui.FocusManager; import com.android.documentsui.Injector; import com.android.documentsui.MenuManager.DirectoryDetails; @@ -49,6 +48,7 @@ import com.android.documentsui.ProviderExecutor; import com.android.documentsui.R; import com.android.documentsui.SharedInputHandler; import com.android.documentsui.ShortcutsUpdater; +import com.android.documentsui.StubProfileTabsAddons; import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.base.Features; import com.android.documentsui.base.RootInfo; @@ -76,7 +76,7 @@ public class FilesActivity extends BaseActivity implements AbstractActionHandler private Injector<ActionHandler<FilesActivity>> mInjector; private ActivityInputHandler mActivityInputHandler; private SharedInputHandler mSharedInputHandler; - private final ProfileTabsAddons mProfileTabsAddonsStub = new DummyProfileTabsAddons(); + private final ProfileTabsAddons mProfileTabsAddonsStub = new StubProfileTabsAddons(); public FilesActivity() { super(R.layout.files_activity, TAG); @@ -150,7 +150,7 @@ public class FilesActivity extends BaseActivity implements AbstractActionHandler mInjector.searchManager = mSearchManager; - // No profile tabs will be shown on FilesActivity. Use a dummy to avoid unnecessary + // No profile tabs will be shown on FilesActivity. Use a stub to avoid unnecessary // operations. mInjector.profileTabsController = new ProfileTabsController( mInjector.selectionMgr, diff --git a/src/com/android/documentsui/inspector/DebugView.java b/src/com/android/documentsui/inspector/DebugView.java index ffd4b7e05..908d19242 100644 --- a/src/com/android/documentsui/inspector/DebugView.java +++ b/src/com/android/documentsui/inspector/DebugView.java @@ -27,8 +27,8 @@ import androidx.annotation.StringRes; import com.android.documentsui.R; import com.android.documentsui.base.DocumentInfo; -import com.android.documentsui.base.DummyLookup; import com.android.documentsui.base.Lookup; +import com.android.documentsui.base.StubLookup; import com.android.documentsui.inspector.InspectorController.DebugDisplay; import java.text.NumberFormat; @@ -47,7 +47,7 @@ public class DebugView extends TableView implements DebugDisplay { private final Context mContext; private final Resources mRes; - private Lookup<String, Executor> mExecutors = new DummyLookup<>(); + private Lookup<String, Executor> mExecutors = new StubLookup<>(); public DebugView(Context context) { this(context, null); diff --git a/src/com/android/documentsui/sidebar/RootItem.java b/src/com/android/documentsui/sidebar/RootItem.java index 9af396e4c..a0a3210f8 100644 --- a/src/com/android/documentsui/sidebar/RootItem.java +++ b/src/com/android/documentsui/sidebar/RootItem.java @@ -210,13 +210,13 @@ public class RootItem extends Item { } /** - * Creates a dummy root item for a user. A dummy root item is used as a place holder when + * Creates a stub root item for a user. A stub root item is used as a place holder when * there is no such root available. We can therefore show the item on the UI. */ - public static RootItem createDummyItem(RootItem item, UserId targetUser) { - RootInfo dummyRootInfo = RootInfo.copyRootInfo(item.root); - dummyRootInfo.userId = targetUser; - RootItem dummy = new RootItem(dummyRootInfo, item.mActionHandler, item.mMaybeShowBadge); - return dummy; + public static RootItem createStubItem(RootItem item, UserId targetUser) { + RootInfo stubRootInfo = RootInfo.copyRootInfo(item.root); + stubRootInfo.userId = targetUser; + RootItem stub = new RootItem(stubRootInfo, item.mActionHandler, item.mMaybeShowBadge); + return stub; } } diff --git a/src/com/android/documentsui/sidebar/RootItemListBuilder.java b/src/com/android/documentsui/sidebar/RootItemListBuilder.java index 4bdce15f3..b29bd0d87 100644 --- a/src/com/android/documentsui/sidebar/RootItemListBuilder.java +++ b/src/com/android/documentsui/sidebar/RootItemListBuilder.java @@ -37,7 +37,7 @@ import java.util.List; * selected user. * * <p>If no root of the selected user was added but that of the other user was added, - * a dummy root of that root for the selected user will be generated. + * a stub root of that root for the selected user will be generated. * * <p>The builder group the roots using {@link Item#stringId} as key. * @@ -45,9 +45,9 @@ import java.util.List; * itemC[10], itemX[0],itemY[10] where root itemX, itemY do not support cross profile. * * <p>When the selected user is user 0, {@link #getList()} returns itemA[0], itemB[0], - * dummyC[0], itemX[0], itemY[10]. + * stubC[0], itemX[0], itemY[10]. * - * <p>When the selected user is user 10, {@link #getList()} returns itemA[10], dummyB[10], + * <p>When the selected user is user 10, {@link #getList()} returns itemA[10], stubB[10], * itemC[10], itemX[0], itemY[10]. */ class RootItemListBuilder { @@ -87,7 +87,7 @@ class RootItemListBuilder { return items; } - // If the root supports cross-profile, we return the added root or create a dummy root if + // If the root supports cross-profile, we return the added root or create a stub root if // it was not added for the selected user. for (RootItem item : items) { if (item.userId.equals(mSelectedUser)) { @@ -96,6 +96,6 @@ class RootItemListBuilder { } } - return Collections.singletonList(RootItem.createDummyItem(testRootItem, mSelectedUser)); + return Collections.singletonList(RootItem.createStubItem(testRootItem, mSelectedUser)); } } diff --git a/src/com/android/documentsui/sidebar/SpacerItem.java b/src/com/android/documentsui/sidebar/SpacerItem.java index d0f49c9d1..44dd75cbb 100644 --- a/src/com/android/documentsui/sidebar/SpacerItem.java +++ b/src/com/android/documentsui/sidebar/SpacerItem.java @@ -25,7 +25,7 @@ import com.android.documentsui.R; import com.android.documentsui.base.UserId; /** - * Dummy {@link Item} for dividers between different types of {@link Item}s. + * Stub {@link Item} for dividers between different types of {@link Item}s. */ class SpacerItem extends Item { private static final String TAG = "SpacerItem"; diff --git a/tests/common/com/android/documentsui/InspectorProvider.java b/tests/common/com/android/documentsui/InspectorProvider.java index 1d678d12c..722799314 100644 --- a/tests/common/com/android/documentsui/InspectorProvider.java +++ b/tests/common/com/android/documentsui/InspectorProvider.java @@ -34,10 +34,10 @@ import java.io.FileNotFoundException; * * Structure of the provider. * - * Top ------------> Middle ------> Bottom -------> Dummy21 50B - * openInProvider Dummy1 50B Dummy11 50B Dummy22 150B - * test.txt Dummy2 150B Dummy12 150B Dummy23 100B - * update.txt Dummy3 100B Dummy13 100B + * Top ------------> Middle ------> Bottom -------> Stub21 50B + * openInProvider Stub1 50B Stub11 50B Stub22 150B + * test.txt Stub2 150B Stub12 150B Stub23 100B + * update.txt Stub3 100B Stub13 100B * test.jpg * invalid.jpg */ @@ -97,24 +97,24 @@ public class InspectorProvider extends TestRootProvider { if("Top".equals(s)) { MatrixCursor c = createDocCursor(projection); addFolder(c, "Middle"); - addFileWithSize(c, "dummy1", 50); - addFileWithSize(c, "dummy2", 150); - addFileWithSize(c, "dummy3", 100); + addFileWithSize(c, "stub1", 50); + addFileWithSize(c, "stub2", 150); + addFileWithSize(c, "stub3", 100); return c; } else if("Middle".equals(s)) { MatrixCursor c = createDocCursor(projection); addFolder(c, "Bottom"); - addFileWithSize(c, "dummy11", 50); - addFileWithSize(c, "dummy12", 150); - addFileWithSize(c, "dummy13", 100); + addFileWithSize(c, "stub11", 50); + addFileWithSize(c, "stub12", 150); + addFileWithSize(c, "stub13", 100); return c; } else if("Bottom".equals(s)) { MatrixCursor c = createDocCursor(projection); - addFileWithSize(c, "dummy21", 50); - addFileWithSize(c, "dummy22", 150); - addFileWithSize(c, "dummy23", 100); + addFileWithSize(c, "stub21", 50); + addFileWithSize(c, "stub22", 150); + addFileWithSize(c, "stub23", 100); return c; } else { diff --git a/tests/common/com/android/documentsui/bots/SearchBot.java b/tests/common/com/android/documentsui/bots/SearchBot.java index 13494f00d..d14fd1375 100644 --- a/tests/common/com/android/documentsui/bots/SearchBot.java +++ b/tests/common/com/android/documentsui/bots/SearchBot.java @@ -49,7 +49,7 @@ import org.hamcrest.Matcher; */ public class SearchBot extends Bots.BaseBot { - // Dumb search layout changes substantially between Ryu and Angler. + // Base search layout changes substantially between Ryu and Angler. @SuppressWarnings("unchecked") private static final Matcher<View> SEARCH_WIDGET = allOf( withId(R.id.option_menu_search), diff --git a/tests/common/com/android/documentsui/dirlist/TestFocusHandler.java b/tests/common/com/android/documentsui/dirlist/TestFocusHandler.java index 565665566..969ddcf36 100644 --- a/tests/common/com/android/documentsui/dirlist/TestFocusHandler.java +++ b/tests/common/com/android/documentsui/dirlist/TestFocusHandler.java @@ -22,7 +22,7 @@ import android.view.KeyEvent; import android.view.View; /** - * A purely dummy instance of FocusHandler. + * A purely placeholder instance of FocusHandler. */ public final class TestFocusHandler implements FocusHandler { diff --git a/tests/common/com/android/documentsui/testing/TestEnv.java b/tests/common/com/android/documentsui/testing/TestEnv.java index e5c7eb8d4..3249c8cf1 100644 --- a/tests/common/com/android/documentsui/testing/TestEnv.java +++ b/tests/common/com/android/documentsui/testing/TestEnv.java @@ -192,7 +192,7 @@ public class TestEnv { DocumentInfo rootDoc = model.getDocument( ModelId.build(model.mUserId, TestProvidersAccess.HOME.authority, "1")); - // These are test setup sanity checks, not test assertions. + // These are test setup quick checks, not test assertions. assert rootDoc != null; assert rootDoc.isDirectory(); assert FOLDER_0.equals(rootDoc); diff --git a/tests/common/com/android/documentsui/testing/Views.java b/tests/common/com/android/documentsui/testing/Views.java index 30f79a63a..6f5b1a2b8 100644 --- a/tests/common/com/android/documentsui/testing/Views.java +++ b/tests/common/com/android/documentsui/testing/Views.java @@ -34,7 +34,7 @@ public final class Views { } /* - * Dummy View object with (x, y) coordinates + * Mock View object with (x, y) coordinates */ public static View createTestView(float x, float y) { View view = createTestView(); diff --git a/tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java b/tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java index 06970560c..953e3504b 100644 --- a/tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java +++ b/tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java @@ -47,7 +47,7 @@ import java.util.concurrent.TimeUnit; public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { private static final String TAG = "CancelFromNotificationUiTest"; - private static final String TARGET_FILE = "dummy.data"; + private static final String TARGET_FILE = "stub.data"; private static final int BUFFER_SIZE = 10 * 1024 * 1024; @@ -127,20 +127,20 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { @Override public void initTestFiles() throws RemoteException { try { - createDummyFile(); + createStubFile(); } catch (Exception e) { fail("Initialization failed. " + e.toString()); } } - private void createDummyFile() throws Exception { + private void createStubFile() throws Exception { Uri uri = mDocsHelper.createDocument(rootDir0, "*/*", TARGET_FILE); - byte[] dummyByte = new byte[BUFFER_SIZE]; - mDocsHelper.writeDocument(uri, dummyByte); + byte[] stubByte = new byte[BUFFER_SIZE]; + mDocsHelper.writeDocument(uri, stubByte); for (int i = 0; i < 49; i++) { - dummyByte = null; - dummyByte = new byte[BUFFER_SIZE]; - mDocsHelper.writeAppendDocument(uri, dummyByte, dummyByte.length); + stubByte = null; + stubByte = new byte[BUFFER_SIZE]; + mDocsHelper.writeAppendDocument(uri, stubByte, stubByte.length); } } diff --git a/tests/functional/com/android/documentsui/FileDeleteUiTest.java b/tests/functional/com/android/documentsui/FileDeleteUiTest.java index d68dbd652..5a1396229 100644 --- a/tests/functional/com/android/documentsui/FileDeleteUiTest.java +++ b/tests/functional/com/android/documentsui/FileDeleteUiTest.java @@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit; public class FileDeleteUiTest extends ActivityTest<FilesActivity> { private static final String TAG = "FileDeleteUiTest"; - private static final int DUMMY_FILE_COUNT = 1000; + private static final int STUB_FILE_COUNT = 1000; private static final int WAIT_TIME_SECONDS = 60; @@ -126,17 +126,17 @@ public class FileDeleteUiTest extends ActivityTest<FilesActivity> { @Override public void initTestFiles() throws RemoteException { try { - createDummyFiles(); + createStubFiles(); } catch (Exception e) { fail("Initialization failed"); } } - private void createDummyFiles() throws Exception { + private void createStubFiles() throws Exception { final ThreadPoolExecutor exec = new ThreadPoolExecutor( 5, 5, 1000L, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(100, true)); - for (int i = 0; i < DUMMY_FILE_COUNT; i++) { + for (int i = 0; i < STUB_FILE_COUNT; i++) { final String fileName = "file" + String.format("%04d", i) + ".log"; if (exec.getQueue().size() >= 80) { Thread.sleep(50); diff --git a/tests/functional/com/android/documentsui/dirlist/DirectoryAddonsAdapterTest.java b/tests/functional/com/android/documentsui/dirlist/DirectoryAddonsAdapterTest.java index 303c8e521..bcd1131b7 100644 --- a/tests/functional/com/android/documentsui/dirlist/DirectoryAddonsAdapterTest.java +++ b/tests/functional/com/android/documentsui/dirlist/DirectoryAddonsAdapterTest.java @@ -186,7 +186,7 @@ public class DirectoryAddonsAdapterTest extends AndroidTestCase { assertTrue(mAdapter.getItemViewType(index) == type); } - private static class DummyAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { + private static class StubAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { diff --git a/tests/functional/com/android/documentsui/services/AbstractCopyJobTest.java b/tests/functional/com/android/documentsui/services/AbstractCopyJobTest.java index eaafb37e2..7b2cb828c 100644 --- a/tests/functional/com/android/documentsui/services/AbstractCopyJobTest.java +++ b/tests/functional/com/android/documentsui/services/AbstractCopyJobTest.java @@ -179,7 +179,7 @@ public abstract class AbstractCopyJobTest<T extends CopyJob> extends AbstractJob // Init FileCountProgressTracker with 10 docs required to copy. TestCopyJobProcessTracker<CopyJob.FileCountProgressTracker> tracker = new TestCopyJobProcessTracker(CopyJob.FileCountProgressTracker.class, 10, - createJob(newArrayList(mDocs.createFolder(mSrcRoot, "dummyDir"))), + createJob(newArrayList(mDocs.createFolder(mSrcRoot, "tempDir"))), (completed) -> NumberFormat.getPercentInstance().format(completed), (time) -> mContext.getString(R.string.copy_remaining, DateUtils.formatDuration((Long) time))); @@ -213,7 +213,7 @@ public abstract class AbstractCopyJobTest<T extends CopyJob> extends AbstractJob // Init ByteCountProgressTracker with 100 KBytes required to copy. TestCopyJobProcessTracker<CopyJob.ByteCountProgressTracker> tracker = new TestCopyJobProcessTracker(CopyJob.ByteCountProgressTracker.class, 100000, - createJob(newArrayList(mDocs.createFolder(mSrcRoot, "dummyDir"))), + createJob(newArrayList(mDocs.createFolder(mSrcRoot, "tempDir"))), (completed) -> NumberFormat.getPercentInstance().format(completed), (time) -> mContext.getString(R.string.copy_remaining, DateUtils.formatDuration((Long) time))); diff --git a/tests/unit/com/android/documentsui/DocsSelectionHelperTest.java b/tests/unit/com/android/documentsui/DocsSelectionHelperTest.java index e377f0a50..3d250073b 100644 --- a/tests/unit/com/android/documentsui/DocsSelectionHelperTest.java +++ b/tests/unit/com/android/documentsui/DocsSelectionHelperTest.java @@ -102,7 +102,7 @@ public class DocsSelectionHelperTest { mSelectionMgr.reset(mgr); } - private static final class TestSelectionManager extends DummySelectionTracker<String> { + private static final class TestSelectionManager extends StubSelectionTracker<String> { private boolean mCleared; private Map<String, Boolean> mSelected = new HashMap<>(); diff --git a/tests/unit/com/android/documentsui/ModelTest.java b/tests/unit/com/android/documentsui/ModelTest.java index 7d44477c5..15a11a84f 100644 --- a/tests/unit/com/android/documentsui/ModelTest.java +++ b/tests/unit/com/android/documentsui/ModelTest.java @@ -95,7 +95,7 @@ public class ModelTest { DirectoryResult r = new DirectoryResult(); r.cursor = cursor; - // Instantiate the model with a dummy view adapter and listener that (for now) do nothing. + // Instantiate the model with a stub view adapter and listener that (for now) do nothing. model = new Model(features); // not sure why we add a listener here at all. model.addUpdateListener(new TestEventListener<>()); diff --git a/tests/unit/com/android/documentsui/sidebar/RootItemListBuilderTest.java b/tests/unit/com/android/documentsui/sidebar/RootItemListBuilderTest.java index 2574ecc5a..aadb73630 100644 --- a/tests/unit/com/android/documentsui/sidebar/RootItemListBuilderTest.java +++ b/tests/unit/com/android/documentsui/sidebar/RootItemListBuilderTest.java @@ -173,10 +173,10 @@ public class RootItemListBuilderTest { List<RootItem> result = mBuilder.getList(); assertThat(result).containsExactlyElementsIn(Lists.newArrayList( - RootItem.createDummyItem( + RootItem.createStubItem( DOWNLOADS_DEFAULT_USER, TestProvidersAccess.OtherUser.USER_ID), SDCARD_DEFAULT_USER, - RootItem.createDummyItem(HOME_DEFAULT_USER, TestProvidersAccess.OtherUser.USER_ID), + RootItem.createStubItem(HOME_DEFAULT_USER, TestProvidersAccess.OtherUser.USER_ID), IMAGE_OTHER_USER, PICKLES_DEFAULT_USER)); } diff --git a/tests/unit/com/android/documentsui/sorting/SortModelTest.java b/tests/unit/com/android/documentsui/sorting/SortModelTest.java index da8903022..25c026e1f 100644 --- a/tests/unit/com/android/documentsui/sorting/SortModelTest.java +++ b/tests/unit/com/android/documentsui/sorting/SortModelTest.java @@ -70,14 +70,14 @@ public class SortModelTest { DIMENSION_3 }; - private static final DummyListener DUMMY_LISTENER = new DummyListener(); + private static final StubListener STUB_LISTENER = new StubListener(); private SortModel mModel; @Before public void setUp() { mModel = new SortModel(Arrays.asList(DIMENSIONS)); - mModel.addListener(DUMMY_LISTENER); + mModel.addListener(STUB_LISTENER); } @Test @@ -106,7 +106,7 @@ public class SortModelTest { mModel.setDimensionVisibility(DIMENSION_1.getId(), View.GONE); assertEquals(View.GONE, DIMENSION_1.getVisibility()); - assertEquals(SortModel.UPDATE_TYPE_VISIBILITY, DUMMY_LISTENER.mLastUpdateType); + assertEquals(SortModel.UPDATE_TYPE_VISIBILITY, STUB_LISTENER.mLastUpdateType); } @Test @@ -122,8 +122,8 @@ public class SortModelTest { assertSame(DIMENSION_1, sortedDimension); assertEquals(DIMENSION_1.getDefaultSortDirection(), sortedDimension.getSortDirection()); - assertSame(mModel, DUMMY_LISTENER.mLastSortModel); - assertEquals(SortModel.UPDATE_TYPE_SORTING, DUMMY_LISTENER.mLastUpdateType); + assertSame(mModel, STUB_LISTENER.mLastSortModel); + assertEquals(SortModel.UPDATE_TYPE_SORTING, STUB_LISTENER.mLastUpdateType); } @Test @@ -134,8 +134,8 @@ public class SortModelTest { assertSame(DIMENSION_1, sortedDimension); assertEquals(SortDimension.SORT_DIRECTION_DESCENDING, sortedDimension.getSortDirection()); - assertSame(mModel, DUMMY_LISTENER.mLastSortModel); - assertEquals(SortModel.UPDATE_TYPE_SORTING, DUMMY_LISTENER.mLastUpdateType); + assertSame(mModel, STUB_LISTENER.mLastSortModel); + assertEquals(SortModel.UPDATE_TYPE_SORTING, STUB_LISTENER.mLastUpdateType); } @Test @@ -147,8 +147,8 @@ public class SortModelTest { assertSame(DIMENSION_1, sortedDimension); assertEquals(SortDimension.SORT_DIRECTION_DESCENDING, sortedDimension.getSortDirection()); - assertSame(mModel, DUMMY_LISTENER.mLastSortModel); - assertEquals(SortModel.UPDATE_TYPE_SORTING, DUMMY_LISTENER.mLastUpdateType); + assertSame(mModel, STUB_LISTENER.mLastSortModel); + assertEquals(SortModel.UPDATE_TYPE_SORTING, STUB_LISTENER.mLastUpdateType); } @Test @@ -160,8 +160,8 @@ public class SortModelTest { assertSame(DIMENSION_1, sortedDimension); assertEquals(SortDimension.SORT_DIRECTION_DESCENDING, sortedDimension.getSortDirection()); - assertSame(mModel, DUMMY_LISTENER.mLastSortModel); - assertEquals(SortModel.UPDATE_TYPE_SORTING, DUMMY_LISTENER.mLastUpdateType); + assertSame(mModel, STUB_LISTENER.mLastSortModel); + assertEquals(SortModel.UPDATE_TYPE_SORTING, STUB_LISTENER.mLastUpdateType); } @Test @@ -225,7 +225,7 @@ public class SortModelTest { return mModel.getDimensionById(sortedDimensionId); } - private static class DummyListener implements UpdateListener { + private static class StubListener implements UpdateListener { private SortModel mLastSortModel; private @UpdateType int mLastUpdateType; |