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

Commit 4589d4e1 authored by Sal Savage's avatar Sal Savage
Browse files

Downgrade exceptions to warns for tests

While the real implementation doesn't actually use the methods in this
change when in the new configuration, old tests has race conditions that
have bad interactions with the tests. Until those tests can be fixed, we
can downgrade these exceptions to warnings only. This will stop test
failures.

Flag: EXEMPT, test only fix
Bug: 381114027
Test: atest com.android.bluetooth.pbapclient.PbapClientServiceTest
Change-Id: I2d61f6885a06b95b018188d04917406e35acfa62
parent 53743c63
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -726,7 +726,7 @@ public class PbapClientService extends ProfileService {

    void cleanupDevice(BluetoothDevice device) {
        if (Flags.pbapClientStorageRefactor()) {
            throw new UnsupportedOperationException("This is not needed with contacts storage");
            Log.w(TAG, "This should not be used in this configuration");
        }

        Log.d(TAG, "Cleanup device: " + device);
@@ -746,7 +746,7 @@ public class PbapClientService extends ProfileService {
     */
    public boolean isAccountTypeReady() {
        if (Flags.pbapClientStorageRefactor()) {
            throw new UnsupportedOperationException("This is not needed with contacts storage");
            Log.w(TAG, "This should not be used in this configuration");
        }
        return mPbapClientAccountManager.isAccountTypeInitialized();
    }
@@ -758,6 +758,9 @@ public class PbapClientService extends ProfileService {
     * @return True if the account addition was successful, False otherwise
     */
    public boolean addAccount(Account account) {
        if (Flags.pbapClientStorageRefactor()) {
            Log.w(TAG, "This should not be used in this configuration");
        }
        return mPbapClientAccountManager.addAccount(account);
    }

@@ -768,6 +771,9 @@ public class PbapClientService extends ProfileService {
     * @return True if the account removal was successful, False otherwise
     */
    public boolean removeAccount(Account account) {
        if (Flags.pbapClientStorageRefactor()) {
            Log.w(TAG, "This should not be used in this configuration");
        }
        return mPbapClientAccountManager.removeAccount(account);
    }
}