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

Commit 1301aec3 authored by Julie Kim's avatar Julie Kim
Browse files

Add debug logging around Tx Power

Bug: 299878610
Test: N/A - only adding debug logs
Change-Id: Id255329cefad6eaa33d757074b699a22846972fc
parent eb55cc18
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.SystemApi;
import android.bluetooth.le.AdvertisingSetParameters.AddressTypeStatus;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

/**
 * The {@link AdvertiseSettings} provide a way to adjust advertising preferences for each
@@ -28,6 +29,7 @@ import android.os.Parcelable;
 * instance of this class.
 */
public final class AdvertiseSettings implements Parcelable {
    private static final String TAG = AdvertiseSettings.class.getSimpleName();
    /**
     * Perform Bluetooth LE advertising in low power mode. This is the default and preferred
     * advertising mode as it consumes the least power.
@@ -230,6 +232,7 @@ public final class AdvertiseSettings implements Parcelable {
                    || txPowerLevel > ADVERTISE_TX_POWER_HIGH) {
                throw new IllegalArgumentException("unknown tx power level " + txPowerLevel);
            }
            Log.d(TAG, "setTxPowerLevel: " + txPowerLevel);
            mTxPowerLevel = txPowerLevel;
            return this;
        }
+4 −0
Original line number Diff line number Diff line
@@ -157,12 +157,16 @@ public final class BluetoothLeAdvertiser {
            }

            if (settings.getTxPowerLevel() == AdvertiseSettings.ADVERTISE_TX_POWER_ULTRA_LOW) {
                Log.d(TAG, "TxPower == ADVERTISE_TX_POWER_ULTRA_LOW");
                parameters.setTxPowerLevel(-21);
            } else if (settings.getTxPowerLevel() == AdvertiseSettings.ADVERTISE_TX_POWER_LOW) {
                Log.d(TAG, "TxPower == ADVERTISE_TX_POWER_LOW");
                parameters.setTxPowerLevel(-15);
            } else if (settings.getTxPowerLevel() == AdvertiseSettings.ADVERTISE_TX_POWER_MEDIUM) {
                Log.d(TAG, "TxPower == ADVERTISE_TX_POWER_MEDIUM");
                parameters.setTxPowerLevel(-7);
            } else if (settings.getTxPowerLevel() == AdvertiseSettings.ADVERTISE_TX_POWER_HIGH) {
                Log.d(TAG, "TxPower == ADVERTISE_TX_POWER_HIGH");
                parameters.setTxPowerLevel(1);
            }