merge in oc-release history after reset to master
diff --git a/src/com/android/bluetooth/btservice/AdapterProperties.java b/src/com/android/bluetooth/btservice/AdapterProperties.java
index 34b0301..dd53446 100644
--- a/src/com/android/bluetooth/btservice/AdapterProperties.java
+++ b/src/com/android/bluetooth/btservice/AdapterProperties.java
@@ -78,6 +78,10 @@
private boolean mIsExtendedScanSupported;
private boolean mIsDebugLogSupported;
private boolean mIsActivityAndEnergyReporting;
+ private boolean mIsLe2MPhySupported;
+ private boolean mIsLeCodedPhySupported;
+ private boolean mIsLeExtendedAdvertisingSupported;
+ private boolean mIsLePeriodicAdvertisingSupported;
private BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
@@ -281,6 +285,34 @@
}
/**
+ * @return the mIsLe2MPhySupported
+ */
+ boolean isLe2MPhySupported() {
+ return mIsLe2MPhySupported;
+ }
+
+ /**
+ * @return the mIsLeCodedPhySupported
+ */
+ boolean isLeCodedPhySupported() {
+ return mIsLeCodedPhySupported;
+ }
+
+ /**
+ * @return the mIsLeExtendedAdvertisingSupported
+ */
+ boolean isLeExtendedAdvertisingSupported() {
+ return mIsLeExtendedAdvertisingSupported;
+ }
+
+ /**
+ * @return the mIsLePeriodicAdvertisingSupported
+ */
+ boolean isLePeriodicAdvertisingSupported() {
+ return mIsLePeriodicAdvertisingSupported;
+ }
+
+ /**
* @return total number of trackable advertisements
*/
int getTotalNumOfTrackableAdvertisements() {
@@ -593,6 +625,10 @@
+ (0xFF & ((int)val[10]));
mIsExtendedScanSupported = ((0xFF & ((int)val[12])) != 0);
mIsDebugLogSupported = ((0xFF & ((int)val[13])) != 0);
+ mIsLe2MPhySupported = ((0xFF & ((int) val[14])) != 0);
+ mIsLeCodedPhySupported = ((0xFF & ((int) val[15])) != 0);
+ mIsLeExtendedAdvertisingSupported = ((0xFF & ((int) val[16])) != 0);
+ mIsLePeriodicAdvertisingSupported = ((0xFF & ((int) val[17])) != 0);
Log.d(TAG, "BT_PROPERTY_LOCAL_LE_FEATURES: update from BT controller"
+ " mNumOfAdvertisementInstancesSupported = "
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java
index 44efe4c..42da477 100644
--- a/src/com/android/bluetooth/btservice/AdapterService.java
+++ b/src/com/android/bluetooth/btservice/AdapterService.java
@@ -1333,19 +1333,27 @@
}
public boolean isLe2MPhySupported() {
- return false;
+ AdapterService service = getService();
+ if (service == null) return false;
+ return service.isLe2MPhySupported();
}
public boolean isLeCodedPhySupported() {
- return false;
+ AdapterService service = getService();
+ if (service == null) return false;
+ return service.isLeCodedPhySupported();
}
public boolean isLeExtendedAdvertisingSupported() {
- return false;
+ AdapterService service = getService();
+ if (service == null) return false;
+ return service.isLeExtendedAdvertisingSupported();
}
public boolean isLePeriodicAdvertisingSupported() {
- return false;
+ AdapterService service = getService();
+ if (service == null) return false;
+ return service.isLePeriodicAdvertisingSupported();
}
public boolean isActivityAndEnergyReportingSupported() {
@@ -1895,6 +1903,26 @@
return mAdapterProperties.isActivityAndEnergyReportingSupported();
}
+ public boolean isLe2MPhySupported() {
+ enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
+ return mAdapterProperties.isLe2MPhySupported();
+ }
+
+ public boolean isLeCodedPhySupported() {
+ enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
+ return mAdapterProperties.isLeCodedPhySupported();
+ }
+
+ public boolean isLeExtendedAdvertisingSupported() {
+ enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
+ return mAdapterProperties.isLeExtendedAdvertisingSupported();
+ }
+
+ public boolean isLePeriodicAdvertisingSupported() {
+ enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
+ return mAdapterProperties.isLePeriodicAdvertisingSupported();
+ }
+
private BluetoothActivityEnergyInfo reportActivityInfo() {
enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, "Need BLUETOOTH permission");
if (mAdapterProperties.getState() != BluetoothAdapter.STATE_ON ||
diff --git a/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java b/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java
index 31184d8..cbea8c5 100644
--- a/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java
+++ b/src/com/android/bluetooth/pbapclient/PbapClientConnectionHandler.java
@@ -61,8 +61,20 @@
private static final int PBAP_FEATURE_BROWSING = 0x00000002;
private static final int PBAP_FEATURE_DOWNLOADING = 0x00000001;
+ private static final long PBAP_FILTER_VERSION = 1 << 0;
+ private static final long PBAP_FILTER_FN = 1 << 1;
+ private static final long PBAP_FILTER_N = 1 << 2;
+ private static final long PBAP_FILTER_PHOTO = 1 << 3;
+ private static final long PBAP_FILTER_ADR = 1 << 5;
+ private static final long PBAP_FILTER_TEL = 1 << 7;
+ private static final long PBAP_FILTER_EMAIL = 1 << 8;
+ private static final long PBAP_FILTER_NICKNAME = 1 << 23;
+
private static final int PBAP_SUPPORTED_FEATURE =
PBAP_FEATURE_DEFAULT_IMAGE_FORMAT | PBAP_FEATURE_BROWSING | PBAP_FEATURE_DOWNLOADING;
+ private static final long PBAP_REQUESTED_FIELDS = PBAP_FILTER_VERSION | PBAP_FILTER_FN
+ | PBAP_FILTER_N | PBAP_FILTER_PHOTO | PBAP_FILTER_ADR | PBAP_FILTER_TEL
+ | PBAP_FILTER_NICKNAME;
private static final int PBAP_V1_2 = 0x0102;
private static final int L2CAP_INVALID_PSM = -1;
@@ -206,8 +218,8 @@
}
// Start at contact 1 to exclued Owner Card PBAP 1.1 sec 3.1.5.2
BluetoothPbapRequestPullPhoneBook request =
- new BluetoothPbapRequestPullPhoneBook(PB_PATH, mAccount, 0,
- VCARD_TYPE_30, 0, 1);
+ new BluetoothPbapRequestPullPhoneBook(
+ PB_PATH, mAccount, PBAP_REQUESTED_FIELDS, VCARD_TYPE_30, 0, 1);
request.execute(mObexSession);
PhonebookPullRequest processor =
new PhonebookPullRequest(mPbapClientStateMachine.getContext(),
diff --git a/src/com/android/bluetooth/pbapclient/PhonebookPullRequest.java b/src/com/android/bluetooth/pbapclient/PhonebookPullRequest.java
index eee4321..8881baf 100644
--- a/src/com/android/bluetooth/pbapclient/PhonebookPullRequest.java
+++ b/src/com/android/bluetooth/pbapclient/PhonebookPullRequest.java
@@ -43,7 +43,7 @@
import java.util.List;
public class PhonebookPullRequest extends PullRequest {
- private static final int MAX_OPS = 500;
+ private static final int MAX_OPS = 250;
private static final boolean VDBG = false;
private static final String TAG = "PbapPhonebookPullRequest";