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

Commit de13958f authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "Framework: Remove dead code" into main

parents 7b3ee3b1 ef3b2355
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@ interface IBluetoothMapClient {
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED })")
    boolean disconnect(in BluetoothDevice device, in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    boolean isConnected(in BluetoothDevice device, in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    List<BluetoothDevice> getConnectedDevices(in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource);
@@ -45,10 +43,4 @@ interface IBluetoothMapClient {
    int getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.SEND_SMS })")
    boolean sendMessage(in BluetoothDevice device, in Uri[] contacts, in  String message, in PendingIntent sentIntent, in PendingIntent deliveryIntent, in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.READ_SMS })")
    boolean getUnreadMessages(in BluetoothDevice device, in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    int getSupportedFeatures(in BluetoothDevice device, in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf = { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.READ_SMS })")
    boolean setMessageStatus(in BluetoothDevice device, in String handle, in int status, in AttributionSource attributionSource);
}
+4 −60
Original line number Diff line number Diff line
@@ -426,7 +426,6 @@ public class MapClientService extends ProfileService {
        private MapClientService mService;

        Binder(MapClientService service) {
            Log.v(TAG, "Binder()");
            mService = service;
        }

@@ -449,18 +448,6 @@ public class MapClientService extends ProfileService {
            mService = null;
        }

        @Override
        public boolean isConnected(BluetoothDevice device, AttributionSource source) {
            Log.v(TAG, "isConnected()");

            MapClientService service = getService(source);
            if (service == null) {
                return false;
            }

            return service.getConnectionState(device) == BluetoothProfile.STATE_CONNECTED;
        }

        @Override
        public boolean connect(BluetoothDevice device, AttributionSource source) {
            Log.v(TAG, "connect()");
@@ -575,46 +562,6 @@ public class MapClientService extends ProfileService {

            return service.sendMessage(device, contacts, message, sentIntent, deliveredIntent);
        }

        @Override
        public boolean getUnreadMessages(BluetoothDevice device, AttributionSource source) {
            Log.v(TAG, "getUnreadMessages()");

            MapClientService service = getService(source);
            if (service == null) {
                return false;
            }

            mService.enforceCallingOrSelfPermission(
                    Manifest.permission.READ_SMS, "Need READ_SMS permission");
            return service.getUnreadMessages(device);
        }

        @Override
        public int getSupportedFeatures(BluetoothDevice device, AttributionSource source) {
            Log.v(TAG, "getSupportedFeatures()");

            MapClientService service = getService(source);
            if (service == null) {
                Log.d(TAG, "in MapClientService getSupportedFeatures stub, returning 0");
                return 0;
            }
            return service.getSupportedFeatures(device);
        }

        @Override
        public boolean setMessageStatus(
                BluetoothDevice device, String handle, int status, AttributionSource source) {
            Log.v(TAG, "setMessageStatus()");

            MapClientService service = getService(source);
            if (service == null) {
                return false;
            }
            mService.enforceCallingOrSelfPermission(
                    Manifest.permission.READ_SMS, "Need READ_SMS permission");
            return service.setMessageStatus(device, handle, status);
        }
    }

    public void aclDisconnected(BluetoothDevice device, int transport) {
@@ -624,16 +571,13 @@ public class MapClientService extends ProfileService {
    private void handleAclDisconnected(BluetoothDevice device, int transport) {
        MceStateMachine stateMachine = mMapInstanceMap.get(device);
        if (stateMachine == null) {
            Log.e(TAG, "No Statemachine found for the device=" + device.toString());
            Log.e(TAG, "No Statemachine found for the device=" + device);
            return;
        }

        Log.i(
                TAG,
                "Received ACL disconnection event, device="
                        + device.toString()
                        + ", transport="
                        + transport);
                "Received ACL disconnection event, device=" + device + ", transport=" + transport);

        if (transport != BluetoothDevice.TRANSPORT_BREDR) {
            return;
@@ -652,9 +596,9 @@ public class MapClientService extends ProfileService {
    private void handleSdpSearchRecordReceived(
            BluetoothDevice device, int status, Parcelable record, ParcelUuid uuid) {
        MceStateMachine stateMachine = mMapInstanceMap.get(device);
        Log.d(TAG, "Received SDP Record, device=" + device.toString() + ", uuid=" + uuid);
        Log.d(TAG, "Received SDP Record, device=" + device + ", uuid=" + uuid);
        if (stateMachine == null) {
            Log.e(TAG, "No Statemachine found for the device=" + device.toString());
            Log.e(TAG, "No Statemachine found for the device=" + device);
            return;
        }
        if (uuid.equals(BluetoothUuid.MAS)) {
+0 −4
Original line number Diff line number Diff line
@@ -73,10 +73,6 @@ public class BluetoothLeCallControlProxy {
        mBluetoothLeCallControl.unregisterBearer();
    }

    public int getContentControlId() {
        return mBluetoothLeCallControl.getContentControlId();
    }

    public void requestResult(int requestId, int result) {
        mBluetoothLeCallControl.requestResult(requestId, result);
    }
+0 −7
Original line number Diff line number Diff line
@@ -205,13 +205,6 @@ public class HeadsetClientServiceBinderTest {
        verify(mService).dial(mRemoteDevice, number);
    }

    @Test
    public void getCurrentCalls_callsServiceMethod() {
        mBinder.getCurrentCalls(mRemoteDevice, null);

        verify(mService).getCurrentCalls(mRemoteDevice);
    }

    @Test
    public void sendDTMF_callsServiceMethod() {
        byte code = 21;
+0 −23
Original line number Diff line number Diff line
@@ -112,29 +112,6 @@ public class MapClientServiceBinderTest {
        verify(mService).sendMessage(mRemoteDevice, contacts, message, null, null);
    }

    @Test
    public void getUnreadMessages_callsServiceMethod() {
        mBinder.getUnreadMessages(mRemoteDevice, null);

        verify(mService).getUnreadMessages(mRemoteDevice);
    }

    @Test
    public void getSupportedFeatures_callsServiceMethod() {
        mBinder.getSupportedFeatures(mRemoteDevice, null);

        verify(mService).getSupportedFeatures(mRemoteDevice);
    }

    @Test
    public void setMessageStatus_callsServiceMethod() {
        String handle = "FFAB";
        int status = 1234;
        mBinder.setMessageStatus(mRemoteDevice, handle, status, null);

        verify(mService).setMessageStatus(mRemoteDevice, handle, status);
    }

    @Test
    public void cleanUp_doesNotCrash() {
        mBinder.cleanup();
Loading