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

Commit cfad3856 authored by Sal Savage's avatar Sal Savage
Browse files

Move OBEX related objects to an OBEX folder and change name scheme

This change restructures our folder heirarchy to have an obex/ folder to
contain the related OBEX request and data objects. It also contains the
OBEX client abstraction in it that the state machine uses to issue OBEX
requests.

Bug: 365626536
Flag: EXEMPT, name changes and file movement only
Test: atest com.android.bluetooth.pbapclient
Test: m com.android.btservices
Change-Id: I2bbb0329a184ebb979599d63c849397c917a663f
parent 128e7204
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@
        errorLine1="                SimpleDateFormat parser = new SimpleDateFormat(TIMESTAMP_FORMAT);"
        errorLine2="                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/pbapclient/CallLogPullRequest.java"
            file="packages/modules/Bluetooth/android/app/src/com/android/bluetooth/pbapclient/obex/CallLogPullRequest.java"
            line="105"
            column="43"/>
    </issue>
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ import java.util.List;
import java.util.Map;

public class CallLogPullRequest extends PullRequest {
    private static final String TAG = "CallLogPullRequest";
    private static final String TAG = CallLogPullRequest.class.getSimpleName();

    @VisibleForTesting static final String TIMESTAMP_PROPERTY = "X-IRMC-CALL-DATETIME";
    private static final String TIMESTAMP_FORMAT = "yyyyMMdd'T'HHmmss";
+10 −10
Original line number Diff line number Diff line
@@ -140,21 +140,21 @@ class PbapClientConnectionHandler extends Handler {
    private SdpPseRecord mPseRec = null;
    private ClientSession mObexSession;
    private Context mContext;
    private BluetoothPbapObexAuthenticator mAuth = null;
    private PbapClientObexAuthenticator mAuth = null;
    private final PbapClientStateMachine mPbapClientStateMachine;
    private boolean mAccountCreated;

    /**
     * Constructs PCEConnectionHandler object
     *
     * @param pceHandlerbuild To build BluetoothPbapClientHandler Instance.
     * @param pceHandlerbuild To build PbapClientConnectionHandler Instance.
     */
    PbapClientConnectionHandler(Builder pceHandlerbuild) {
        super(pceHandlerbuild.mLooper);
        mDevice = pceHandlerbuild.mDevice;
        mContext = pceHandlerbuild.mContext;
        mPbapClientStateMachine = pceHandlerbuild.mClientStateMachine;
        mAuth = new BluetoothPbapObexAuthenticator();
        mAuth = new PbapClientObexAuthenticator();
        mAccountManager = AccountManager.get(mPbapClientStateMachine.getContext());
        mAccount =
                new Account(
@@ -334,7 +334,7 @@ class PbapClientConnectionHandler extends Handler {

                if (mPseRec.getProfileVersion() >= PBAP_V1_2) {
                    oap.add(
                            BluetoothPbapRequest.OAP_TAGID_PBAP_SUPPORTED_FEATURES,
                            PbapClientRequest.OAP_TAGID_PBAP_SUPPORTED_FEATURES,
                            PBAP_SUPPORTED_FEATURE);
                }

@@ -382,8 +382,8 @@ class PbapClientConnectionHandler extends Handler {
                    new PhonebookPullRequest(mPbapClientStateMachine.getContext());

            // Download contacts in batches of size DEFAULT_BATCH_SIZE
            BluetoothPbapRequestPullPhoneBookSize requestPbSize =
                    new BluetoothPbapRequestPullPhoneBookSize(path, PBAP_REQUESTED_FIELDS);
            RequestPullPhoneBookSize requestPbSize =
                    new RequestPullPhoneBookSize(path, PBAP_REQUESTED_FIELDS);
            requestPbSize.execute(mObexSession);

            int numberOfContactsRemaining = requestPbSize.getSize();
@@ -402,8 +402,8 @@ class PbapClientConnectionHandler extends Handler {
                        Math.min(
                                Math.min(DEFAULT_BATCH_SIZE, numberOfContactsRemaining),
                                UPPER_LIMIT - startOffset + 1);
                BluetoothPbapRequestPullPhoneBook request =
                        new BluetoothPbapRequestPullPhoneBook(
                RequestPullPhoneBook request =
                        new RequestPullPhoneBook(
                                path,
                                mAccount,
                                PBAP_REQUESTED_FIELDS,
@@ -437,8 +437,8 @@ class PbapClientConnectionHandler extends Handler {
    @VisibleForTesting
    void downloadCallLog(String path, Map<String, Integer> callCounter) {
        try {
            BluetoothPbapRequestPullPhoneBook request =
                    new BluetoothPbapRequestPullPhoneBook(path, mAccount, 0, VCARD_TYPE_30, 0, 0);
            RequestPullPhoneBook request =
                    new RequestPullPhoneBook(path, mAccount, 0, VCARD_TYPE_30, 0, 0);
            request.execute(mObexSession);
            CallLogPullRequest processor =
                    new CallLogPullRequest(
+2 −2
Original line number Diff line number Diff line
@@ -28,8 +28,8 @@ import java.util.Arrays;
 * with PSE devices prior to PBAP 1.2. With profiles prior to 1.2 the actual initiation of
 * authentication is implementation defined.
 */
class BluetoothPbapObexAuthenticator implements Authenticator {
    private static final String TAG = "PbapClientObexAuth";
class PbapClientObexAuthenticator implements Authenticator {
    private static final String TAG = PbapClientObexAuthenticator.class.getSimpleName();

    // Default session key for legacy devices is 0000
    @VisibleForTesting String mSessionKey = "0000";
+3 −3
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ import com.android.obex.ResponseCodes;
import java.io.IOException;
import java.io.InputStream;

abstract class BluetoothPbapRequest {
    static final String TAG = "PbapClient.BaseRequest";
abstract class PbapClientRequest {
    static final String TAG = PbapClientRequest.class.getSimpleName();

    protected static final byte OAP_TAGID_ORDER = 0x01;
    protected static final byte OAP_TAGID_SEARCH_VALUE = 0x02;
@@ -48,7 +48,7 @@ abstract class BluetoothPbapRequest {

    private ClientOperation mOp = null;

    BluetoothPbapRequest() {
    PbapClientRequest() {
        mHeaderSet = new HeaderSet();
    }

Loading