Merge "Shuffle FD ownership? \noideadog"
This commit is contained in:
@@ -2418,10 +2418,12 @@ class PackageManagerShellCommand extends ShellCommand {
|
|||||||
|
|
||||||
private int doWriteSplit(int sessionId, String inPath, long sizeBytes, String splitName,
|
private int doWriteSplit(int sessionId, String inPath, long sizeBytes, String splitName,
|
||||||
boolean logSuccess) throws RemoteException {
|
boolean logSuccess) throws RemoteException {
|
||||||
|
PackageInstaller.Session session = null;
|
||||||
|
try {
|
||||||
final PrintWriter pw = getOutPrintWriter();
|
final PrintWriter pw = getOutPrintWriter();
|
||||||
final ParcelFileDescriptor fd;
|
final ParcelFileDescriptor fd;
|
||||||
if (STDIN_PATH.equals(inPath)) {
|
if (STDIN_PATH.equals(inPath)) {
|
||||||
fd = new ParcelFileDescriptor(getInFileDescriptor());
|
fd = ParcelFileDescriptor.dup(getInFileDescriptor());
|
||||||
} else if (inPath != null) {
|
} else if (inPath != null) {
|
||||||
fd = openFileForSystem(inPath, "r");
|
fd = openFileForSystem(inPath, "r");
|
||||||
if (fd == null) {
|
if (fd == null) {
|
||||||
@@ -2433,15 +2435,13 @@ class PackageManagerShellCommand extends ShellCommand {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fd = new ParcelFileDescriptor(getInFileDescriptor());
|
fd = ParcelFileDescriptor.dup(getInFileDescriptor());
|
||||||
}
|
}
|
||||||
if (sizeBytes <= 0) {
|
if (sizeBytes <= 0) {
|
||||||
getErrPrintWriter().println("Error: must specify a APK size");
|
getErrPrintWriter().println("Error: must specify a APK size");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageInstaller.Session session = null;
|
|
||||||
try {
|
|
||||||
session = new PackageInstaller.Session(
|
session = new PackageInstaller.Session(
|
||||||
mInterface.getPackageInstaller().openSession(sessionId));
|
mInterface.getPackageInstaller().openSession(sessionId));
|
||||||
session.write(splitName, 0, sizeBytes, fd);
|
session.write(splitName, 0, sizeBytes, fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user