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

Skip to content
Commit 8280c2b1 authored by Daisuke Miyakawa's avatar Daisuke Miyakawa
Browse files

Implement new MockContentProvider. Also make ContentProvider aware of the class.

Rename the old MockContentProvider to MockIContentProvider since it is
more appropriate name.

Detail:
Current developers inevitably depend on the backend used by ContentProvider,
which is useful but not ideal nor "testable" from the view of them.

Current MockContentResolver only accepts exact "ContentProvider" class, not
IContentProvider interface, since we want to hide "IContentProvider" while
the old MockContentProvider implements IContentProvider and as a result some
methods we want to hide may be exposed to the public SDK now and probably
for the future.

On the other hand, ContentProvider is not interface but an exact class
heavily depends on the internal logic and not suitable for external
developers to use for tests.

The new MockContentProvider introduces the mock implementation
for ContentProvider.
It extends ContentProvider, so "is" ContentProvider, but tries to avoid
depending on any backend System like IPC in Android, etc.
This should be useful from the view of application developers who do not
want to be confused with ContentProvider/ContentResolver backend
implementation "at all" and want to use MockContentResolver without
any other ContentProvider implementations tightly connected to the
external worlds.
parent 3077f7df
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment