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

Commit ad4a6499 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "PBAP: Move notify to Authenticator.java"

parents b6e93e1d dc33c354
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -58,10 +58,12 @@ public class BluetoothPbapAuthenticator implements Authenticator {

    final synchronized void setChallenged(final boolean bool) {
        mChallenged = bool;
        notify();
    }

    final synchronized void setCancelled(final boolean bool) {
        mAuthCancelled = bool;
        notify();
    }

    final synchronized void setSessionKey(final String string) {
@@ -77,7 +79,7 @@ public class BluetoothPbapAuthenticator implements Authenticator {
                try {
                    wait();
                } catch (InterruptedException e) {
                    Log.e(TAG, "Interrupted while waiting on isChalled");
                    Log.e(TAG, "Interrupted while waiting on isChallenged or AuthCancelled");
                }
            }
        }
+6 −12
Original line number Diff line number Diff line
@@ -323,21 +323,15 @@ class PbapStateMachine extends StateMachine {
            nm.cancel(id);
        }

        private void notifyAuthCancelled() {
            synchronized (this) {
        private synchronized void notifyAuthCancelled() {
            mObexAuth.setCancelled(true);
                mObexAuth.notify();
            }
        }

        private void notifyAuthKeyInput(final String key) {
            synchronized (this) {
        private synchronized void notifyAuthKeyInput(final String key) {
            if (key != null) {
                mObexAuth.setSessionKey(key);
            }
            mObexAuth.setChallenged(true);
                mObexAuth.notify();
            }
        }
    }