Loading android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +36 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,10 @@ class AdapterProperties { 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 Loading Loading @@ -280,6 +284,34 @@ class AdapterProperties { return mIsActivityAndEnergyReporting; } /** * @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 */ Loading Loading @@ -593,6 +625,10 @@ class AdapterProperties { + (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 = " Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +32 −4 Original line number Diff line number Diff line Loading @@ -1333,19 +1333,27 @@ public class AdapterService extends Service { } 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() { Loading Loading @@ -1895,6 +1903,26 @@ public class AdapterService extends Service { 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 || Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +36 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,10 @@ class AdapterProperties { 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 Loading Loading @@ -280,6 +284,34 @@ class AdapterProperties { return mIsActivityAndEnergyReporting; } /** * @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 */ Loading Loading @@ -593,6 +625,10 @@ class AdapterProperties { + (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 = " Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +32 −4 Original line number Diff line number Diff line Loading @@ -1333,19 +1333,27 @@ public class AdapterService extends Service { } 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() { Loading Loading @@ -1895,6 +1903,26 @@ public class AdapterService extends Service { 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 || Loading