Merge "FileBridge needs to keep strong reference to PFD." into lmp-dev
This commit is contained in:
@@ -623,7 +623,7 @@ public class PackageInstaller {
|
||||
try {
|
||||
final ParcelFileDescriptor clientSocket = mSession.openWrite(name,
|
||||
offsetBytes, lengthBytes);
|
||||
return new FileBridge.FileBridgeOutputStream(clientSocket.getFileDescriptor());
|
||||
return new FileBridge.FileBridgeOutputStream(clientSocket);
|
||||
} catch (RuntimeException e) {
|
||||
ExceptionUtils.maybeUnwrapIOException(e);
|
||||
throw e;
|
||||
|
||||
@@ -131,11 +131,13 @@ public class FileBridge extends Thread {
|
||||
}
|
||||
|
||||
public static class FileBridgeOutputStream extends OutputStream {
|
||||
private final ParcelFileDescriptor mClientPfd;
|
||||
private final FileDescriptor mClient;
|
||||
private final byte[] mTemp = new byte[MSG_LENGTH];
|
||||
|
||||
public FileBridgeOutputStream(FileDescriptor client) {
|
||||
mClient = client;
|
||||
public FileBridgeOutputStream(ParcelFileDescriptor clientPfd) {
|
||||
mClientPfd = clientPfd;
|
||||
mClient = clientPfd.getFileDescriptor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user