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

Commit dc33c354 authored by Myles Watson's avatar Myles Watson
Browse files

PBAP: Move notify to Authenticator.java

Bug: 73333333
Test: Connect to a carkit with PBAP, runtest bluetooth
Change-Id: I0f619b6bb012b2362bcb5c5fe0910aede30406b2
parent b76aa0c4
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();
            }
        }
    }