Loading android/app/src/com/android/bluetooth/pbapclient/PbapClientStateMachine.java +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ class PbapClientStateMachine extends StateMachine { static final int CONNECT_TIMEOUT = 10000; static final int DISCONNECT_TIMEOUT = 3000; private static final int LOCAL_SUPPORTED_FEATURES = PbapSdpRecord.FEATURE_DEFAULT_IMAGE_FORMAT | PbapSdpRecord.FEATURE_DOWNLOADING; private final Object mLock; private State mDisconnected; private State mConnecting; Loading Loading @@ -168,6 +171,7 @@ class PbapClientStateMachine extends StateMachine { mConnectionHandler = new PbapClientConnectionHandler.Builder() .setLooper(looper) .setLocalSupportedFeatures(LOCAL_SUPPORTED_FEATURES) .setContext(mService) .setClientSM(PbapClientStateMachine.this) .setRemoteDevice(mCurrentDevice) Loading android/app/src/com/android/bluetooth/pbapclient/obex/PbapClientConnectionHandler.java +9 −4 Original line number Diff line number Diff line Loading @@ -85,13 +85,11 @@ class PbapClientConnectionHandler extends Handler { 0x66 }; private static final int PBAP_SUPPORTED_FEATURES = PbapSdpRecord.FEATURE_DEFAULT_IMAGE_FORMAT | PbapSdpRecord.FEATURE_DOWNLOADING; private Account mAccount; private AccountManager mAccountManager; private BluetoothSocket mSocket; private final BluetoothDevice mDevice; private final int mLocalSupportedFeatures; // PSE SDP Record for current device. private PbapSdpRecord mPseRec = null; private ClientSession mObexSession; Loading @@ -108,6 +106,7 @@ class PbapClientConnectionHandler extends Handler { PbapClientConnectionHandler(Builder pceHandlerbuild) { super(pceHandlerbuild.mLooper); mDevice = pceHandlerbuild.mDevice; mLocalSupportedFeatures = pceHandlerbuild.mLocalSupportedFeatures; mContext = pceHandlerbuild.mContext; mPbapClientStateMachine = pceHandlerbuild.mClientStateMachine; mAuth = new PbapClientObexAuthenticator(); Loading @@ -123,6 +122,7 @@ class PbapClientConnectionHandler extends Handler { private Looper mLooper; private Context mContext; private BluetoothDevice mDevice; private int mLocalSupportedFeatures; private PbapClientStateMachine mClientStateMachine; public Builder setLooper(Looper loop) { Loading @@ -130,6 +130,11 @@ class PbapClientConnectionHandler extends Handler { return this; } public Builder setLocalSupportedFeatures(int features) { this.mLocalSupportedFeatures = features; return this; } public Builder setClientSM(PbapClientStateMachine clientStateMachine) { this.mClientStateMachine = clientStateMachine; return this; Loading Loading @@ -295,7 +300,7 @@ class PbapClientConnectionHandler extends Handler { if (mPseRec.getProfileVersion() >= PbapSdpRecord.VERSION_1_2) { oap.add( PbapApplicationParameters.OAP_PBAP_SUPPORTED_FEATURES, PBAP_SUPPORTED_FEATURES); mLocalSupportedFeatures); } oap.addToHeaderSet(connectionRequest); Loading android/app/tests/unit/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandlerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,10 @@ public class PbapClientConnectionHandlerTest { private static final String TAG = "ConnHandlerTest"; private static final String REMOTE_DEVICE_ADDRESS = "00:00:00:00:00:00"; // Normal supported features for our client private static final int SUPPORTED_FEATURES = PbapSdpRecord.FEATURE_DOWNLOADING | PbapSdpRecord.FEATURE_DEFAULT_IMAGE_FORMAT; private HandlerThread mThread; private Looper mLooper; private Context mTargetContext; Loading Loading @@ -103,6 +107,7 @@ public class PbapClientConnectionHandlerTest { mHandler = new PbapClientConnectionHandler.Builder() .setLooper(mLooper) .setLocalSupportedFeatures(SUPPORTED_FEATURES) .setClientSM(mStateMachine) .setContext(mTargetContext) .setRemoteDevice(mRemoteDevice) Loading Loading
android/app/src/com/android/bluetooth/pbapclient/PbapClientStateMachine.java +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ class PbapClientStateMachine extends StateMachine { static final int CONNECT_TIMEOUT = 10000; static final int DISCONNECT_TIMEOUT = 3000; private static final int LOCAL_SUPPORTED_FEATURES = PbapSdpRecord.FEATURE_DEFAULT_IMAGE_FORMAT | PbapSdpRecord.FEATURE_DOWNLOADING; private final Object mLock; private State mDisconnected; private State mConnecting; Loading Loading @@ -168,6 +171,7 @@ class PbapClientStateMachine extends StateMachine { mConnectionHandler = new PbapClientConnectionHandler.Builder() .setLooper(looper) .setLocalSupportedFeatures(LOCAL_SUPPORTED_FEATURES) .setContext(mService) .setClientSM(PbapClientStateMachine.this) .setRemoteDevice(mCurrentDevice) Loading
android/app/src/com/android/bluetooth/pbapclient/obex/PbapClientConnectionHandler.java +9 −4 Original line number Diff line number Diff line Loading @@ -85,13 +85,11 @@ class PbapClientConnectionHandler extends Handler { 0x66 }; private static final int PBAP_SUPPORTED_FEATURES = PbapSdpRecord.FEATURE_DEFAULT_IMAGE_FORMAT | PbapSdpRecord.FEATURE_DOWNLOADING; private Account mAccount; private AccountManager mAccountManager; private BluetoothSocket mSocket; private final BluetoothDevice mDevice; private final int mLocalSupportedFeatures; // PSE SDP Record for current device. private PbapSdpRecord mPseRec = null; private ClientSession mObexSession; Loading @@ -108,6 +106,7 @@ class PbapClientConnectionHandler extends Handler { PbapClientConnectionHandler(Builder pceHandlerbuild) { super(pceHandlerbuild.mLooper); mDevice = pceHandlerbuild.mDevice; mLocalSupportedFeatures = pceHandlerbuild.mLocalSupportedFeatures; mContext = pceHandlerbuild.mContext; mPbapClientStateMachine = pceHandlerbuild.mClientStateMachine; mAuth = new PbapClientObexAuthenticator(); Loading @@ -123,6 +122,7 @@ class PbapClientConnectionHandler extends Handler { private Looper mLooper; private Context mContext; private BluetoothDevice mDevice; private int mLocalSupportedFeatures; private PbapClientStateMachine mClientStateMachine; public Builder setLooper(Looper loop) { Loading @@ -130,6 +130,11 @@ class PbapClientConnectionHandler extends Handler { return this; } public Builder setLocalSupportedFeatures(int features) { this.mLocalSupportedFeatures = features; return this; } public Builder setClientSM(PbapClientStateMachine clientStateMachine) { this.mClientStateMachine = clientStateMachine; return this; Loading Loading @@ -295,7 +300,7 @@ class PbapClientConnectionHandler extends Handler { if (mPseRec.getProfileVersion() >= PbapSdpRecord.VERSION_1_2) { oap.add( PbapApplicationParameters.OAP_PBAP_SUPPORTED_FEATURES, PBAP_SUPPORTED_FEATURES); mLocalSupportedFeatures); } oap.addToHeaderSet(connectionRequest); Loading
android/app/tests/unit/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandlerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,10 @@ public class PbapClientConnectionHandlerTest { private static final String TAG = "ConnHandlerTest"; private static final String REMOTE_DEVICE_ADDRESS = "00:00:00:00:00:00"; // Normal supported features for our client private static final int SUPPORTED_FEATURES = PbapSdpRecord.FEATURE_DOWNLOADING | PbapSdpRecord.FEATURE_DEFAULT_IMAGE_FORMAT; private HandlerThread mThread; private Looper mLooper; private Context mTargetContext; Loading Loading @@ -103,6 +107,7 @@ public class PbapClientConnectionHandlerTest { mHandler = new PbapClientConnectionHandler.Builder() .setLooper(mLooper) .setLocalSupportedFeatures(SUPPORTED_FEATURES) .setClientSM(mStateMachine) .setContext(mTargetContext) .setRemoteDevice(mRemoteDevice) Loading