Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Conversation

@nic0lette
Copy link
Collaborator

This adds a few files from the .idea directory to the repo, based on the
.gitignore (and some settings) from AndroidX.

This adds a few files from the .idea directory to the repo, based on the
.gitignore (and some settings) from AndroidX.
@nic0lette nic0lette requested a review from yrezgui July 8, 2021 13:48
@yrezgui yrezgui merged commit bbe6677 into google:main Jul 12, 2021
yrezgui pushed a commit that referenced this pull request Jul 12, 2021
This adds a few files from the .idea directory to the repo, based on the
.gitignore (and some settings) from AndroidX.
yrezgui added a commit that referenced this pull request Jul 15, 2021
* Import proof-of-concept ContentFileSystemProvider

A proof-of-concept java.nio.file.spi.FileSystemProvider implementation
for working with `content://` scheme URIs.

The very basic implementation supports use of `Files.walk()` and the
`Path` objects returned can be passed directly to `okio` methods.

The implementation includes a token set of tests due to the way
content:// uri access is usually granted (via the system file picker).
Currently working on how to write more useful cases.

* Sample scaffolding

Adds scaffolding for a demo of the filesystem library.

* Minor update for ExternalStoragePath

Delegate the `isTree` method to `ContentPath`.

* Add test case for single document

Adds a pair of test cases for a single document Path. Creating a Uri
that's used with DocumentsContract to connect to a test DocumentProvider
and return content.

* Add check for "root"

Add a check for a Root.MIME_TYPE_ITEM for deciding if a document is a
directory or not.

* Improve test cases

- Builds a DocumentsProvider for testing the filesystem code with
  ContentResolver.
- Built a small DSL to allow creating a document tree for test cases
  that doesn't rely on creating files.

* Add basic test for Files.walk

Builds up the TestDocumentProvider to support operations needed for
walking a tree.

* Extract Android classes

This changes the implementation to extract all the Android specific
calls from the main FileSystem classes so that we'll be able to
write host side unit tests that run without Android/Robolectric.

NOTE: Technically there are a couple of methods left, but they're more
difficult to extract in a clean way at the moment, so I've left them.

In ExternalStoragePath:
- android.os.Environment#getExternalStorageDirectory()
- android.os.Process#myPid()

* Host side tests

First set of host side tests for ContentFileSystemProvider et al.

* Update copyright

Switch copyright from AOSP to Google LLC (to match the rest of
ModernStorage).

* Remove debug log statements

* Register FileSystem "roots"

Register URIs when an instance of a ContentFileSystem is created, and
allow retrieving them with `ContentFileSystem.getRootDirectories()`

* Minor update to test code

* Refactoring

Refactors some of the provider specific methods to the FileSystem level
(which are backed by individual providers already), and changes the test
init method from `installContentFileSystem` to `initialize` to more
closely match app code.

* Fix license header

* Add "getParent" implementation

Adds generic & ExternalStorageProvider specific implementations for
"ContentPath#getParent()", along with host side tests.

It would be nice to have instrumentation tests, but I haven't been able
to grant access to any ExternalStorageProvider APIs in a test. I could
implement it for TestDocumentProvider but that would also require a bit
more work.

* Apply Spotless

Test: Existing tests pass

* Add copyright header

* Add POM details for filesystem

* Enable KDOC generation & publication on MavenCentral of filesystem

Add API metadata
Unify build.gradle for both libraries

* Filesystem (#30)

* Import proof-of-concept ContentFileSystemProvider

A proof-of-concept java.nio.file.spi.FileSystemProvider implementation
for working with `content://` scheme URIs.

The very basic implementation supports use of `Files.walk()` and the
`Path` objects returned can be passed directly to `okio` methods.

The implementation includes a token set of tests due to the way
content:// uri access is usually granted (via the system file picker).
Currently working on how to write more useful cases.

* Sample scaffolding

Adds scaffolding for a demo of the filesystem library.

* Minor update for ExternalStoragePath

Delegate the `isTree` method to `ContentPath`.

* Add test case for single document

Adds a pair of test cases for a single document Path. Creating a Uri
that's used with DocumentsContract to connect to a test DocumentProvider
and return content.

* Add check for "root"

Add a check for a Root.MIME_TYPE_ITEM for deciding if a document is a
directory or not.

* Improve test cases

- Builds a DocumentsProvider for testing the filesystem code with
  ContentResolver.
- Built a small DSL to allow creating a document tree for test cases
  that doesn't rely on creating files.

* Add basic test for Files.walk

Builds up the TestDocumentProvider to support operations needed for
walking a tree.

* Extract Android classes

This changes the implementation to extract all the Android specific
calls from the main FileSystem classes so that we'll be able to
write host side unit tests that run without Android/Robolectric.

NOTE: Technically there are a couple of methods left, but they're more
difficult to extract in a clean way at the moment, so I've left them.

In ExternalStoragePath:
- android.os.Environment#getExternalStorageDirectory()
- android.os.Process#myPid()

* Host side tests

First set of host side tests for ContentFileSystemProvider et al.

* Update copyright

Switch copyright from AOSP to Google LLC (to match the rest of
ModernStorage).

* Remove debug log statements

* Register FileSystem "roots"

Register URIs when an instance of a ContentFileSystem is created, and
allow retrieving them with `ContentFileSystem.getRootDirectories()`

* Minor update to test code

* Refactoring

Refactors some of the provider specific methods to the FileSystem level
(which are backed by individual providers already), and changes the test
init method from `installContentFileSystem` to `initialize` to more
closely match app code.

* Fix license header

* Add "getParent" implementation

Adds generic & ExternalStorageProvider specific implementations for
"ContentPath#getParent()", along with host side tests.

It would be nice to have instrumentation tests, but I haven't been able
to grant access to any ExternalStorageProvider APIs in a test. I could
implement it for TestDocumentProvider but that would also require a bit
more work.

* Apply Spotless

Test: Existing tests pass

* Address PR comments.

* Add some .idea files to the repo (#38)

This adds a few files from the .idea directory to the repo, based on the
.gitignore (and some settings) from AndroidX.

* Upgrade AGP to 4.2.2

* Upgrade sample dependencies

* Add filesystem demo

* Revert sample minSDK to API 21

Add minSDK check in demo list

* Check Uri aren't null from activityResults before executing file content preview logic

Use Files.readAllLines instead Files.newBufferedReader
Add comments in DemoListAdapter.kt

* Upgrade release number

* Change edit URI (we're using the main branch, not master)

* Add filesystem guide

* Fix API docs output directory

* Upgrade to Android Studio Arctic Fox

Upgrade dependencies

* Fix bug when modifying _captureMediaIntent in MediaStoreViewModel.kt

* Apply Spotless

Co-authored-by: Nicole Borrelli <borrelli@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants