diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-08-20 15:20:04 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2013-08-23 11:27:25 -0700 |
commit | bd3b902567b09379e1b62c60b3319ad82102efad (patch) | |
tree | c179f95abfe89e2029e099c1dba50dcefc6dfe7b /tools/layoutlib | |
parent | b4f6a01d51612b9e50dffd95905e9c9add79b5d8 (diff) | |
download | frameworks_base-bd3b902567b09379e1b62c60b3319ad82102efad.zip frameworks_base-bd3b902567b09379e1b62c60b3319ad82102efad.tar.gz frameworks_base-bd3b902567b09379e1b62c60b3319ad82102efad.tar.bz2 |
Add CancellationSignal support to file operations.
Since ContentProvider file operations can end up doing substantial
network I/O before returning the file, allow clients to cancel their
file requests with CancellationSignal.
Ideally this would only be needed for openFile(), but ContentResolver
heavily relies on openAssetFile() and openTypedAssetFile() for common
cases.
Also improve documentation to mention reliable ParcelFileDescriptors
and encourage developers to move away from "rw" combination modes,
since they restrict provider flexibility. Mention more about places
where pipes or socket pairs could be returned.
Improve DocumentsContract documentation.
Bug: 10329944
Change-Id: I49b2825ea433eb051624c4da3b77612fe3ffc99c
Diffstat (limited to 'tools/layoutlib')
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java index 4aea38f..688cc87 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContentProvider.java @@ -81,14 +81,16 @@ public final class BridgeContentProvider implements IContentProvider { } @Override - public AssetFileDescriptor openAssetFile(String callingPackage, Uri arg0, String arg1) + public AssetFileDescriptor openAssetFile( + String callingPackage, Uri arg0, String arg1, ICancellationSignal signal) throws RemoteException, FileNotFoundException { // TODO Auto-generated method stub return null; } @Override - public ParcelFileDescriptor openFile(String callingPackage, Uri arg0, String arg1) + public ParcelFileDescriptor openFile( + String callingPackage, Uri arg0, String arg1, ICancellationSignal signal) throws RemoteException, FileNotFoundException { // TODO Auto-generated method stub return null; @@ -122,7 +124,7 @@ public final class BridgeContentProvider implements IContentProvider { @Override public AssetFileDescriptor openTypedAssetFile(String callingPackage, Uri arg0, String arg1, - Bundle arg2) throws RemoteException, FileNotFoundException { + Bundle arg2, ICancellationSignal signal) throws RemoteException, FileNotFoundException { // TODO Auto-generated method stub return null; } |