Merge "Restricting DocumentsProvider#getType by implementing getTypeAnonymous" into udc-dev am: e990e9b660
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21669719 Change-Id: Iccc739b3f837ab0cced50b2f2d0ea6429337c2b2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
37893ac0b0
@@ -36889,6 +36889,7 @@ package android.provider {
|
|||||||
method public String[] getDocumentStreamTypes(String, String);
|
method public String[] getDocumentStreamTypes(String, String);
|
||||||
method public String getDocumentType(String) throws java.io.FileNotFoundException;
|
method public String getDocumentType(String) throws java.io.FileNotFoundException;
|
||||||
method public final String getType(android.net.Uri);
|
method public final String getType(android.net.Uri);
|
||||||
|
method @Nullable public final String getTypeAnonymous(@NonNull android.net.Uri);
|
||||||
method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
|
method public final android.net.Uri insert(android.net.Uri, android.content.ContentValues);
|
||||||
method public boolean isChildDocument(String, String);
|
method public boolean isChildDocument(String, String);
|
||||||
method public String moveDocument(String, String, String) throws java.io.FileNotFoundException;
|
method public String moveDocument(String, String, String) throws java.io.FileNotFoundException;
|
||||||
|
|||||||
@@ -978,6 +978,19 @@ public abstract class DocumentsProvider extends ContentProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An unrestricted version of getType, which does not reveal sensitive information
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public final @Nullable String getTypeAnonymous(@NonNull Uri uri) {
|
||||||
|
switch (mMatcher.match(uri)) {
|
||||||
|
case MATCH_ROOT:
|
||||||
|
return DocumentsContract.Root.MIME_TYPE_ITEM;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation is provided by the parent class. Can be overridden to
|
* Implementation is provided by the parent class. Can be overridden to
|
||||||
* provide additional functionality, but subclasses <em>must</em> always
|
* provide additional functionality, but subclasses <em>must</em> always
|
||||||
|
|||||||
Reference in New Issue
Block a user