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

Commit 4e5bbc3e authored by Daichi Hirono's avatar Daichi Hirono Committed by Android (Google) Code Review
Browse files

Merge "Close MTP database when MtpServer's thread is terminated." into nyc-dev

parents 2204f0c4 fe259319
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -23,12 +23,14 @@ package android.mtp;
public class MtpServer implements Runnable {

    private long mNativeContext; // accessed by native methods
    private final MtpDatabase mDatabase;

    static {
        System.loadLibrary("media_jni");
    }

    public MtpServer(MtpDatabase database, boolean usePtp) {
        mDatabase = database;
        native_setup(database, usePtp);
        database.setServer(this);
    }
@@ -42,6 +44,7 @@ public class MtpServer implements Runnable {
    public void run() {
        native_run();
        native_cleanup();
        mDatabase.close();
    }

    public void sendObjectAdded(int handle) {