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

Commit 32559e19 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Decorate AssetFileDescriptor with Closeable.

Change-Id: I1f5f462b781a6e8fad77337006febd9c54694c0b
parent 8929bae7
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();
    }