Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2a8dbcf authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6520975 from e244de94 to mainline-release

Change-Id: I1d30b445b384e910bfa0eebe211b33843f054c13
parents 478d657a e244de94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import androidx.test.InstrumentationRegistry;
 */
public final class Bots {

    private static final int TIMEOUT = 5000;
    private static final int TIMEOUT = 15000;

    public final BreadBot breadcrumb;
    public final DirectoryListBot directory;
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ public class ContextMenuUiTest extends ActivityTest<FilesActivity> {
        menuItems.put("Rename", false);
        menuItems.put("Delete", false);
        menuItems.put("Open in new window", false);
        menuItems.put("Paste into folder", false);
        menuItems.put("Select all", false);
        menuItems.put("New folder", false);
    }
+33 −3
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.os.Bundle;
import android.os.RemoteException;
import android.os.SystemClock;
import android.provider.Settings;
import android.support.test.uiautomator.UiObjectNotFoundException;
import android.text.TextUtils;
import android.util.Log;

@@ -153,8 +154,13 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> {
            mIsVirtualSdCard = enableVirtualSdCard();
            assertTrue("Cannot set virtual SD Card", mIsVirtualSdCard);
            // Call initStorageRootInfo() again for setting SD Card root
            int attempts = 0;
            while (mSdCardRoot == null && attempts++ < 15) {
                SystemClock.sleep(1000);
                initStorageRootInfo();
            }
            assertNotNull("Cannot find virtual SD Card", mSdCardRoot);
        }

        IntentFilter filter = new IntentFilter();
        filter.addAction(TestNotificationService.ACTION_OPERATION_RESULT);
@@ -167,14 +173,38 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> {
    public void tearDown() throws Exception {
        // Delete created files
        deleteDocuments(mDeviceLabel);
        try {
            deleteDocuments(mSdCardLabel);
        } catch (UiObjectNotFoundException e) {
            Log.d(TAG, "SD Card ejected unexpectedly. ", e);
            mSdCardRoot = null;
            mSdCardLabel = null;
        }

        for (RootAndFolderPair rootAndFolder : mFoldersToCleanup) {
            deleteDocuments(rootAndFolder.root, rootAndFolder.folder);
        }

        if (mIsVirtualSdCard) {
        // Eject virtual SD card
        if (mIsVirtualSdCard && mSdCardRoot != null) {
            device.executeShellCommand("sm set-virtual-disk false");
            int attempts = 0;
            while (mSdCardRoot != null && attempts++ < 15) {
                List<RootInfo> rootList = mStorageDocsHelper.getRootList();
                boolean sdCardRootHidden = true;
                for (RootInfo info : rootList) {
                    if (info.isSd()) {
                        sdCardRootHidden = false;
                        SystemClock.sleep(1000);
                        break;
                    }
                }
                if (sdCardRootHidden) {
                    mSdCardRoot = null;
                    mSdCardLabel = null;
                }
            }
            assertNull("Cannot eject virtual SD Card", mSdCardRoot);
        }

        device.executeShellCommand("settings put global stay_on_while_plugged_in "