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

Commit b9821292 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Decorate AssetFileDescriptor with Closeable."

parents cc87e73a 32559e19
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7167,7 +7167,7 @@ package android.content.pm {
package android.content.res {
  public class AssetFileDescriptor implements android.os.Parcelable {
  public class AssetFileDescriptor implements java.io.Closeable android.os.Parcelable {
    ctor public AssetFileDescriptor(android.os.ParcelFileDescriptor, long, long);
    method public void close() throws java.io.IOException;
    method public java.io.FileInputStream createInputStream() throws java.io.IOException;
+3 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable;

import java.io.Closeable;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -30,7 +31,7 @@ import java.io.IOException;
 * opened FileDescriptor that can be used to read the data, as well as the
 * offset and length of that entry's data in the file.
 */
public class AssetFileDescriptor implements Parcelable {
public class AssetFileDescriptor implements Parcelable, Closeable {
    /**
     * Length used with {@link #AssetFileDescriptor(ParcelFileDescriptor, long, long)}
     * and {@link #getDeclaredLength} when a length has not been declared.  This means
@@ -122,6 +123,7 @@ public class AssetFileDescriptor implements Parcelable {
    /**
     * Convenience for calling <code>getParcelFileDescriptor().close()</code>.
     */
    @Override
    public void close() throws IOException {
        mFd.close();
    }