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

Commit 83fa22ae authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check the result of getBluetoothServiceManager"

parents b56a48eb 64a34f12
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.AttributionSource;
import android.content.Context;
import android.os.Binder;
import android.os.BluetoothServiceManager;
import android.os.Build;
import android.os.IBinder;
import android.os.ParcelUuid;
@@ -836,10 +837,14 @@ public final class BluetoothAdapter {

    /** {@hide} */
    public static BluetoothAdapter createAdapter(AttributionSource attributionSource) {
        BluetoothServiceManager manager =
                BluetoothFrameworkInitializer.getBluetoothServiceManager();
        if (manager == null) {
            Log.e(TAG, "BluetoothServiceManager is null");
            return null;
        }
        IBluetoothManager service = IBluetoothManager.Stub.asInterface(
          BluetoothFrameworkInitializer.getBluetoothServiceManager()
              .getBluetoothManagerServiceRegisterer()
              .get());
                manager.getBluetoothManagerServiceRegisterer().get());
        if (service != null) {
            return new BluetoothAdapter(service, attributionSource);
        } else {