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

Commit 256ec664 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Enable the Pbap Client authenticator"

parents dab680a3 002428ba
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -520,9 +520,12 @@
                <action android:name="android.bluetooth.IBluetoothPbapClient"/>
                <action android:name="android.bluetooth.IBluetoothPbapClient"/>
            </intent-filter>
            </intent-filter>
        </service>
        </service>
        <!--  Note: This service doesn't get started, it just indicates to the Authentication
              framework that we can create accounts of a specific type. As such, its safe to
              have as enabled on all targets and not just the ones that use PBAP Client  -->
        <service android:process="@string/process"
        <service android:process="@string/process"
             android:name="com.android.bluetooth.pbapclient.AuthenticationService"
             android:name="com.android.bluetooth.pbapclient.AuthenticationService"
             android:enabled="false"
             android:enabled="true"
             android:exported="true">
             android:exported="true">
            <intent-filter>
            <intent-filter>
                <action android:name="android.accounts.AccountAuthenticator"/>
                <action android:name="android.accounts.AccountAuthenticator"/>
+0 −9
Original line number Original line Diff line number Diff line
@@ -60,12 +60,6 @@ public class PbapClientService extends ProfileService {
    private static final String TAG = "PbapClientService";
    private static final String TAG = "PbapClientService";
    private static final String SERVICE_NAME = "Phonebook Access PCE";
    private static final String SERVICE_NAME = "Phonebook Access PCE";


    /**
     * The component names for the owned authenticator service
     */
    private static final String AUTHENTICATOR_SERVICE =
            AuthenticationService.class.getCanonicalName();

    // MAXIMUM_DEVICES set to 10 to prevent an excessive number of simultaneous devices.
    // MAXIMUM_DEVICES set to 10 to prevent an excessive number of simultaneous devices.
    private static final int MAXIMUM_DEVICES = 10;
    private static final int MAXIMUM_DEVICES = 10;
    private Map<BluetoothDevice, PbapClientStateMachine> mPbapClientStateMachineMap =
    private Map<BluetoothDevice, PbapClientStateMachine> mPbapClientStateMachineMap =
@@ -94,8 +88,6 @@ public class PbapClientService extends ProfileService {
        mDatabaseManager = Objects.requireNonNull(AdapterService.getAdapterService().getDatabase(),
        mDatabaseManager = Objects.requireNonNull(AdapterService.getAdapterService().getDatabase(),
                "DatabaseManager cannot be null when PbapClientService starts");
                "DatabaseManager cannot be null when PbapClientService starts");


        setComponentAvailable(AUTHENTICATOR_SERVICE, true);

        IntentFilter filter = new IntentFilter();
        IntentFilter filter = new IntentFilter();
        filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
        filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
        // delay initial download until after the user is unlocked to add an account.
        // delay initial download until after the user is unlocked to add an account.
@@ -128,7 +120,6 @@ public class PbapClientService extends ProfileService {
            pbapClientStateMachine.doQuit();
            pbapClientStateMachine.doQuit();
        }
        }
        removeUncleanAccounts();
        removeUncleanAccounts();
        setComponentAvailable(AUTHENTICATOR_SERVICE, false);
        return true;
        return true;
    }
    }