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

Commit a7340e73 authored by William Escande's avatar William Escande
Browse files

SystemServer aidl: Remove dependency to framework

Bug: 288450479
Bug: 321804999
Test: atest ServiceBluetoothRoboTests
Test: m service-bluetooth | No-op change
      Flag testing will be done in follow-up, before flag rollout
Change-Id: I4adbf8fb0b5a598b1d3e8a3b9afa514885336919
parent fc5884ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ java_defaults {
        "PlatformProperties",
        "bluetooth_flags_java_lib",
        "modules-utils-expresslog",
        "service-bluetooth-binder-aidl",
    ],
    libs: [
        "app-compat-annotations",
@@ -41,7 +42,6 @@ java_defaults {
    srcs: [
        ":Bluetooth-binder-aidl",
        ":framework-bluetooth-sources",
        ":service-bluetooth-binder-aidl",
    ],
}

+7 −5
Original line number Diff line number Diff line
@@ -3740,13 +3740,13 @@ public final class BluetoothAdapter {

    private static final IBluetoothManagerCallback sManagerCallback =
            new IBluetoothManagerCallback.Stub() {
                public void onBluetoothServiceUp(IBluetooth bluetoothService) {
                public void onBluetoothServiceUp(IBinder bluetoothService) {
                    if (DBG) {
                        Log.d(TAG, "onBluetoothServiceUp: " + bluetoothService);
                    }

                    synchronized (sServiceLock) {
                        sService = bluetoothService;
                        sService = IBluetooth.Stub.asInterface(bluetoothService);
                        for (IBluetoothManagerCallback cb : sProxyServiceStateCallbacks.keySet()) {
                            try {
                                if (cb != null) {
@@ -3825,11 +3825,11 @@ public final class BluetoothAdapter {

    private final IBluetoothManagerCallback mManagerCallback =
            new IBluetoothManagerCallback.Stub() {
                public void onBluetoothServiceUp(@NonNull IBluetooth bluetoothService) {
                public void onBluetoothServiceUp(@NonNull IBinder bluetoothService) {
                    requireNonNull(bluetoothService, "bluetoothService cannot be null");
                    mServiceLock.writeLock().lock();
                    try {
                        mService = bluetoothService;
                        mService = IBluetooth.Stub.asInterface(bluetoothService);
                    } finally {
                        // lock downgrade is possible in ReentrantReadWriteLock
                        mServiceLock.readLock().lock();
@@ -4282,7 +4282,9 @@ public final class BluetoothAdapter {
        if (isRegistered != wantRegistered) {
            if (wantRegistered) {
                try {
                    sService = mManagerService.registerAdapter(sManagerCallback);
                    sService =
                            IBluetooth.Stub.asInterface(
                                    mManagerService.registerAdapter(sManagerCallback));
                } catch (RemoteException e) {
                    throw e.rethrowAsRuntimeException();
                }
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ java_defaults {
        "framework-bluetooth-pre-jarjar",
        "framework-configinfrastructure",
        "framework-statsd.stubs.module_lib",
        "service-bluetooth-binder-aidl",
        "service-bluetooth.change-ids",
    ],

+9 −1
Original line number Diff line number Diff line
@@ -8,11 +8,19 @@ package {
}

// AIDL interface used in service-bluetooth
filegroup {
java_library {
    name: "service-bluetooth-binder-aidl",
    defaults: ["bluetooth-module-sdk-version-defaults"],
    visibility: ["//packages/modules/Bluetooth:__subpackages__"],
    srcs: [
        "android/bluetooth/IBluetoothManager.aidl",
        "android/bluetooth/IBluetoothManagerCallback.aidl",
    ],
    libs: [
        "framework-annotations-lib",
    ],
    sdk_version: "module_current",
    apex_available: [
        "com.android.btservices",
    ],
}
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.bluetooth;

import android.bluetooth.IBluetooth;
import android.bluetooth.IBluetoothManagerCallback;
import android.content.AttributionSource;

@@ -28,7 +27,7 @@ import android.content.AttributionSource;
interface IBluetoothManager
{
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    IBluetooth registerAdapter(in IBluetoothManagerCallback callback);
    IBinder registerAdapter(in IBluetoothManagerCallback callback);
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    void unregisterAdapter(in IBluetoothManagerCallback callback);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
Loading