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

Commit f55ab8c8 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4551672 from 1fc49dc6173cb9834fa41d03484352bc6ab59527 to pi-release

Change-Id: I92771b5f128f91b5d001b48d1c79aeff4c77b76f
parents 0734aaca 42037b29
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -1674,6 +1674,27 @@ public final class BluetoothAdapter {
        return 0;
    }

    /**
     * Get the maximum number of connected audio devices.
     *
     * @return the maximum number of connected audio devices
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH)
    public int getMaxConnectedAudioDevices() {
        try {
            mServiceLock.readLock().lock();
            if (mService != null) {
                return mService.getMaxConnectedAudioDevices();
            }
        } catch (RemoteException e) {
            Log.e(TAG, "failed to get getMaxConnectedAudioDevices, error: ", e);
        } finally {
            mServiceLock.readLock().unlock();
        }
        return 1;
    }

    /**
     * Return true if hardware has entries available for matching beacons
     *
+20 −4
Original line number Diff line number Diff line
@@ -73,17 +73,18 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
    private final boolean mOutgoing;
    private final UUID mUUID;
    private final long mCreationElapsedMilli;
    private final boolean mInBandRing;

    /**
     * Creates BluetoothHeadsetClientCall instance.
     */
    public BluetoothHeadsetClientCall(BluetoothDevice device, int id, int state, String number,
            boolean multiParty, boolean outgoing) {
        this(device, id, UUID.randomUUID(), state, number, multiParty, outgoing);
            boolean multiParty, boolean outgoing, boolean inBandRing) {
        this(device, id, UUID.randomUUID(), state, number, multiParty, outgoing, inBandRing);
    }

    public BluetoothHeadsetClientCall(BluetoothDevice device, int id, UUID uuid, int state,
            String number, boolean multiParty, boolean outgoing) {
            String number, boolean multiParty, boolean outgoing, boolean inBandRing) {
        mDevice = device;
        mId = id;
        mUUID = uuid;
@@ -91,6 +92,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
        mNumber = number != null ? number : "";
        mMultiParty = multiParty;
        mOutgoing = outgoing;
        mInBandRing = inBandRing;
        mCreationElapsedMilli = SystemClock.elapsedRealtime();
    }

@@ -200,6 +202,16 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
        return mOutgoing;
    }

    /**
     * Checks if the ringtone will be generated by the connected phone
     *
     * @return <code>true</code> if in band ring is enabled, <code>false</code> otherwise.
     */
    public boolean isInBandRing() {
        return mInBandRing;
    }


    @Override
    public String toString() {
        return toString(false);
@@ -253,6 +265,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
        builder.append(mMultiParty);
        builder.append(", mOutgoing: ");
        builder.append(mOutgoing);
        builder.append(", mInBandRing: ");
        builder.append(mInBandRing);
        builder.append("}");
        return builder.toString();
    }
@@ -266,7 +280,8 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
                public BluetoothHeadsetClientCall createFromParcel(Parcel in) {
                    return new BluetoothHeadsetClientCall((BluetoothDevice) in.readParcelable(null),
                            in.readInt(), UUID.fromString(in.readString()), in.readInt(),
                            in.readString(), in.readInt() == 1, in.readInt() == 1);
                            in.readString(), in.readInt() == 1, in.readInt() == 1,
                            in.readInt() == 1);
                }

                @Override
@@ -284,6 +299,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable {
        out.writeString(mNumber);
        out.writeInt(mMultiParty ? 1 : 0);
        out.writeInt(mOutgoing ? 1 : 0);
        out.writeInt(mInBandRing ? 1 : 0);
    }

    @Override
+9 −3
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Slog;

import com.android.internal.R;
import com.android.internal.util.DumpUtils;
import com.android.server.pm.UserRestrictionsUtils;

@@ -415,9 +416,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {

        int systemUiUid = -1;
        try {
            // Check if device is configured with no home screen, which implies no SystemUI.
            boolean noHome = mContext.getResources().getBoolean(R.bool.config_noHomeScreen);
            if (!noHome) {
                systemUiUid = mContext.getPackageManager()
                        .getPackageUidAsUser("com.android.systemui", PackageManager.MATCH_SYSTEM_ONLY,
                                UserHandle.USER_SYSTEM);
            }
            Slog.d(TAG, "Detected SystemUiUid: " + Integer.toString(systemUiUid));
        } catch (PackageManager.NameNotFoundException e) {
            // Some platforms, such as wearables do not have a system ui.
            Slog.w(TAG, "Unable to resolve SystemUI's UID.", e);