Loading android/app/src/com/android/bluetooth/pbapclient/Authenticator.java +8 −7 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.util.Log; public class Authenticator extends AbstractAccountAuthenticator { private static final String TAG = "PbapAuthenticator"; private static final boolean DBG = Utils.DBG; public Authenticator(Context context) { super(context); Loading @@ -34,7 +35,7 @@ public class Authenticator extends AbstractAccountAuthenticator { // Editing properties is not supported @Override public Bundle editProperties(AccountAuthenticatorResponse r, String s) { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); throw new UnsupportedOperationException(); } Loading @@ -42,7 +43,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle addAccount(AccountAuthenticatorResponse r, String s, String s2, String[] strings, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); // Don't allow accounts to be added. throw new UnsupportedOperationException(); } Loading @@ -51,7 +52,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle confirmCredentials(AccountAuthenticatorResponse r, Account account, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); return null; } Loading @@ -59,14 +60,14 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle getAuthToken(AccountAuthenticatorResponse r, Account account, String s, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); throw new UnsupportedOperationException(); } // Getting a label for the auth token is not supported @Override public String getAuthTokenLabel(String s) { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); return null; } Loading @@ -74,7 +75,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle updateCredentials(AccountAuthenticatorResponse r, Account account, String s, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); return null; } Loading @@ -82,7 +83,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle hasFeatures(AccountAuthenticatorResponse r, Account account, String[] strings) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); final Bundle result = new Bundle(); result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false); Loading android/app/src/com/android/bluetooth/pbapclient/BluetoothPbapObexAuthenticator.java +9 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ import javax.obex.PasswordAuthentication; class BluetoothPbapObexAuthenticator implements Authenticator { private static final String TAG = "BluetoothPbapObexAuthenticator"; private static final String TAG = "BtPbapObexAuthenticator"; private static final boolean DBG = Utils.DBG; //Default session key for legacy devices is 0000 private String mSessionKey = "0000"; Loading @@ -45,13 +46,16 @@ class BluetoothPbapObexAuthenticator implements Authenticator { public PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess) { PasswordAuthentication pa = null; Log.v(TAG, "onAuthenticationChallenge: starting"); if (DBG) Log.v(TAG, "onAuthenticationChallenge: starting"); if (mSessionKey != null && mSessionKey.length() != 0) { Log.v(TAG, "onAuthenticationChallenge: mSessionKey=" + mSessionKey); if (DBG) Log.v(TAG, "onAuthenticationChallenge: mSessionKey=" + mSessionKey); pa = new PasswordAuthentication(null, mSessionKey.getBytes()); } else { Log.v(TAG, "onAuthenticationChallenge: mSessionKey is empty, timeout/cancel occured"); if (DBG) { Log.v(TAG, "onAuthenticationChallenge: mSessionKey is empty, timeout/cancel occured"); } } return pa; Loading @@ -59,7 +63,7 @@ class BluetoothPbapObexAuthenticator implements Authenticator { @Override public byte[] onAuthenticationResponse(byte[] userName) { Log.v(TAG, "onAuthenticationResponse: " + userName); if (DBG) Log.v(TAG, "onAuthenticationResponse: " + userName); /* required only in case PCE challenges PSE which we don't do now */ return null; } Loading android/app/src/com/android/bluetooth/pbapclient/BluetoothPbapRequest.java +6 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import javax.obex.ResponseCodes; abstract class BluetoothPbapRequest { private static final String TAG = "BluetoothPbapRequest"; private static final boolean DBG = Utils.DBG; protected static final byte OAP_TAGID_ORDER = 0x01; protected static final byte OAP_TAGID_SEARCH_VALUE = 0x02; Loading Loading @@ -58,7 +59,7 @@ abstract class BluetoothPbapRequest { } public void execute(ClientSession session) throws IOException { Log.v(TAG, "execute"); if (DBG) Log.v(TAG, "execute"); /* in case request is aborted before can be executed */ if (mAborted) { Loading Loading @@ -88,7 +89,7 @@ abstract class BluetoothPbapRequest { mResponseCode = mOp.getResponseCode(); Log.d(TAG, "mResponseCode=" + mResponseCode); if (DBG) Log.d(TAG, "mResponseCode=" + mResponseCode); checkResponseCode(mResponseCode); } catch (IOException e) { Loading @@ -112,19 +113,19 @@ abstract class BluetoothPbapRequest { } protected void readResponse(InputStream stream) throws IOException { Log.v(TAG, "readResponse"); if (DBG) Log.v(TAG, "readResponse"); /* nothing here by default */ } protected void readResponseHeaders(HeaderSet headerset) { Log.v(TAG, "readResponseHeaders"); if (DBG) Log.v(TAG, "readResponseHeaders"); /* nothing here by dafault */ } protected void checkResponseCode(int responseCode) throws IOException { Log.v(TAG, "checkResponseCode"); if (DBG) Log.v(TAG, "checkResponseCode"); /* nothing here by dafault */ } Loading android/app/src/com/android/bluetooth/pbapclient/BluetoothPbapRequestPullPhoneBook.java +4 −4 Original line number Diff line number Diff line Loading @@ -29,9 +29,9 @@ import javax.obex.HeaderSet; final class BluetoothPbapRequestPullPhoneBook extends BluetoothPbapRequest { private static final boolean VDBG = false; private static final boolean VDBG = Utils.VDBG; private static final String TAG = "BluetoothPbapRequestPullPhoneBook"; private static final String TAG = "BtPbapReqPullPhoneBook"; private static final String TYPE = "x-bt/phonebook"; Loading Loading @@ -93,7 +93,7 @@ final class BluetoothPbapRequestPullPhoneBook extends BluetoothPbapRequest { @Override protected void readResponse(InputStream stream) throws IOException { Log.v(TAG, "readResponse"); if (VDBG) Log.v(TAG, "readResponse"); mResponse = new BluetoothPbapVcardList(mAccount, stream, mFormat); if (VDBG) { Loading @@ -103,7 +103,7 @@ final class BluetoothPbapRequestPullPhoneBook extends BluetoothPbapRequest { @Override protected void readResponseHeaders(HeaderSet headerset) { Log.v(TAG, "readResponseHeaders"); if (VDBG) Log.v(TAG, "readResponseHeaders"); ObexAppParameters oap = ObexAppParameters.fromHeaderSet(headerset); Loading android/app/src/com/android/bluetooth/pbapclient/CallLogPullRequest.java +2 −2 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ import java.util.HashMap; import java.util.List; public class CallLogPullRequest extends PullRequest { private static final boolean DBG = true; private static final boolean VDBG = false; private static final boolean DBG = Utils.DBG; private static final boolean VDBG = Utils.VDBG; private static final String TAG = "PbapCallLogPullRequest"; private static final String TIMESTAMP_PROPERTY = "X-IRMC-CALL-DATETIME"; private static final String TIMESTAMP_FORMAT = "yyyyMMdd'T'HHmmss"; Loading Loading
android/app/src/com/android/bluetooth/pbapclient/Authenticator.java +8 −7 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.util.Log; public class Authenticator extends AbstractAccountAuthenticator { private static final String TAG = "PbapAuthenticator"; private static final boolean DBG = Utils.DBG; public Authenticator(Context context) { super(context); Loading @@ -34,7 +35,7 @@ public class Authenticator extends AbstractAccountAuthenticator { // Editing properties is not supported @Override public Bundle editProperties(AccountAuthenticatorResponse r, String s) { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); throw new UnsupportedOperationException(); } Loading @@ -42,7 +43,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle addAccount(AccountAuthenticatorResponse r, String s, String s2, String[] strings, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); // Don't allow accounts to be added. throw new UnsupportedOperationException(); } Loading @@ -51,7 +52,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle confirmCredentials(AccountAuthenticatorResponse r, Account account, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); return null; } Loading @@ -59,14 +60,14 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle getAuthToken(AccountAuthenticatorResponse r, Account account, String s, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); throw new UnsupportedOperationException(); } // Getting a label for the auth token is not supported @Override public String getAuthTokenLabel(String s) { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); return null; } Loading @@ -74,7 +75,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle updateCredentials(AccountAuthenticatorResponse r, Account account, String s, Bundle bundle) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); return null; } Loading @@ -82,7 +83,7 @@ public class Authenticator extends AbstractAccountAuthenticator { @Override public Bundle hasFeatures(AccountAuthenticatorResponse r, Account account, String[] strings) throws NetworkErrorException { Log.d(TAG, "got call", new Exception()); if (DBG) Log.d(TAG, "got call", new Exception()); final Bundle result = new Bundle(); result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false); Loading
android/app/src/com/android/bluetooth/pbapclient/BluetoothPbapObexAuthenticator.java +9 −5 Original line number Diff line number Diff line Loading @@ -30,7 +30,8 @@ import javax.obex.PasswordAuthentication; class BluetoothPbapObexAuthenticator implements Authenticator { private static final String TAG = "BluetoothPbapObexAuthenticator"; private static final String TAG = "BtPbapObexAuthenticator"; private static final boolean DBG = Utils.DBG; //Default session key for legacy devices is 0000 private String mSessionKey = "0000"; Loading @@ -45,13 +46,16 @@ class BluetoothPbapObexAuthenticator implements Authenticator { public PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess) { PasswordAuthentication pa = null; Log.v(TAG, "onAuthenticationChallenge: starting"); if (DBG) Log.v(TAG, "onAuthenticationChallenge: starting"); if (mSessionKey != null && mSessionKey.length() != 0) { Log.v(TAG, "onAuthenticationChallenge: mSessionKey=" + mSessionKey); if (DBG) Log.v(TAG, "onAuthenticationChallenge: mSessionKey=" + mSessionKey); pa = new PasswordAuthentication(null, mSessionKey.getBytes()); } else { Log.v(TAG, "onAuthenticationChallenge: mSessionKey is empty, timeout/cancel occured"); if (DBG) { Log.v(TAG, "onAuthenticationChallenge: mSessionKey is empty, timeout/cancel occured"); } } return pa; Loading @@ -59,7 +63,7 @@ class BluetoothPbapObexAuthenticator implements Authenticator { @Override public byte[] onAuthenticationResponse(byte[] userName) { Log.v(TAG, "onAuthenticationResponse: " + userName); if (DBG) Log.v(TAG, "onAuthenticationResponse: " + userName); /* required only in case PCE challenges PSE which we don't do now */ return null; } Loading
android/app/src/com/android/bluetooth/pbapclient/BluetoothPbapRequest.java +6 −5 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import javax.obex.ResponseCodes; abstract class BluetoothPbapRequest { private static final String TAG = "BluetoothPbapRequest"; private static final boolean DBG = Utils.DBG; protected static final byte OAP_TAGID_ORDER = 0x01; protected static final byte OAP_TAGID_SEARCH_VALUE = 0x02; Loading Loading @@ -58,7 +59,7 @@ abstract class BluetoothPbapRequest { } public void execute(ClientSession session) throws IOException { Log.v(TAG, "execute"); if (DBG) Log.v(TAG, "execute"); /* in case request is aborted before can be executed */ if (mAborted) { Loading Loading @@ -88,7 +89,7 @@ abstract class BluetoothPbapRequest { mResponseCode = mOp.getResponseCode(); Log.d(TAG, "mResponseCode=" + mResponseCode); if (DBG) Log.d(TAG, "mResponseCode=" + mResponseCode); checkResponseCode(mResponseCode); } catch (IOException e) { Loading @@ -112,19 +113,19 @@ abstract class BluetoothPbapRequest { } protected void readResponse(InputStream stream) throws IOException { Log.v(TAG, "readResponse"); if (DBG) Log.v(TAG, "readResponse"); /* nothing here by default */ } protected void readResponseHeaders(HeaderSet headerset) { Log.v(TAG, "readResponseHeaders"); if (DBG) Log.v(TAG, "readResponseHeaders"); /* nothing here by dafault */ } protected void checkResponseCode(int responseCode) throws IOException { Log.v(TAG, "checkResponseCode"); if (DBG) Log.v(TAG, "checkResponseCode"); /* nothing here by dafault */ } Loading
android/app/src/com/android/bluetooth/pbapclient/BluetoothPbapRequestPullPhoneBook.java +4 −4 Original line number Diff line number Diff line Loading @@ -29,9 +29,9 @@ import javax.obex.HeaderSet; final class BluetoothPbapRequestPullPhoneBook extends BluetoothPbapRequest { private static final boolean VDBG = false; private static final boolean VDBG = Utils.VDBG; private static final String TAG = "BluetoothPbapRequestPullPhoneBook"; private static final String TAG = "BtPbapReqPullPhoneBook"; private static final String TYPE = "x-bt/phonebook"; Loading Loading @@ -93,7 +93,7 @@ final class BluetoothPbapRequestPullPhoneBook extends BluetoothPbapRequest { @Override protected void readResponse(InputStream stream) throws IOException { Log.v(TAG, "readResponse"); if (VDBG) Log.v(TAG, "readResponse"); mResponse = new BluetoothPbapVcardList(mAccount, stream, mFormat); if (VDBG) { Loading @@ -103,7 +103,7 @@ final class BluetoothPbapRequestPullPhoneBook extends BluetoothPbapRequest { @Override protected void readResponseHeaders(HeaderSet headerset) { Log.v(TAG, "readResponseHeaders"); if (VDBG) Log.v(TAG, "readResponseHeaders"); ObexAppParameters oap = ObexAppParameters.fromHeaderSet(headerset); Loading
android/app/src/com/android/bluetooth/pbapclient/CallLogPullRequest.java +2 −2 Original line number Diff line number Diff line Loading @@ -37,8 +37,8 @@ import java.util.HashMap; import java.util.List; public class CallLogPullRequest extends PullRequest { private static final boolean DBG = true; private static final boolean VDBG = false; private static final boolean DBG = Utils.DBG; private static final boolean VDBG = Utils.VDBG; private static final String TAG = "PbapCallLogPullRequest"; private static final String TIMESTAMP_PROPERTY = "X-IRMC-CALL-DATETIME"; private static final String TIMESTAMP_FORMAT = "yyyyMMdd'T'HHmmss"; Loading