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

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

Snap for 4489599 from aec40501 to pi-release

Change-Id: I8d1f17b5d4d679fb040df7d2d7ea6062818311de
parents 3daac9ba aec40501
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -141,7 +141,8 @@ public class CreateDirectoryFragment extends DialogFragment {
                        resolver, mCwd.derivedUri.getAuthority());
                final Uri childUri = DocumentsContract.createDocument(
                        client, mCwd.derivedUri, Document.MIME_TYPE_DIR, mDisplayName);
                return DocumentInfo.fromUri(resolver, childUri);
                DocumentInfo doc = DocumentInfo.fromUri(resolver, childUri);
                return doc.isDirectory() ? doc : null;
            } catch (Exception e) {
                Log.w(TAG, "Failed to create directory", e);
                return null;
+9 −0
Original line number Diff line number Diff line
@@ -124,6 +124,15 @@
                <action android:name="android.content.action.DOCUMENTS_PROVIDER" />
            </intent-filter>
        </provider>

        <service android:name="com.android.documentsui.services.TestNotificationService"
                 android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
                 android:process="com.android.documentsui">
            <intent-filter>
                <action android:name="android.service.notification.NotificationListenerService" />
            </intent-filter>
        </service>

    </application>

    <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+9 −0
Original line number Diff line number Diff line
@@ -144,6 +144,15 @@ public class DocumentsProviderHelper {
        waitForWrite();
    }

    public void writeAppendDocument(Uri documentUri, byte[] contents)
            throws RemoteException, IOException {
        ParcelFileDescriptor file = mClient.openFile(documentUri, "wa", null);
        try (AutoCloseOutputStream out = new AutoCloseOutputStream(file)) {
            out.write(contents);
        }
        waitForWrite();
    }

    public void waitForWrite() throws RemoteException {
        mClient.call("waitForWrite", null, null);
    }
+11 −2
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public class StubProvider extends DocumentsProvider {
    private static final String TAG = "StubProvider";

    private static final String STORAGE_SIZE_KEY = "documentsui.stubprovider.size";
    private static int DEFAULT_ROOT_SIZE = 1024 * 1024 * 100; // 100 MB.
    private static int DEFAULT_ROOT_SIZE = 1024 * 1024 * 500; // 500 MB.

    private static final String[] DEFAULT_ROOT_PROJECTION = new String[] {
            Root.COLUMN_ROOT_ID, Root.COLUMN_FLAGS, Root.COLUMN_TITLE, Root.COLUMN_DOCUMENT_ID,
@@ -357,6 +357,10 @@ public class StubProvider extends DocumentsProvider {
        if ("w".equals(mode)) {
            return startWrite(document);
        }
        if ("wa".equals(mode)) {
            return startWrite(document, true);
        }


        throw new FileNotFoundException();
    }
@@ -423,6 +427,11 @@ public class StubProvider extends DocumentsProvider {

    private ParcelFileDescriptor startWrite(final StubDocument document)
            throws FileNotFoundException {
        return startWrite(document, false);
    }

    private ParcelFileDescriptor startWrite(final StubDocument document, boolean append)
            throws FileNotFoundException {
        ParcelFileDescriptor[] pipe;
        try {
            pipe = ParcelFileDescriptor.createReliablePipe();
@@ -438,7 +447,7 @@ public class StubProvider extends DocumentsProvider {
            try {
                Log.d(TAG, "Opening write stream on file " + document.documentId);
                inputStream = new ParcelFileDescriptor.AutoCloseInputStream(readPipe);
                outputStream = new FileOutputStream(document.file);
                outputStream = new FileOutputStream(document.file, append);
                byte[] buffer = new byte[32 * 1024];
                int bytesToRead;
                int bytesRead = 0;
+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ public class UiBot extends Bots.BaseBot {
        onView(withId(android.R.id.button2)).perform(click());
    }

    UiObject findMenuLabelWithName(String label) {
    public UiObject findMenuLabelWithName(String label) {
        UiSelector selector = new UiSelector().text(label);
        return mDevice.findObject(selector);
    }
Loading