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

Commit c97022e7 authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am 11473332: Merge "MtpServer: Do not attempt to stop MTP if it has not been...

am 11473332: Merge "MtpServer: Do not attempt to stop MTP if it has not been started" into honeycomb-mr1

* commit '11473332':
  MtpServer: Do not attempt to stop MTP if it has not been started
parents 45026366 11473332
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ import android.util.Log;
 */
public class MtpServer {

    private final Object mLock = new Object();
    private boolean mStarted;

    private static final String TAG = "MtpServer";

    static {
@@ -35,11 +38,19 @@ public class MtpServer {
    }

    public void start() {
        synchronized (mLock) {
            native_start();
            mStarted = true;
        }
    }

    public void stop() {
        synchronized (mLock) {
            if (mStarted) {
                native_stop();
                mStarted = false;
            }
        }
    }

    public void sendObjectAdded(int handle) {