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

Commit 187e0108 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'bt5-cherry-pickery-1' into oc-dev

* changes:
  Bluetooth 5 advertising duration refactoring (4/4)
  Bluetooth LE Advertising minor improvements
  Fix advertise data size estimation
  Hide periodic scanning
  Bluetooth API spelling fixes ("wether" -> "whether")
parents 28119285 260846b3
Loading
Loading
Loading
Loading
+3 −34
Original line number Diff line number Diff line
@@ -7148,7 +7148,6 @@ package android.bluetooth {
    method public static synchronized android.bluetooth.BluetoothAdapter getDefaultAdapter();
    method public int getLeMaximumAdvertisingDataLength();
    method public java.lang.String getName();
    method public android.bluetooth.le.PeriodicAdvertisingManager getPeriodicAdvertisingManager();
    method public int getProfileConnectionState(int);
    method public boolean getProfileProxy(android.content.Context, android.bluetooth.BluetoothProfile.ServiceListener, int);
    method public android.bluetooth.BluetoothDevice getRemoteDevice(java.lang.String);
@@ -7948,7 +7947,7 @@ package android.bluetooth.le {
  }
  public final class AdvertisingSet {
    method public void enableAdvertising(boolean, int);
    method public void enableAdvertising(boolean, int, int);
    method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
    method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
    method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
@@ -8024,8 +8023,8 @@ package android.bluetooth.le {
    method public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void stopAdvertising(android.bluetooth.le.AdvertiseCallback);
    method public void stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback);
  }
@@ -8037,21 +8036,6 @@ package android.bluetooth.le {
    method public void stopScan(android.bluetooth.le.ScanCallback);
  }
  public abstract class PeriodicAdvertisingCallback {
    ctor public PeriodicAdvertisingCallback();
    method public void onPeriodicAdvertisingReport(android.bluetooth.le.PeriodicAdvertisingReport);
    method public void onSyncEstablished(int, android.bluetooth.BluetoothDevice, int, int, int, int);
    method public void onSyncLost(int);
    field public static final int SYNC_NO_RESOURCES = 2; // 0x2
    field public static final int SYNC_NO_RESPONSE = 1; // 0x1
  }
  public final class PeriodicAdvertisingManager {
    method public void registerSync(android.bluetooth.le.ScanResult, int, int, android.bluetooth.le.PeriodicAdvertisingCallback);
    method public void registerSync(android.bluetooth.le.ScanResult, int, int, android.bluetooth.le.PeriodicAdvertisingCallback, android.os.Handler);
    method public void unregisterSync(android.bluetooth.le.PeriodicAdvertisingCallback);
  }
  public final class PeriodicAdvertisingParameters implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getEnable();
@@ -8069,21 +8053,6 @@ package android.bluetooth.le {
    method public android.bluetooth.le.PeriodicAdvertisingParameters.Builder setInterval(int);
  }
  public final class PeriodicAdvertisingReport implements android.os.Parcelable {
    ctor public PeriodicAdvertisingReport(int, int, int, int, android.bluetooth.le.ScanRecord);
    method public int describeContents();
    method public android.bluetooth.le.ScanRecord getData();
    method public int getDataStatus();
    method public int getRssi();
    method public int getSyncHandle();
    method public long getTimestampNanos();
    method public int getTxPower();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.PeriodicAdvertisingReport> CREATOR;
    field public static final int DATA_COMPLETE = 0; // 0x0
    field public static final int DATA_INCOMPLETE_TRUNCATED = 2; // 0x2
  }
  public abstract class ScanCallback {
    ctor public ScanCallback();
    method public void onBatchScanResults(java.util.List<android.bluetooth.le.ScanResult>);
+3 −34
Original line number Diff line number Diff line
@@ -7608,7 +7608,6 @@ package android.bluetooth {
    method public static synchronized android.bluetooth.BluetoothAdapter getDefaultAdapter();
    method public int getLeMaximumAdvertisingDataLength();
    method public java.lang.String getName();
    method public android.bluetooth.le.PeriodicAdvertisingManager getPeriodicAdvertisingManager();
    method public int getProfileConnectionState(int);
    method public boolean getProfileProxy(android.content.Context, android.bluetooth.BluetoothProfile.ServiceListener, int);
    method public android.bluetooth.BluetoothDevice getRemoteDevice(java.lang.String);
@@ -8414,7 +8413,7 @@ package android.bluetooth.le {
  }
  public final class AdvertisingSet {
    method public void enableAdvertising(boolean, int);
    method public void enableAdvertising(boolean, int, int);
    method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
    method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
    method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
@@ -8490,8 +8489,8 @@ package android.bluetooth.le {
    method public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void stopAdvertising(android.bluetooth.le.AdvertiseCallback);
    method public void stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback);
  }
@@ -8506,21 +8505,6 @@ package android.bluetooth.le {
    method public void stopScan(android.bluetooth.le.ScanCallback);
  }
  public abstract class PeriodicAdvertisingCallback {
    ctor public PeriodicAdvertisingCallback();
    method public void onPeriodicAdvertisingReport(android.bluetooth.le.PeriodicAdvertisingReport);
    method public void onSyncEstablished(int, android.bluetooth.BluetoothDevice, int, int, int, int);
    method public void onSyncLost(int);
    field public static final int SYNC_NO_RESOURCES = 2; // 0x2
    field public static final int SYNC_NO_RESPONSE = 1; // 0x1
  }
  public final class PeriodicAdvertisingManager {
    method public void registerSync(android.bluetooth.le.ScanResult, int, int, android.bluetooth.le.PeriodicAdvertisingCallback);
    method public void registerSync(android.bluetooth.le.ScanResult, int, int, android.bluetooth.le.PeriodicAdvertisingCallback, android.os.Handler);
    method public void unregisterSync(android.bluetooth.le.PeriodicAdvertisingCallback);
  }
  public final class PeriodicAdvertisingParameters implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getEnable();
@@ -8538,21 +8522,6 @@ package android.bluetooth.le {
    method public android.bluetooth.le.PeriodicAdvertisingParameters.Builder setInterval(int);
  }
  public final class PeriodicAdvertisingReport implements android.os.Parcelable {
    ctor public PeriodicAdvertisingReport(int, int, int, int, android.bluetooth.le.ScanRecord);
    method public int describeContents();
    method public android.bluetooth.le.ScanRecord getData();
    method public int getDataStatus();
    method public int getRssi();
    method public int getSyncHandle();
    method public long getTimestampNanos();
    method public int getTxPower();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.PeriodicAdvertisingReport> CREATOR;
    field public static final int DATA_COMPLETE = 0; // 0x0
    field public static final int DATA_INCOMPLETE_TRUNCATED = 2; // 0x2
  }
  public final class ResultStorageDescriptor implements android.os.Parcelable {
    ctor public ResultStorageDescriptor(int, int, int);
    method public int describeContents();
+3 −34
Original line number Diff line number Diff line
@@ -7178,7 +7178,6 @@ package android.bluetooth {
    method public static synchronized android.bluetooth.BluetoothAdapter getDefaultAdapter();
    method public int getLeMaximumAdvertisingDataLength();
    method public java.lang.String getName();
    method public android.bluetooth.le.PeriodicAdvertisingManager getPeriodicAdvertisingManager();
    method public int getProfileConnectionState(int);
    method public boolean getProfileProxy(android.content.Context, android.bluetooth.BluetoothProfile.ServiceListener, int);
    method public android.bluetooth.BluetoothDevice getRemoteDevice(java.lang.String);
@@ -7978,7 +7977,7 @@ package android.bluetooth.le {
  }
  public final class AdvertisingSet {
    method public void enableAdvertising(boolean, int);
    method public void enableAdvertising(boolean, int, int);
    method public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
    method public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
    method public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
@@ -8054,8 +8053,8 @@ package android.bluetooth.le {
    method public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback);
    method public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
    method public void stopAdvertising(android.bluetooth.le.AdvertiseCallback);
    method public void stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback);
  }
@@ -8067,21 +8066,6 @@ package android.bluetooth.le {
    method public void stopScan(android.bluetooth.le.ScanCallback);
  }
  public abstract class PeriodicAdvertisingCallback {
    ctor public PeriodicAdvertisingCallback();
    method public void onPeriodicAdvertisingReport(android.bluetooth.le.PeriodicAdvertisingReport);
    method public void onSyncEstablished(int, android.bluetooth.BluetoothDevice, int, int, int, int);
    method public void onSyncLost(int);
    field public static final int SYNC_NO_RESOURCES = 2; // 0x2
    field public static final int SYNC_NO_RESPONSE = 1; // 0x1
  }
  public final class PeriodicAdvertisingManager {
    method public void registerSync(android.bluetooth.le.ScanResult, int, int, android.bluetooth.le.PeriodicAdvertisingCallback);
    method public void registerSync(android.bluetooth.le.ScanResult, int, int, android.bluetooth.le.PeriodicAdvertisingCallback, android.os.Handler);
    method public void unregisterSync(android.bluetooth.le.PeriodicAdvertisingCallback);
  }
  public final class PeriodicAdvertisingParameters implements android.os.Parcelable {
    method public int describeContents();
    method public boolean getEnable();
@@ -8099,21 +8083,6 @@ package android.bluetooth.le {
    method public android.bluetooth.le.PeriodicAdvertisingParameters.Builder setInterval(int);
  }
  public final class PeriodicAdvertisingReport implements android.os.Parcelable {
    ctor public PeriodicAdvertisingReport(int, int, int, int, android.bluetooth.le.ScanRecord);
    method public int describeContents();
    method public android.bluetooth.le.ScanRecord getData();
    method public int getDataStatus();
    method public int getRssi();
    method public int getSyncHandle();
    method public long getTimestampNanos();
    method public int getTxPower();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.le.PeriodicAdvertisingReport> CREATOR;
    field public static final int DATA_COMPLETE = 0; // 0x0
    field public static final int DATA_INCOMPLETE_TRUNCATED = 2; // 0x2
  }
  public abstract class ScanCallback {
    ctor public ScanCallback();
    method public void onBatchScanResults(java.util.List<android.bluetooth.le.ScanResult>);
+1 −0
Original line number Diff line number Diff line
@@ -638,6 +638,7 @@ public final class BluetoothAdapter {
     * <p>
     * Use {@link #isLePeriodicAdvertisingSupported()} to check whether LE Periodic Advertising is
     * supported on this device before calling this method.
     * @hide
     */
    public PeriodicAdvertisingManager getPeriodicAdvertisingManager() {
      if (!getLeAccess())
+1 −1
Original line number Diff line number Diff line
@@ -778,7 +778,7 @@ public final class BluetoothGatt implements BluetoothProfile {

    /**
     * Set the preferred connection PHY for this app. Please note that this is just a
     * recommendation, wether the PHY change will happen depends on other applications peferences,
     * recommendation, whether the PHY change will happen depends on other applications peferences,
     * local and remote controller capabilities. Controller can override these settings.
     * <p>
     * {@link BluetoothGattCallback#onPhyUpdate} will be triggered as a result of this call, even
Loading