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

Commit 7ba663b2 authored by Pradeep Panigrahi's avatar Pradeep Panigrahi Committed by Android Git Automerger
Browse files

am 230acbc1: am 2b70c786: Acquire the full wakelock only during user confirmation request

* commit '230acbc1':
  Acquire the full wakelock only during user confirmation request
parents aba39f23 230acbc1
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -116,9 +116,7 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen
     * Called when connection is accepted from remote, to retrieve the first
     * Called when connection is accepted from remote, to retrieve the first
     * Header then wait for user confirmation
     * Header then wait for user confirmation
     */
     */
    public void preStart() {
    public void preStart(Handler handler) {
        if (D) Log.d(TAG, "acquire full WakeLock");
        mWakeLock.acquire();
        try {
        try {
            if (D) Log.d(TAG, "Create ServerSession with transport " + mTransport.toString());
            if (D) Log.d(TAG, "Create ServerSession with transport " + mTransport.toString());
            mSession = new ServerSession(mTransport, this, null);
            mSession = new ServerSession(mTransport, this, null);
@@ -298,6 +296,9 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen
        mLocalShareInfoId = Integer.parseInt(contentUri.getPathSegments().get(1));
        mLocalShareInfoId = Integer.parseInt(contentUri.getPathSegments().get(1));


        if (needConfirm) {
        if (needConfirm) {
            if (V) Log.d(TAG, "acquire full WakeLock");
            mWakeLock.acquire();

            Intent in = new Intent(BluetoothShare.INCOMING_FILE_CONFIRMATION_REQUEST_ACTION);
            Intent in = new Intent(BluetoothShare.INCOMING_FILE_CONFIRMATION_REQUEST_ACTION);
            in.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
            in.setClassName(Constants.THIS_PACKAGE_NAME, BluetoothOppReceiver.class.getName());
            mContext.sendBroadcast(in);
            mContext.sendBroadcast(in);
@@ -306,11 +307,9 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen
        if (V) Log.v(TAG, "insert contentUri: " + contentUri);
        if (V) Log.v(TAG, "insert contentUri: " + contentUri);
        if (V) Log.v(TAG, "mLocalShareInfoId = " + mLocalShareInfoId);
        if (V) Log.v(TAG, "mLocalShareInfoId = " + mLocalShareInfoId);


        if (V) Log.v(TAG, "acquire partial WakeLock");


        synchronized (this) {
        synchronized (this) {
            if (mWakeLock.isHeld()) {
            if (mWakeLock.isHeld()) {
                if (V) Log.v(TAG, "acquire partial WakeLock");
                mPartialWakeLock.acquire();
                mPartialWakeLock.acquire();
                mWakeLock.release();
                mWakeLock.release();
            }
            }