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

Commit 6e354f7e authored by Kihong Seong's avatar Kihong Seong
Browse files

Add tests for handle methods in BluetoothMapContentObserver

Bug: 237467631
Test: atest BluetoothInstrumentationTests
Change-Id: Ib427f8bed4a1b819908ac3fdf1c7667d9c51e1c2
parent b58532a9
Loading
Loading
Loading
Loading
+16 −8
Original line number Original line Diff line number Diff line
@@ -142,17 +142,20 @@ public class BluetoothMapContentObserver {
    private int mMasId;
    private int mMasId;
    private boolean mEnableSmsMms = false;
    private boolean mEnableSmsMms = false;
    private boolean mObserverRegistered = false;
    private boolean mObserverRegistered = false;
    private BluetoothMapAccountItem mAccount;
    @VisibleForTesting
    BluetoothMapAccountItem mAccount;
    private String mAuthority = null;
    private String mAuthority = null;


    // Default supported feature bit mask is 0x1f
    // Default supported feature bit mask is 0x1f
    private int mMapSupportedFeatures = BluetoothMapUtils.MAP_FEATURE_DEFAULT_BITMASK;
    private int mMapSupportedFeatures = BluetoothMapUtils.MAP_FEATURE_DEFAULT_BITMASK;
    // Default event report version is 1.0
    // Default event report version is 1.0
    private int mMapEventReportVersion = BluetoothMapUtils.MAP_EVENT_REPORT_V10;
    @VisibleForTesting
    int mMapEventReportVersion = BluetoothMapUtils.MAP_EVENT_REPORT_V10;


    private BluetoothMapFolderElement mFolders = new BluetoothMapFolderElement("DUMMY", null);
    private BluetoothMapFolderElement mFolders = new BluetoothMapFolderElement("DUMMY", null);
    // Will be set by the MAS when generated.
    // Will be set by the MAS when generated.
    private Uri mMessageUri = null;
    @VisibleForTesting
    Uri mMessageUri = null;
    @VisibleForTesting
    @VisibleForTesting
    Uri mContactUri = null;
    Uri mContactUri = null;


@@ -1573,7 +1576,8 @@ public class BluetoothMapContentObserver {
        }
        }
    }
    }


    private void handleMsgListChangesMms() {
    @VisibleForTesting
    void handleMsgListChangesMms() {
        if (V) {
        if (V) {
            Log.d(TAG, "handleMsgListChangesMms");
            Log.d(TAG, "handleMsgListChangesMms");
        }
        }
@@ -1583,9 +1587,11 @@ public class BluetoothMapContentObserver {
        Cursor c;
        Cursor c;
        synchronized (getMsgListMms()) {
        synchronized (getMsgListMms()) {
            if (mMapEventReportVersion == BluetoothMapUtils.MAP_EVENT_REPORT_V10) {
            if (mMapEventReportVersion == BluetoothMapUtils.MAP_EVENT_REPORT_V10) {
                c = mResolver.query(Mms.CONTENT_URI, MMS_PROJECTION_SHORT, null, null, null);
                c = BluetoothMethodProxy.getInstance().contentResolverQuery(mResolver,
                        Mms.CONTENT_URI, MMS_PROJECTION_SHORT, null, null, null);
            } else {
            } else {
                c = mResolver.query(Mms.CONTENT_URI, MMS_PROJECTION_SHORT_EXT, null, null, null);
                c = BluetoothMethodProxy.getInstance().contentResolverQuery(mResolver,
                        Mms.CONTENT_URI, MMS_PROJECTION_SHORT_EXT, null, null, null);
            }
            }


            try {
            try {
@@ -1741,7 +1747,8 @@ public class BluetoothMapContentObserver {
        }
        }
    }
    }


    private void handleMsgListChangesMsg(Uri uri) throws RemoteException {
    @VisibleForTesting
    void handleMsgListChangesMsg(Uri uri) throws RemoteException {
        if (V) {
        if (V) {
            Log.v(TAG, "handleMsgListChangesMsg uri: " + uri.toString());
            Log.v(TAG, "handleMsgListChangesMsg uri: " + uri.toString());
        }
        }
@@ -1854,7 +1861,8 @@ public class BluetoothMapContentObserver {
                                        && sentFolder.getFolderId() == folderId
                                        && sentFolder.getFolderId() == folderId
                                        && msg.localInitiatedSend) {
                                        && msg.localInitiatedSend) {
                                    if (msg.transparent) {
                                    if (msg.transparent) {
                                        mResolver.delete(
                                        BluetoothMethodProxy.getInstance().contentResolverDelete(
                                                mResolver,
                                                ContentUris.withAppendedId(mMessageUri, id), null,
                                                ContentUris.withAppendedId(mMessageUri, id), null,
                                                null);
                                                null);
                                    } else {
                                    } else {
+516 −58

File changed.

Preview size limit exceeded, changes collapsed.